[GRASS5] r.in.gdal - precision problem in lib/gis/adj_cellhd.c

Markus Neteler neteler at itc.it
Wed Apr 6 09:23:00 EDT 2005


Hi,

I tried to import the Europe tile of SRTM/GTOPO30 from GLCF.
There is a small issue which makes GRASS refuse the file:

gdalinfo SRTM_GTOPO_u30_n090w020.tif
Driver: GTiff/GeoTIFF
Size is 4800, 6000
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.2572235629972,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["metre",1],
    AUTHORITY["EPSG","4326"]]
Origin = (-20.000000,90.000000)
Pixel Size = (0.00833333,-0.00833333)
Metadata:
  TIFFTAG_DOCUMENTNAME=D:\Kuan\srtm\SRTM30\w020n90_new.tif
  TIFFTAG_IMAGEDESCRIPTION=IDL TIFF file
  TIFFTAG_XRESOLUTION=100
  TIFFTAG_YRESOLUTION=100
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
Corner Coordinates:
Upper Left  ( -20.0000000,  90.0000000) ( 20d 0'0.00"W, 90d 0'0.00"N)
Lower Left  ( -20.0000000,  39.9999974) ( 20d 0'0.00"W, 39d59'59.99"N)
Upper Right (  20.0000021,  90.0000000) ( 20d 0'0.01"E, 90d 0'0.00"N)
Lower Right (  20.0000021,  39.9999974) ( 20d 0'0.01"E, 39d59'59.99"N)
Center      (   0.0000010,  64.9999987) (  0d 0'0.00"E, 65d 0'0.00"N)
Band 1 Block=4800x1 Type=Float32, ColorInterp=Gray

-> looks reasonable


GRASS 6.1.cvs (latlong):~ > r.in.gdal SRTM_GTOPO_u30_n090w020.tif out=srtm90_gtopo30
A datum name wgs84 (WGS_1984) was specified without transformation parameters.
Note that the GRASS default for wgs84 is towgs84=0.000,0.000,0.000.
Projection of input dataset and current location appear to match.
Proceeding with import...
D0/0: North: 90.000000
WARNING: G_set_window(): Illegal latitude for North

-> I have added debug output to lib/gis/adj_cellhd.c
--> strange, but (using %.10f output):

GRASS 6.1.cvs (latlong):~ > r.in.gdal SRTM_GTOPO_u30_n090w020.tif out=srtm90_gtopo30
A datum name wgs84 (WGS_1984) was specified without transformation parameters.
Note that the GRASS default for wgs84 is towgs84=0.000,0.000,0.000.
Projection of input dataset and current location appear to match.
Proceeding with import...
D0/0: North: 90.0000000002
WARNING: G_set_window(): Illegal latitude for North

-> to me it looks like a C problem.

How can I convince lib/gis/adj_cellhd.c to work as desired?
The comparison is currently:

 if (cellhd->north > 90.0)
     return (_("Illegal latitude for North"));

Thanks,
 Markus




More information about the grass-dev mailing list