[GRASS-dev] [GRASS GIS] #2055: r.in.gdal lacks flag "-r Limit import to the current region"

GRASS GIS trac at osgeo.org
Fri Sep 16 11:57:36 PDT 2016


#2055: r.in.gdal lacks flag "-r Limit import to the current region"
--------------------------+---------------------------------
  Reporter:  neteler      |      Owner:  grass-dev@…
      Type:  enhancement  |     Status:  new
  Priority:  normal       |  Milestone:  7.2.0
 Component:  Raster       |    Version:  svn-trunk
Resolution:               |   Keywords:  r.in.gdal, r.import
       CPU:  Unspecified  |   Platform:  Unspecified
--------------------------+---------------------------------

Comment (by mmetz):

 Replying to [comment:17 martinl]:
 > You are right, the patch lacks tests - it was just proof-of-concept. I
 will implement them in the next patch.

 The concept is proofed when the patch is working.

 With
 {{{
             /* get pixel coordinates defined by current region */
             pixel_start = (int) (cellhd.west - adfGeoTransform[0]) /
 adfGeoTransform[1];
             line_start = (int) (cellhd.north - adfGeoTransform[3]) /
 adfGeoTransform[5];
             pixel_end = (int) (cellhd.east - adfGeoTransform[0]) /
 adfGeoTransform[1];
             line_end = (int) (cellhd.south - adfGeoTransform[3]) /
 adfGeoTransform[5];
 }}}
 you cast the numerator of the division to int while `Rast_align_window()`
 uses `floor()` and `ceil()` for the equivalent calculations. Why?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2055#comment:18>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list