[gdal-dev] Re: Handling nodata values

NopMap ekkehart at gmx.de
Sat Jun 26 06:28:45 EDT 2010



Chaitanya kumar CH wrote:
> 
> 
> In line 93 in val_repl.py, the default value is taken as of type Byte. For
> a
> quick fix, mention the data type of the raster reported by gdalinfo with
> the
> option -ot to the script. Refer to (
> http://trac.osgeo.org/gdal/browser/trunk/gdal/swig/python/samples/val_repl.py#L61)
> 

Thanks, that was the reason. Now I got one step further, but it still does
not work.

The resulting TIF is now the same size as the original, but it appears that
the georeferencing is lost in the process.

The original file shows the folling information
Size is 6001, 6001
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.2572235630016,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]
Origin = (14.999583744947651,40.000416787708332)
Pixel Size = (0.000833333333333,-0.000833333333333)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  14.9995837,  40.0004168) ( 14d59'58.50"E, 40d 0'1.50"N)
Lower Left  (  14.9995837,  34.9995835) ( 14d59'58.50"E, 34d59'58.50"N)
Upper Right (  20.0004171,  40.0004168) ( 20d 0'1.50"E, 40d 0'1.50"N)
Lower Right (  20.0004171,  34.9995835) ( 20d 0'1.50"E, 34d59'58.50"N)
Center      (  17.5000004,  37.5000001) ( 17d30'0.00"E, 37d30'0.00"N)
Band 1 Block=6001x1 Type=Int16, ColorInterp=Gray
  NoData Value=-32768

After processing with val_rpl.py, gdalmerge quits with an error and gdalinfo
reports:
Size is 6001, 6001
Coordinate System is `'
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0, 6001.0)
Upper Right ( 6001.0,    0.0)
Lower Right ( 6001.0, 6001.0)
Center      ( 3000.5, 3000.5)
Band 1 Block=6001x1 Type=Int16, ColorInterp=Gray

What did I miss this time?

Nop

-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Handling-nodata-values-tp5222453p5224918.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.


More information about the gdal-dev mailing list