[mapserver-users] specify endianness in outputformat when serving BIL/EHdr ?

Landry Breuil breuil at craig.fr
Tue Feb 16 05:23:51 PST 2021


hi,

i'm trying to use mapserver-provided DEM layers within mapstore2, which 
expects 'big-endian encoded' BIL format to display elevation/build 
terrain relief with cesium. My mapserver layer is built with a tileindex 
of asc files, and that works just great when rendering as png with some 
styling.

i've reported my findings about what is expected within mapstore2 (which 
is mostly tested against geoserver) here; 
https://github.com/georchestra/mapstore2-georchestra/issues/331.

i've configured my outputformat as is in mapserver (found on 
https://worldwind.earth/elevation-server.html):


OUTPUTFORMAT
     NAME "bil"
     DRIVER "GDAL/EHdr"
     MIMETYPE "application/bil16"
     IMAGEMODE INT16
     EXTENSION "bil"
END

and looking at the binary data returned by a request with 
application/bil16 format, this seems correctly encoded as big-endian but 
mapstore2 doesnt like it, and after testing a bit with a DEM served by 
geoserver my understanding is that mapstore2 would expect data encoded 
as little-endian.

is there a way to specify that in gdal output formats ? looking at
https://gdal.org/drivers/raster/ehdr.html it seems the ehdr/bil format 
doesnt provide much options, there seem to be support to specify 
byteorder via a sidecar file when reading a hdr file, but i dunno how to 
shoehorn that inside mapserver.

i've also looked at the various composite/processing options in 
mapserver, and i havent found an operation that would allow to swap 
bytes on the fly in the raster when computing the output, but i might 
have looked wrong.

Any hints ?

Thanks !

--
Landry Breuil


More information about the mapserver-users mailing list