ER-Mapper provides a c-function library for programmers to read and write datafiles in a standard way. Maybe you remember my first version used this library, but linking gstat together with ER-Mapper.lib was just an enormous pain in the ass. It turns out, ER-Mapper raster files are fairly straightforward anyway, with a separate ASCII header and binary data file. So the current version reads and writes the ER-Mapper files directly without using ermapper.lib. This may cause it to fail for future versions of ER-Mapper, but I can live with that.
ER-Mapper raster files can be multi-channel-I check the number of channels on input files and bail out if there is more than one. Maybe sometime we can set up the data specification syntax to include a channel as you talked about before.
ER-Mapper files can specify to skip a number of bytes in the binary file-I don't take care of this, but check the file size consistencey of the binary file.
ER-Mapper header binary files can have a different root name than the header-I don't take care of this, and force them to be the same.
ER-Mapper data types can be signed or unsigned chars, ints (16 or 32 bits), 4-byte real or 8-byte double. I read all formats and cast into 4-byte real for sorage in the gstat gridmap. I always write 4-byte real.
Byte order can be specified in ER-Mapper raster files-I check for it and reorder as necessary.
The ER-Mapper coordinate origin can be at an arbitrary fractional pixel position-I correct it to be the upper left corner of the upper left pixel in the grid.
ER-Mapper coordinates can be either Easting/Northing, Long/Lat, or Raw(X-Y). I do a strict check for 'EN' coordinates, because they match the definition used in gridmaps. RAW coordinates have positive 'y' going down (same as cell coordinates) whereas EN coordinates have positive 'y' going up.