[GRASS-user] Overlaying vector with raster-computational problems

Pietro Zambelli peter.zamb at gmail.com
Tue Jul 9 08:26:22 PDT 2013

Hi Paolo,

On Tuesday 09 Jul 2013 13:21:41 Paolo Ruzza wrote:
> Dear GRASS users,
> I am confronted with a "non-standard" problem and I would appreciate any
> help that you can give me. I have several vector files (polygons) and an
> arbitrary raster grid, only with category numbers associated to it. I would
> like to overlay the vectors onto the raster grid in order to query it and
> extract the categories of the raster grid which overlap with the polygons
> of each vector file. I am not interested in getting any info from the
> vector polygons, I just want know where the vector and the raster overlap.
> I have already thought of a way of doing this-I guess it would naturally
> come to mind of every GRASS user. This would involve converting the vectors
> into a rasters and then query the raster grid and the rasterized vectors
> with r.stats. This would be very easy to do, but  my vectors have very
> small islands, which can, of course, be converted into raster cells, if I
> set them my region to a very fine resolution for. However, if I went down
> this route, this would: i) massively slow down vector to raster conversion
> ii) massively slow down the r.stats querying process. Just to give you an
> idea of the magnitude of my problem I am using several vector layers
> (hundreds) at global level and a raster grid at a 2 arc-minutes resolution.
> I am kind of stuck and I am not sure if there is any computationally
> efficient strategy to do what I want. Any help would be greatly appreciated!

I'm not sure that I have understood your problem...
but maybe you can transform the raster into a vector and then check which 
polygons of your vector maps are contained/overlapped in the raster area...

All the best.


More information about the grass-user mailing list