Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

single quantized mesh from tiff #65

Closed
frapit opened this issue Nov 20, 2019 · 2 comments · May be fixed by #67
Closed

single quantized mesh from tiff #65

frapit opened this issue Nov 20, 2019 · 2 comments · May be fixed by #67

Comments

@frapit
Copy link

frapit commented Nov 20, 2019

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!

@frapit
Copy link
Author

frapit commented Jan 16, 2020

Yep, this resolves the issue, thanks!

@frapit frapit closed this as completed Jan 16, 2020
@alexbeeston
Copy link

I'm still getting the same problem after using the forked version, even with the sample crater lake data set. Any ideas about how it might be resolved? Output is:

subcommand_dem2tin
Opening raster file craterLakeEPSG3857.dem with GDAL...
reading raster data...
done
performing terra meshing...
starting greedy insertion with raster width: 4713, height: 4196
initialize the mesh with four corner points
finished greedy insertion
done
time for meshing step: 7.31981 sec = 0.121997 minutes
number of triangles: 305280
number of vertices: 152643
writing mesh... (tin-terrain-output/tin/craterLakeEPSG3857_forked.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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants