Page 1 of 1

Format of HTF File

PostPosted: Mon Apr 02, 2012 3:05 am
by deendayal
Hi All,

I Want to convert a raw terrain file(.asc) into an HTF file in order to use in GLSCene .Could anyone help me knowing the format of an htf file and the help me with the source code of converting an asc file to htf file.

Thank You

Re: Format of HTF File

PostPosted: Tue Apr 03, 2012 9:28 am
by Aaron
Hi deendayal,

The HTF file format is not documented anywhere other than in the GLScene source code as far as I can recall. It was, however, nearly a decade since I last dabbled in this area, so my recollection may be unreliable. For what it's worth, you can find the C++ source code for the HTF exporter in L3DT over here:

http://www.bundysoft.com/L3DT/downloads/plugins/src/L3DTio_HTF-src.zip

The HTF files are written in the 'zeoSaveMapFile' function, which is defined in the 'L3DTio_HTF.cpp' file. Please note that this HTF exporter only supports 16-bit raw height encodings, and not GLScene's adaptive diff / RLE / diff+RLE compressed encoding schemes. I don't remember the precise details of those encoding formats, so I can only recommend you take a look at the GLScene source code (linky) if you want to support height compression in HTF files.

Cheerio,
Aaron,

Re: Format of HTF File

PostPosted: Wed Apr 04, 2012 2:03 am
by deendayal
Thanks AAaron. It was really helpful.....

Another quick question...

I want to Use a DTM file (which is in the grid format where each cell has x,y values and the elevation/height) . How can i convert this to an htf File or can i use the DTM file directly in the GLScene to get a 3D display.............Could you please help me with this.

Thank You

Re: Format of HTF File

PostPosted: Fri Apr 06, 2012 4:46 pm
by Aaron
Hi Deendayal,

I'm not an expert in GLScene (haven't used it in years), so I'm not sure whether it can load DTM files directly. I doubt it though. You could of course write a DTM loader module in GLScene, but that may be easier said than done.

One pathway to getting your height data into GLScene would be to convert the DTM file into a format that L3DT can read, and then use L3DT to generate your HTF file for GLScene. Software should exist that can convert DTMs into GeoTIFF, BT or TER, for example. Have you tried VTBuilder?

Best regards,
Aaron.