[Gdal-dev] notes on EHdr

Cees Wesseling cees at pcraster.nl
Tue Nov 15 15:23:07 EST 2005


Some Notes on EHdr driver

Frank,
I put my notes on the dev list. Maybe other can comment on the point I 
make here.
Regards,
Cees

1) types of the cell

There seems to be a difference in the common practice of using data that 
can be read/write with the EHdr driver and the documentation as present on
http://downloads.esri.com/support/whitepapers/other_/eximgav.pdf
and
http://www1.gsi.go.jp/geowww/globalmap-gsi/gtopo30/README.html
Both do only mention integers, leaving the signed-ness unspecified and 
do not mention floats.
Common practice seems however to do:
NBITS    GDT
8        GDT_Byte
16       GDT_Int16
32       GDT_Float32
64       GDT_Float64

The current GDAL driver seems to support common practice.

To add to the confusion I have seen applications looking for the keyword 
LSBFIRST and MSBFIRST to determine the type is actually float. But that 
stems from the ESRI .flt format for binary grids

I do not know how common 32 bits integers are in these format. But if so 
there is a danger there in confusion. Since some application simply 
assumes a float if they see NBITS 32.

Maybe that ambiguity should be solved with an option whether the driver 
must support floats yes or no. Or refactor into 2 drivers with a common 
code base, one with support the other not.

To create unambiguous data and support more types even, we could 
introduce a new keyword CELLTYPE. The documentation leaves room for 
adding keyword since they are recognized or treated as comments.
We could use the names as defined in C99 stdint.h: int8,int16,int32,int64,
uint8,..,uint64 and of course float and double

2) Missing keywords on creation
XDIM
YDIM
ULXMAP
ULYMAP
CELLSIZE (not in the docs but common practice)
NODATA (not in the docs but common practice)

3) Statistic file
Applications are also using the file (.stx) to store the min and max of 
floats as in: band no 1 (the only band) has min 0.0 and max 3.4
1 0.0 3.4

4) some GDAL docs fixes
formats_list.html
  EHdr  Create No -> Yes
frmt_various.html#EHdr:
"GDAL supports the ESRI .hdr labelling format for reading raw raster data
(often referred to as ESRI BIL format) for read-only access."
"Eight, sixteen and thirty-two bit integer raster data types are supported "
Not true it can currently create GDT_Byte, GDT_Float32, GDT_UInt16, 
GDT_Int16
the url to GTOPO30 is out of date, must read:
  http://www1.gsi.go.jp/geowww/globalmap-gsi/gtopo30/README.html




-- 
Cees Wesseling
PCRaster Environmental Software
van Swindenstraat 97
3514 XP Utrecht
The Netherlands
Tel. 0031-(0)30-238012-4 (-5 Fax)



More information about the Gdal-dev mailing list