4

I am looking to convert a .DEM exported from AutoCad to a floating point raster file type (.FLT) utilizing QGIS to implement in HEC-RAS Mapper.

This is accomplished easily in Arc using the Raster>Float option. Referencing ESRI Supported Formats it does not appear the .FLT format is proprietary. It does mention "Write—Only via Raster To Float tool, or developer code" which could suggest that it could be incorporated into QGIS. Although, the QGIS Raster>Translate does not offer the .FLT format.

Is there open-source workaround to convering DEM to .FLT?

3
  • Use Raster::Translate and specify the output type. What format is it currently in? CAD is usually XYZ which isn't the best format - usually it's not gridded like translate likes. Commented Mar 26, 2015 at 2:51
  • @MichaelMiles-Stimson, I have the same problem and tried this solution. But couldn't find the option in "translate" to save as Floating Point (*.flt).
    – H.Wiener
    Commented Dec 10, 2015 at 12:33
  • Have a read of digitalpreservation.gov/formats/fdd/fdd000422.shtml.... it appears to be a bil file with different wording in the header. Read also en.wikipedia.org/wiki/Endianness to find the default endianness of your system... on a PC the data will be LSB first. Do you have any scripting/programming experience? This wouldn't be hard to do in python/C#/C++ or almost any language that supports GDAL @H.Wiener. Commented Dec 13, 2015 at 21:52

1 Answer 1

3

The Esri FLT data format stores its data identically to an Esri BIL file, which GDAL does support:

GDAL_Translate -of EHdr -ot Float32 ....

Then all you need to do is change the extension from bil to flt and edit the header - the keywords are different.. for example:

BYTEORDER      I
LAYOUT         BIL
NROWS          1004
NCOLS          1002
NBANDS         1
NBITS          32
BANDROWBYTES   4008
TOTALROWBYTES  4008
PIXELTYPE      FLOAT
ULXMAP         478000.5
ULYMAP         6937001.5
XDIM           1
YDIM           1
NODATA         -9999

is what is in the header from GDAL translate, which needs to be changed to:

ncols        1002
nrows        1004
xllcorner    478000.000000000000
yllcorner    6935998.000000000000
cellsize     1.000000000000
NODATA_value  -9999
BYTEORDER    LSBFIRST

for a FLT file... easy as!

First change NODATA to NODATA_VALUE (if not already, both keywords are supported by Esri BIL), BYTEORDER keyword changes from I (Intel) to LSBFIRST - assuming Intel, only one cellsize is supported so get rid of XDIM, YDIM and replace with CELLSIZE change ULXMAP to XLLCENTER and then it gets tricky.. BIL is upper left referenced but FLT is lower left referenced so you need to reduce the reference by NROWS * CELLSIZE to obtain YLLCENTER.

You should be able to validate your results in QGIS (I used 2.6 (Brighton)) by drag-n-drop the .flt file into the window.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.