[GRASS-dev] [GRASS GIS] #789: g.region option to expand the computational region of about "some" pixels?

GRASS GIS trac at osgeo.org
Wed Oct 14 18:46:37 EDT 2009


#789: g.region option to expand the computational region of about "some" pixels?
---------------------------------------------------+------------------------
 Reporter:  nikos                                  |       Owner:  grass-dev at lists.osgeo.org
     Type:  enhancement                            |      Status:  new                      
 Priority:  normal                                 |   Milestone:  7.0.0                    
Component:  default                                |     Version:  unspecified              
 Keywords:  g.region, expand computational region  |    Platform:  Unspecified              
      Cpu:  Unspecified                            |  
---------------------------------------------------+------------------------
 Let's accept that we have a set of point (vector) maps and we need to
 update one of their attributes by querying a raster map. We would use
 v.what.rast of course to get the job done.

 Now, in order to save time and system resources, we would like to match
 the active region over the point map since we care about this area of the
 raster map (from which v.what.rast will grab the values and feed some
 column in the point map).

 We could execute for example:
 "g.region res=ResOfRaster vect=PointMap -pa"

 Matching the region over a point map is the problem! The points at the
 borders (happens quite often to me when the resolution of the raster map
 is low and so does the resolution of the region successively) are not
 taken into account.

 To overcome the problem I had to find a way to "grow the region" so the
 region matching is "v.what.rast safe" :-). OK, in my case it was easy as
 the points where actually centroids extracted from a vector grid map. So
 matching the region to the original vector grid map did it.

 But what if it's not the case to have a vector, enough larger than the
 point map, to perform a "v.what.rast safe" region matching?

 (a) anybody else facing this problem?

 Herewith I would like to suggest the implementation of a new option for
 g.region, a "v.what.rast-safe" option :-p

 (b) is it difficult to build in a flag (let's say -x which will stand for
 eXpand) to "grow" the (2D) region in both, vertical and horizontal manner
 of about 1(or more?) pixel(s) (where pixel size here is meant to be the
 resolution of the 2D raster map to be queried)?

 I imagine something that would use r.mapcalc (or r.mask), r.grow and
 g.region itself?

 Thanks for reading, Nikos

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/789>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list