[GRASS-dev] Re: [GRASS GIS] #328: Add "-e" switch (=extend location extents based on reprojected map) in r.proj

GRASS GIS trac at osgeo.org
Thu Oct 9 21:59:00 EDT 2008


#328: Add "-e" switch  (=extend location extents based on reprojected map) in
r.proj
--------------------------+-------------------------------------------------
  Reporter:  nikos        |       Owner:  grass-dev at lists.osgeo.org
      Type:  enhancement  |      Status:  new                      
  Priority:  minor        |   Milestone:  6.4.0                    
 Component:  default      |     Version:  unspecified              
Resolution:               |    Keywords:                           
  Platform:  Unspecified  |         Cpu:  Unspecified              
--------------------------+-------------------------------------------------
Comment (by hamish):

 Replying to [ticket:328 nikos]:
 > Well, the title speaks itself :-) Would it hurt to have this
 > when reprojecting for example simple study area boundaries or
 > similar? What speaks against it?

 It violates the axiom of "do one thing well".
 The purpose of the module is to reproject maps, not to mess with
 the region. g.region should always be used for that.
 It is the GUI's job to tie those tasks together for the user in a nice
 wizard or menu order, not the individual number crunching modules' job to
 do all-in-one tasks.

 see also trac wishes #37 and #123  (re. r.in.xyz)
 similar arguments there.


 > Also, I read in the manual of r.proj (section NOTES) "To avoid
 > excessive time consumption when reprojecting a map the region
 > and resolution of the target location should be set appropriately
 > beforehand." but it's not clear to me why this can't be
 > accomplished automatically.

 because the user's intentions are unknowable to the program. Another way
 of saying the above is that "r.proj observes the current region settings".

 e.g. if reprojecting from lat/lon WGS84 to UTM, how big should the
 resolution size be?   ?

 My usual method around this is in the source location to do
 g.region rast=map
 v.in.region out=map_box

 then in the target location
 v.proj map_box loc=source
 g.region vect=map_box
 d.vect map_box  # (observe amount of rotation)
 g.region res=... -a
 g.region -p
 # repeat until rows x cols are slightly bigger than source,
 #  resolution is a nice round number, AND!! taking into
 #  account more rows+cols needed as the map is more rotated

 #finally:
 r.proj map loc=source


 the code in i.rectify tries, but doesn't take into account rotation,
 so resolution is lost with rotated maps. see old RC bug #3926
   http://intevation.de/rt/webrt?serial_num=3296

 also
   http://intevation.de/rt/webrt?serial_num=3052
   http://intevation.de/rt/webrt?serial_num=3166

 (we Badly need to back up the two old bug trackers!)


 Hamish

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/328#comment:1>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list