load terrain data (GfxCore::LoadDEM function)

Olly Betts olly at survex.com
Sat Sep 24 07:36:17 BST 2016


On Sat, Sep 17, 2016 at 06:12:58PM +0200, detrito wrote:
> there is not much documentation about this process (e.g. supported
> files and expected typedef) but reading the GfxCore::LoadDEM function,
> it seems that the supported digitail terrain model (DTM) files are .hgt
> and .bil.

Currently the most detailed documentation for it lives on the wiki, as
that allows us to improve it between releases:

https://trac.survex.com/wiki/TerrainData

> I usually work with DTM in raster (.tiff) format, so I converted my DTM
> in a signed integer .bil file [1] with ESRI's ArcMap (see attachement
> for file details). after this process, I am able to load the .bil file
> in survex (file->open terrain) with no error on the screen or on the
> console. but despite the activated view->terrain checkbox, I sadly don't
> see any terrain..

Could be the data doesn't cover the area the cave is in - aven clips
the terrain to a circle centred on the survey data.

If it's not that, I'd guess it's some variant of BIL which my code
doesn't cope with - however, I don't see the attachment you refer to so
it's hard to say more.  The list is set to strip at least some
attachments (to avoid forwarding malware, or bombarding subscribers with
large files).  Probably best to upload somewhere and send a link.

The current terrain file reading is just something I knocked up quickly
so I could get the rendering code working - I picked BIL/HGT as a
really simple format in which usable terrain data for most of the world
is available.  But but I've only tested with a few sources of such
files, and the error checking is a bit minimal I'm afraid.

The longer term plan is to use something standard like GDAL to read
terrain data, which should allow use of any common format.  But the
API looked like it might take a while to get to grips with which is
why I didn't just use that to start with.

> [1] today's DTM have millimiter precision: support of signed float
>     would be really nice :)

Currently there's no explicit handling of the vertical datum, so the
terrain will probably be offset from the underground data (for me by
about 30m) so your millimitre precision may be rather wasted...

Cheers,
    Olly



More information about the Survex mailing list