The Martinique 3D model is available for your own needs, on request using
the contact page here.
Most video game engines and 3D Middleware packages handle 3D terrains way better than most GIS and BIM packages.
What if we get the best of both worlds integrating GIS DEM data into a game engine ?
This should require some custom coding and this exactly where we think we can have fun. This article describes the main steps we took creating a 1 meter precision 3D model of Martinique..
1 Where should I find a Digital Elevation Model of Martinique ?
Martinique being a french island, I immediatly thought about the
IGN website.
Bingo! Their MNT RGE ALTI (2021) product matches what I'm looking for: a 1 meter precision DEM. Apart from the binary Geotiff representation, IGN also provides asscii files describing the terrains.
2 How can I integrate this terrain data in Unity?
Once again, Unity provides a very clear API and documentation about creating terrains using Unity Editor tools. Must admit that I did have a look to some precise subjects inside the Unity Editor source code.
For each tile, the lower left corner coordinates (in UTM), resolution and size are available in an header. The first substep consisted in creating equivalent binary files of these .asc files because processing them in Unity as text file would take ages.
3 Batch creating the terrains
This step consisted in using Unity editor scripts to build the terrain asset files, configure them (LOD, texture layer, precision, connectivity).
Unfortunately, the DEM tiles are 1000 * 1000 samples while Unity terrains heightmap must be power of 2 size. I had then had to implement a tiles repositioning code to stick the tiles with each others. A cleaner approach would be to
recompose the DEMs so that they are power of 2 sized, avoiding the tiles repositionning. In that case the terrain stitching tools of Unity would hide the sometimes visible tiles separations.
4 Publish in player(s)
I had a naive approach at this point. Even if the dataset was huge (about 1300 tiles of 1000 meters * 1000 meters) I thought WebGL would not let me down. It did in the way that WebGL applications are limited to 4096 MB in size, even using the Unity adressable API to split the terrains into several downloadable assets.
I decided to use desktop builds and it worked well.
In conclusion, I have a pretty versatile code base to integrate reallife Digital Elevation Models as realtime terrains in Unity.