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
Raster to points
4 messages · celso at stephan.mus.br, S. Koukoulas (lists), Tim Appelhans +1 more
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, celso at stephan.mus.br 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 R-sig-Geo at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
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, celso at stephan.mus.br 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 R-sig-Geo at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at r-project.org 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
On Sat, Apr 21, 2012 at 3:21 PM, Tim Appelhans <tim.appelhans at gmail.com> 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