[GRASS-dev] [GRASS GIS] #2100: r.proj bounding box too small by half a cell size (-g or -p):

GRASS GIS trac at osgeo.org
Mon Oct 14 10:13:52 PDT 2013


#2100: r.proj bounding box too small by half a cell size (-g or -p):
-------------------------+--------------------------------------------------
 Reporter:  awickert     |       Owner:  grass-dev@…              
     Type:  defect       |      Status:  new                      
 Priority:  normal       |   Milestone:  7.0.0                    
Component:  Default      |     Version:  unspecified              
 Keywords:  r.proj       |    Platform:  Linux                    
      Cpu:  Unspecified  |  
-------------------------+--------------------------------------------------

Comment(by awickert):

 Replying to [comment:1 glynn]:

 Thanks for the pointer towards bordwalk.c. Two thoughts:

 (1) Reading the starting comments, it looks like this may in fact be
 intentional to make sure that the region fits within the current region.
 Indeed, when I tried to make changes to bordwalk.c, I found a reason to
 believe that this was the case (below).

 (2) However, this prevents the use of "-p" and "-g" to set the region of
 the current location to match the region of the raster being projected.
 This therefore means that the code as-is contradicts the help files, which
 tell you to do this to ensure a good projection.

 Therefore, I have attached a working diff that removes the parts that take
 the bounding box a half-cell away from the cell margins... mostly. I have
 not adjusted the for loops at all, which may need to be done for a real
 fix, but was unnecessary for the test data set that I was using (48 cell
 N-S x 96 cell E-W GCM outputs spanning the whole globe, so 90S to 90N and
 180W to 180E). Also, I found that the output of the projection would
 shrink to 2 cell widths (though still spanning the whole N-S range) if I
 completely removed the western offset, so I just made that fairly small
 for the time being; this may be a reason that the cell centers were used.

 Anyway, this is only the second time I have done anything to the GRASS
 source code, so I'd greatly appreciate what those of you more familiar
 with this might have to say.

 Cheers,

 Andy Wickert

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/2100#comment:2>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list