[Gdal-dev] problem merging 1 second data with gdal_merge.py

Rich Signell rsignell at usgs.gov
Wed Nov 16 11:13:18 EST 2005


Gdal-folk,

I'm having trouble using gday_merge.py to merge blocks of 1 sec 
data obtained as Geotiff from a WMS server.

I have a 1 degree x 0.5 degree region
lon=[-75.0 -74.0], lat=[43.5 44.0] that I want to cover, but 
unfortunately that's too much for the WMS to handle.

So I made requests for two blocks with ranges
[-75.0 -74.5]  [43.5 44.0]
[-74.5 -74.0]  [43.5 44.0]
and requested each image block to be 1800 x 1800 points (since 
this DEM data is Area based).

I check each .tif with gdalinfo, and everything looks good:

$gdalinfo ad01.tif

Driver: GTiff/GeoTIFF
Size is 1800, 1800
...
Pixel Size = (0.00027778,-0.00027778)
Metadata:
   AREA_OR_POINT=Area
   TIFFTAG_SOFTWARE=SGI's Image Format Library/1.2
Corner Coordinates:
Upper Left  ( -75.0000000,  44.0000000)
Lower Left  ( -75.0000000,  43.5000000)
Upper Right ( -74.5000000,  44.0000000)
Lower Right ( -74.5000000,  43.5000000)
Band 1 Block=1800x1 Type=Float32, ColorInterp=Gray

$gdalinfo ad02.tif
...
Upper Left  ( -74.5000000,  44.0000000)
Lower Left  ( -74.5000000,  43.5000000)
Upper Right ( -74.0000000,  44.0000000)
Lower Right ( -74.0000000,  43.5000000)
Band 1 Block=1800x1 Type=Float32, ColorInterp=Gray

But when I merge them:

$gdal_merge.py -o merged.tif ad01.tif ad02.tif

I get:

$gdal_info merged.tif
Driver: GTiff/GeoTIFF
Size is 3599, 1800
...
Origin = (-75.000000,44.000000)
Pixel Size = (0.00027778,-0.00027778)
Metadata:
   AREA_OR_POINT=Area
Corner Coordinates:
Upper Left  ( -75.0000000,  44.0000000)
Lower Left  ( -75.0000000,  43.5000000)
Upper Right ( -74.0002778,  44.0000000)
Lower Right ( -74.0002778,  43.5000000)
Band 1 Block=3599x1 Type=Float32, ColorInterp=Gray

So the resulting tif is NOT 3600x1800, but 3599x1800, and the 
limits are now 1 pixel smaller in the merged direction (do not 
extend to -74 as did the original).

Is this a "area" vs. "point" registration problem in the 
gdal_merge.py logic, or (more likely) have I made some silly mistake?

Thanks,
Rich

-- 
Richard P. Signell
U.S. Geological Survey       Phone: (508) 457-2229
384 Woods Hole Road          Fax:   (508) 457-2310
Woods Hole, MA  02543-1598



More information about the Gdal-dev mailing list