Opened 22 years ago

Last modified 22 years ago

#145 closed defect (fixed)

EHdr/ESRI .hdr Labelled driver (latest CVS): precision bug?

Reported by: Markus Neteler Owned by: warmerdam
Priority: high Milestone:
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description

Hi Frank,

it looks to me that there is a small precision bug in
EHdr/ESRI .hdr Labelled driver (latest CVS):

I have specified

     45.0
10.0     15.0
     40.0

in
http://www.ngdc.noaa.gov/cgi-bin/seg/ff/nph-newform.pl/seg/topo/subset

The resulting file looks like:

gdalinfo mydata.bil
Driver: EHdr/ESRI .hdr Labelled
Size is 600, 600
Coordinate System is '
Origin = (10.000000,45.000000)
Pixel Size = (0.008333,-0.008333)
Corner Coordinates:
Upper Left  (  10.0000000,  45.0000000)
Lower Left  (  10.0000000,  40.0000020)
Upper Right (  14.9999980,  45.0000000)
Lower Right (  14.9999980,  40.0000020)
Center      (  12.4999990,  42.5000010)
Band 1 Block=600x1 Type=Int16, ColorInterp=Undefined
  NoData Value=-500

I am not sure if GLOBE30 data supplier is wrong or the related
GDAL driver.

Maybe you can have a look.
The test dataset is here:

ftp://gdal.velocet.ca/pub/incoming/
globe30_dem_selected.txt
globe30_dem_selected.tgz
Thanks!

 Markus Neteler

Change History (1)

comment:1 by warmerdam, 22 years ago

Markus, 

The mydata.hdr file contains the following bounds. 

ULXMAP          10.00416666
ULYMAP          44.99583332
XDIM            0.00833333
YDIM            0.00833333

gdalinfo reports:

Upper Left  (  10.0000000,  45.0000000) 
Lower Left  (  10.0000000,  40.0000020) 
Upper Right (  14.9999980,  45.0000000) 
Lower Right (  14.9999980,  40.0000020) 
Center      (  12.4999990,  42.5000010) 

Note that ESRI files report in terms of pixel centers, so the GDAL
results are offset by 1/2 pixel and seem to be done so properly within
the accuracy of the numbers given.  As you can see the numbers given
work out slightly off the real boundaries because of round off issues in
the source data.

In short, I don't think there is a bug to fix. 

Note: See TracTickets for help on using tickets.