[GRASS-dev] [GRASS GIS] #2757: r.import: ERROR: Input raster map is outside current region

GRASS GIS trac at osgeo.org
Thu Mar 2 13:54:47 PST 2017


#2757: r.import: ERROR: Input raster map is outside current region
-------------------------+-------------------------------------------------
  Reporter:  neteler     |      Owner:  grass-dev@…
      Type:  defect      |     Status:  reopened
  Priority:  normal      |  Milestone:  7.0.6
 Component:  Python      |    Version:  svn-trunk
Resolution:              |   Keywords:  r.import, r.in.gdal, r.external,
       CPU:              |  r.region
  Unspecified            |   Platform:  All
-------------------------+-------------------------------------------------
Changes (by neteler):

 * keywords:  r.import => r.import, r.in.gdal, r.external, r.region
 * platform:  Unspecified => All


Comment:

 I have tested r70664 with the GMTED2010 elevation model:

 {{{
 gdalinfo
 /vsizip/vsicurl/http://edcintl.cr.usgs.gov/downloads/sciweb1/shared/topo/downloads/GMTED/Grid_ZipFiles/mn30_grd.zip/mn30_grd
 -nofl -norat
 Driver: AIG/Arc/Info Binary Grid
 Files:
 /vsizip/vsicurl/http://edcintl.cr.usgs.gov/downloads/sciweb1/shared/topo/downloads/GMTED/Grid_ZipFiles/mn30_grd.zip/mn30_grd
 Size is 43200, 20880
 Coordinate System is:
 GEOGCS["WGS 84",
     DATUM["WGS_1984",
         SPHEROID["WGS 84",6378137,298.257223563,
             AUTHORITY["EPSG","7030"]],
         AUTHORITY["EPSG","6326"]],
     PRIMEM["Greenwich",0,
         AUTHORITY["EPSG","8901"]],
     UNIT["degree",0.0174532925199433,
         AUTHORITY["EPSG","9122"]],
     AUTHORITY["EPSG","4326"]]
 Origin = (-180.000138888888927,83.999860415111328)
 Pixel Size = (0.008333333300000,-0.008333333300000)
 Corner Coordinates:
 Upper Left  (-180.0001389,  83.9998604) (180d 0' 0.50"W, 83d59'59.50"N)
 Lower Left  (-180.0001389, -90.0001389) (180d 0' 0.50"W, 90d 0' 0.50"S)
 Upper Right ( 179.9998597,  83.9998604) (179d59'59.49"E, 83d59'59.50"N)
 Lower Right ( 179.9998597, -90.0001389) (179d59'59.49"E, 90d 0' 0.50"S)
 Center      (  -0.0001396,  -3.0001392) (  0d 0' 0.50"W,  3d 0' 0.50"S)
 Band 1 Block=256x16 Type=Int16, ColorInterp=Undefined
   Min=-430.000 Max=8625.000
   NoData Value=-32768

 GRASS 7.3.svn (latlong_wgs84):~ > r.in.gdal
 /vsizip/vsicurl/http://edcintl.cr.usgs.gov/downloads/sciweb1/shared/topo/downloads/GMTED/Grid_ZipFiles/mn30_grd.zip/mn30_grd
 out=gmted2010_mn30_grd -a
 90 degree south is exceeded by 0.0166667 cells
 90 degree south is exceeded by 0.0166667 cells
 Importing raster map <gmted2010_mn30_grd>...
  100%
 ERROR 4: Failed to open file
 /vsizip/vsicurl/http://edcintl.cr.usgs.gov/downloads/sciweb1/shared/topo/downloads/GMTED/Grid_ZipFiles/mn30_grd.zip/mn30_grd/../info/arc.dir


 GRASS 7.3.svn (latlong_wgs84):~ > r.info -r gmted2010_mn30_grd
 90 degree south is exceeded by 0.0166667 cells
 min=-430
 max=8625


 GRASS 7.3.svn (latlong_wgs84):~ > g.region raster=gmted2010_mn30_grd -g
 90 degree south is exceeded by 0.0166667 cells
 90 degree south is exceeded by 0.0166667 cells
 90 degree south is exceeded by 0.0166667 cells
 projection=3
 zone=0
 n=83.9998611111111
 s=-90.0001388888889
 w=-180.000138888889
 e=179.999861111111
 nsres=0.00833333333333333
 ewres=0.00833333333333333
 rows=20880
 cols=43200
 cells=902016000
 }}}

 Excellent! I see that:
  * Number of rows and cols match the figures reported by gdalinfo.
  * The resolution is now correctly set to 0.00833333333333333 (unlike the
 original resolution of 0.008333333300000 with its precision loss).

 Observation: Still the E-W center is not 0 and n=83.9998611111111 (I
 expected > 84N but maybe an issue with the original data?):

 {{{
 GRASS 7.3.svn (latlong_wgs84):~ > g.region -c
 90 degree south is exceeded by 0.0166667 cells
 90 degree south is exceeded by 0.0166667 cells
 north-south center: 3:00:00.5S
 east-west center: 0:00:00.5W
 }}}

 Another question:

 What would be the best way now to "silence" the excess messages? Adjust
 the computational region and make a map copy with r.mapcalc to fit into
 -180..+180, -90..+90?

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



More information about the grass-dev mailing list