[R-sig-Geo] overlay of spatial polygons with GDALReadOnlyDataset

Robert J. Hijmans r.hijmans at gmail.com
Tue Mar 23 22:23:01 CET 2010


Jorge,

You can probably use the raster package. It is not clear what you want
to accomplish with the overlay, but it could be something like this:

Let p be a SpatialPolygons* object

library(raster)
r = raster('filename')
rp = polygonsToRaster(p, r)
z = zonal(rp, r)

or

library(raster)
r = raster(filename)
pv = polygonValues(r, p)


Best, Robert


On Tue, Mar 23, 2010 at 2:04 PM, Jorge Fernando Saraiva de Menezes
<jorgefernandosaraiva at gmail.com> wrote:
> Dear all,
>
> I'm sorry if this is a too basic question, but I'm trying to make a
> overlay() of spatial polygon with a srtm ASCII altitude map. I tried to read
> this map using readasciigrid, but it is to big for the computer's memory.
> The only way that I find to read this map  is use GDAL.open, but doesn't
> seems to have a method to do overlay with GDALReadOnlyDataset. There is some
> way to use overlay or something like it,with this kind of data, or another
> way to make overlay() with big grids?
>
> Thanks,
> Jorge
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



More information about the R-sig-Geo mailing list