This repository was archived by the owner on Mar 8, 2023. It is now read-only.

Description
Is it possible to use dem2tin to create a single quantized mesh file using a tiff input?
Whenever I run dem2tin with the option --output-format terrain it fails:
./tin-terrain dem2tin --input baty.tif --output bathy.terrain
--input-format tiff --output-format terrain --method terra
subcommand_dem2tin
Opening raster file baty.tif with GDAL...
reading raster data...
done
performing terra meshing...
starting greedy insertion with raster width: 1386, height: 1421
initialize the mesh with four corner points
finished greedy insertion
done
time for meshing step: 0.365798 sec = 0.00609663 minutes
number of triangles: 41894
number of vertices: 20950
writing mesh... (bathy.terrain)
ERROR QuantizedMeshIO.cpp:327 Mesh has to be triangulated in order to be written as QM
ERROR cmd.cpp:453 error writing output file
When I choose to output an .obj file instead it works fine and if I manually inspect the resulting mesh it looks perfectly triangulated. The error message is confusing since the meshing process seem to work. I tried all methods and multiple inputs including the example files from your readme. I also ran gdalwarp to transform my data into the correct projection.
dem2tintiles is producing valid quantized meshes on the same .tiff files.
Any help would be appreciated!