Raster to points

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Raster to points

celso
Hi!

I need to create a new attribute for points in a shapefile containing
values from a raster (originally a kernel) on corresponding position. Does
anyone has a clue?

Thanks!!

Celso Stephan

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: Raster to points

S. Koukoulas (lists)
I am not aware of a function in R but you could use Grass (either as
stand alone or perhaps through the spgrass6 library in R - you need to
have your data in a GRASS location/mapset first) :

v.what.rast  in GRASS (http://www.osgeo.org/grass - open source)

or try the <point sampling tool>  in QGIS which is a plugin from
contributed repository and you need to install it first from <fetch
plugins>. In the second tab tick box <add 3rd party plugins> (qgis.org -
open source)

sotiris

On 20/04/12 19:40, [hidden email] wrote:

> Hi!
>
> I need to create a new attribute for points in a shapefile containing
> values from a raster (originally a kernel) on corresponding position. Does
> anyone has a clue?
>
> Thanks!!
>
> Celso Stephan
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: Raster to points

Tim Salabim
The 'over' function in the sp package should do what you are after.
Cheers
Tim

On 21/4/2012 15:22, S. Koukoulas (lists) wrote:

> I am not aware of a function in R but you could use Grass (either as
> stand alone or perhaps through the spgrass6 library in R - you need to
> have your data in a GRASS location/mapset first) :
>
> v.what.rast  in GRASS (http://www.osgeo.org/grass - open source)
>
> or try the<point sampling tool>   in QGIS which is a plugin from
> contributed repository and you need to install it first from<fetch
> plugins>. In the second tab tick box<add 3rd party plugins>  (qgis.org -
> open source)
>
> sotiris
>
> On 20/04/12 19:40, [hidden email] wrote:
>> Hi!
>>
>> I need to create a new attribute for points in a shapefile containing
>> values from a raster (originally a kernel) on corresponding position. Does
>> anyone has a clue?
>>
>> Thanks!!
>>
>> Celso Stephan
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> [hidden email]
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

--
#####################################
Tim Appelhans
Department of Geography
Environmental Computer Sciences
Philipps Universit├Ąt Marburg
Deutschhausstra├če 12
35032 Marburg (Paketpost: 35037 Marburg)
Germany

Tel +49 (0) 6421 28-25957

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: Raster to points

Barry Rowlingson
On Sat, Apr 21, 2012 at 3:21 PM, Tim Appelhans <[hidden email]> wrote:
> The 'over' function in the sp package should do what you are after.

 Except the function doesn't apply to rasters, by which I mean objects
from the raster package.

If you have:

dem = raster("dem.tif")
pts = readShapeSpatial("pts.shp")

then extract(dem,pts) will return the values of the dem raster at the
locations of  the points in pts.

No need to use GRASS or QGIS for this.

Barry

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo