Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quantized mesh encoding? #29

Open
justb4 opened this issue Sep 4, 2015 · 18 comments
Open

quantized mesh encoding? #29

justb4 opened this issue Sep 4, 2015 · 18 comments

Comments

@justb4
Copy link

justb4 commented Sep 4, 2015

Just wondering: it seems that the tiles have plain heights encoded (TerrainTiler.cpp?). If so, are there plans for quantized-mesh encoding as in http://cesiumjs.org/data-and-assets/terrain/formats/quantized-mesh-1.0.html? If not I/we may add this, though time is not on my side. We have very detailed (0.5m res) Dutch open height data: http://app.map5.nl/nltopo/#rd/relief_struct/12/196286.4/446444.9.

@justb4
Copy link
Author

justb4 commented Sep 6, 2015

OK, I see it is in the TODO in the README now...

@homme
Copy link
Member

homme commented Sep 7, 2015

Hi Just, Yes, it's in the TODO. Unfortunately we don't have any funding or project requirements to implement this at the moment but welcome any external contributions. I'm imagining implementing quantized mesh would require some refactoring to enable the different tile formats to be specified as plugins, as a sensible mesh implementation would differ considerably from the heightmap format.

I'll keep this issue open to track any progress.

@BarryReidPropeller
Copy link

Hi guys, would love to see this added as well!

@markerikson
Copy link

Searching through Github turns up https://github.com/geoadmin/3d-forge, which appears to have the ability to read and write quantized-mesh files. Could be a useful source of info for someone trying to implement this feature in CTB.

In particular, see https://github.com/geoadmin/3d-forge/blob/6fee531256f4e3667d5c314718974bef68c53604/forge/models/terrain.py .

@homme
Copy link
Member

homme commented Sep 21, 2015

@markerikson Thanks Mark, that looks very interesting!

@BarryReidPropeller
Copy link

Anyone make any progress on this?

@homme
Copy link
Member

homme commented Nov 5, 2015

@BarryReidPropeller I'm afraid not: this requires funding or a pull request...

@lapcchan
Copy link

lapcchan commented Dec 6, 2015

@homme i am interested in funding the quantized-mesh implementation, you know of anyone interested in this project?

@markerikson
Copy link

One more useful-ish thing I just found. This project looks like it uses a combination of GDAL and CGAL to turn a GDAL-supported raster into a Triangulated Irregular Network: https://github.com/shashankkhare/refine/blob/master/TetrahedronBuilder.h.

Also, the 3DForge file I linked earlier has now been shuffled to https://github.com/geoadmin/3d-forge/blob/57b6ba5942bf0d9d9a6e3a6f4471a2e9f3a89c61/forge/terrain/__init__.py. Note that they seem to be generating their TINs from shapefiles or something.

I guess the other thought would be to do a DEM-to-shapefile conversion? Something like http://gis.stackexchange.com/questions/28298/how-to-extract-raster-dem-elevations-to-vector-attribute-tables-in-arcgis-10 or http://freegeographytools.com/2007/converting-digital-elevation-models-to-shapefiledxf-contours.

It seems like there's enough information out there to do this, if someone had the time to pull all the pieces together. Cesium defines what the format should look like, the 3DForge project has some Python code that can read and write quantized-mesh files and translate TIN data into QM format, and there's techniques for turning raster data into a mesh or vector.

It's a feature I'd love to see added to CTB, I just have no time or ability to try tackling it myself. (Naturally.)

@loicgasser
Copy link

Hi everyone, I thinking about extracting this encoder/decoder from the project and publish it as a pypi module. I'll try to do it very soon and will let you know when it's ready.

@justb4
Copy link
Author

justb4 commented Feb 8, 2016

@loicgasser +1 for pypi module. We may even look at integration with MapProxy http://mapproxy.org later.

@rspalko
Copy link

rspalko commented Feb 15, 2016

It might be useful to look at SCAPE also which is a C++ implementation of the paper by Michael Garland and Paul Heckbert at CMU. (Sometimes technology comes full circle as we again need some of the same efficiency techniques for fast rendering on the web that we needed on the desktop.) I was able to get scape to build on CentOS 6 and use it to convert a heightmap to TIN format. This code could be ported and fed into the 3d-forge quantized terrain mesh writer I believe.

Cesium has previously referenced Michael Garland's work in their presentations on Terrain services.
https://cesiumjs.org/presentations/Rendering%20the%20Whole%20Wide%20World%20on%20the%20World%20Wide%20Web.pdf

SCAPE download
https://www.cs.cmu.edu/~./garland/scape/

https://www.cs.cmu.edu/~./garland/scape/scape.pdf

@dg3feiko
Copy link

dg3feiko commented Apr 6, 2016

+1

@markerikson
Copy link

Someone just posted in the Cesium group that they've implemented a quantized mesh generator. No specific details yet. Link: https://groups.google.com/d/msg/cesium-dev/IpcBEvjt-DA/jtbIOATQEgAJ

@loicgasser
Copy link

pypi package for early birds is ready here: https://pypi.python.org/pypi/quantized-mesh-tile/
doc: https://quantized-mesh-tile.readthedocs.io
Hope this will be helpful

@markerikson
Copy link

@ahuarte47
Copy link

ahuarte47 commented Jan 8, 2018

Hi, I have implemented the quantized-mesh output to the CTB (ctb-tile tool). It provides two new features:

  • New quantized-mesh format ouput.
  • New metadata file output.

It is free to test and use.

Details:
https://www.linkedin.com/pulse/fast-cesium-terrain-rendering-new-quantized-mesh-output-alvaro-huarte/

Pull request:
#64

@delfrrr
Copy link

delfrrr commented Sep 24, 2018

Hi, we were working on a C++ tool/lib for conversion raster (GeoTIFF) heightmaps into TINs (basically optimized mesh). Since we already generating a mesh we added a tiling and quantized-mesh encoding features!

The tool is MIT licensed and can be found at https://github.com/heremaps/tin-terrain

Also, there is the example of rendering output with Cesium.js

I guess it addresses this issue and relates to #64 and #55

Feedback appreciated!

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

No branches or pull requests

10 participants