quantized-mesh terrain- some questions

3,523 views
Skip to first unread message

dr.drom...@gmail.com

unread,
Nov 25, 2014, 2:58:04 PM11/25/14
to cesiu...@googlegroups.com
Hi,
Thank you very much for Cesium. It's a great product with a lot of potential.

I want to implement my own quantized-mesh terrain server as a college project. Reading the documentation, I have some questions:
1. In QuantizedMeshHeader struct there are the BoundingSphere fields. Does the sphere is supposed to bound the 3d tile (with the heights), or only the 2d tile?
2. The VertexData arrays values are encoded with zigzag encoding. Why? (given that the types are unsigned)
3. I want to avoid the usage of water mark encoding in the indices list. Does the decoding code in the createQuantizedMeshTerrainData() function in the CesiumTerrainProvider.js file is the only thing I need to take into account? Is there another place which affected by this encoding?

Thank you very much

Kevin Ring

unread,
Nov 25, 2014, 5:49:40 PM11/25/14
to cesiu...@googlegroups.com
Hi,

1. The bounding sphere should wrap the 3D tile.
2. The vertices are delta encoded (current value - previous value) first, yielding signed values, and then zig-zag encoded.
3. I think that's correct, but why would you want to avoid the high water mark encoding?  We implemented high water mark encoding because it significantly reduced the compressed size of the index data.

Kevin


--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

dr.drom...@gmail.com

unread,
Nov 26, 2014, 1:45:59 AM11/26/14
to cesiu...@googlegroups.com
Thanks.
2. In the documentation the vertices data is appear as unsigned values on the scale between 0 to 32767 where 0 is the tile MinimumHeight and 32767 is tile MaximumHeight.

http://cesiumjs.org/data-and-assets/terrain/formats/quantized-mesh-1.0.html

3. Just want to reduce the amount of calculations in order to get better performances. The size is less important for me now.
By the way, have you looked at google protobuf? It's seems to yield very small files and has a javascript port...

Kevin Ring

unread,
Nov 26, 2014, 5:47:37 AM11/26/14
to cesiu...@googlegroups.com
Hi,

On #2, you're right, the documentation neglects to mention the delta encoding.  You can clearly see it in the code, though:

Notice that it's:
    u += zigZagDecode(uBuffer[i]);
Not:
    u = zigZagDecode(uBuffer[i]);

On #3, I'd be surprised if you see a net performance improvement by removing the high water mark encoding.  It's a very quick computation, so you'll almost certainly spend more time downloading the slightly larger file than you'll save by not doing the decoding.  You're welcome to try, of course!

I'm somewhat familiar with protobuf.  Compared to JSON it's very compact.  Compared to the carefully constructed format used by quantized-mesh-1.0 it's almost certainly larger, simply because it's much more general.

Kevin

Alexander Wood

unread,
Nov 26, 2014, 8:31:55 AM11/26/14
to cesiu...@googlegroups.com

Hi,
After zigzag and delta decoding,  the values will be in the range of 0 to 32767. We can normalize these to 0.0 and 1.0 by dividing the decoded values by 32767 and from there we can easily extract the true height with interpolation between min and max height.

In terms of performance, the compression we apply is low overhead. In dealing with client server architectures,  data transmission speeds cannot be disregarded. When rendering massive worlds, these savings add up quickly.

Alex

Bjørn Sandvik

unread,
Nov 27, 2014, 5:30:39 PM11/27/14
to cesiu...@googlegroups.com, dr.drom...@gmail.com
Hi

I've been looking for a quantized-mesh terrain provider and I hope your code will be available on GitHub :-)

I'm also happy to do some tests with the terrain data used in this blog post: 

Thanks, 
Bjørn Sandvik

Poul Sørensen

unread,
Dec 1, 2014, 1:37:07 PM12/1/14
to cesiu...@googlegroups.com, dr.drom...@gmail.com
I have reading up on information also with purpose of doing some quantizedMesh generator and I have been thinking of putting it together with some PCL mesh generation to being able to generate a terrain from a point cloud. (I work with stereo matching of image and creating point clouds this way, and is lagging a more modern way of visualizing all my work in a browser).

What kind of framework, language are you doing your work in ? Maybe we can share some ideas. I primarily work in C#/.net but also do a lot of programming in c++ for PCL/OpenCV stuff and have alot of cloud computing experience. My goal is to create a quantized mesh terrain server running on Windows and Microsoft Azure. The project is not funded, so no timeframe for when it will be done. 

Idan Lahav

unread,
Jan 13, 2015, 4:24:31 AM1/13/15
to cesiu...@googlegroups.com, dr.drom...@gmail.com
Hi Poul,
Any progress made on a quantized-mesh generator ?

Thanks, 
Idan

Poul Sørensen

unread,
Feb 14, 2015, 1:34:11 PM2/14/15
to cesiu...@googlegroups.com, dr.drom...@gmail.com
Nope. We had some more important things to get done, so still havent started it. 

Just returned to to this thread to if anyone else have done any progress in creating one.

barry...@gmail.com

unread,
Sep 17, 2015, 3:08:35 AM9/17/15
to cesium-dev, dr.drom...@gmail.com
Hey, did you ever get around to doing this?
Message has been deleted

kalka...@gmail.com

unread,
May 31, 2016, 2:54:07 AM5/31/16
to cesium-dev, dr.drom...@gmail.com
Hello i have implemented hegihtmap and quantized mesh (with simplification) formats generator and also server bundled all in one software. I have seen some tools for generating (heightmap only) / publishing seperately, that s something i dont like. I will notify here if and when i can go public.

However need to complete a few things first. Here s my todo list

DONE:
- Heightmap generator
- Quantized tile generator
- Mesh Sİmplification
- Multithread support for faster generation
- Tile Server
TODO:
- Datasource merge and updating an already generated dataset with a new data source
- Calculation review for Quantized mesh header. Seems a bit off for Bounding box or occlusion point. Works smooth tho at the moment
- Interface to manage application
- Enhancements ..etc

Mark Erikson

unread,
May 31, 2016, 11:28:46 AM5/31/16
to cesium-dev, dr.drom...@gmail.com, kalka...@gmail.com
Interesting.  Are you planning on publishing the source for this?  What language?  Is this something that might integrate with the existing https://github.com/geo-data/cesium-terrain-builder tool?

kalka...@gmail.com

unread,
May 31, 2016, 1:49:05 PM5/31/16
to cesium-dev, dr.drom...@gmail.com, kalka...@gmail.com
Hello, i will try to be as thorough as possible.

First of all code is very premature and needs almost every basic error checking. I will publish it as soon as i can. However it is still in , lets say, "early alpha". It is written in Javascript convenient with cesium itself.

I have seen cesium-terrain-builder that you mention. As well as its server part.Nice work with them.Tried geoserver terrain serving as well. But using them needs some effort and quantized mesh not yet implemented on that one. My implementation combines both parts therefore no need to integrate with them or any other tools. Also it is cross platform thanks to language. Get the software, Just load your data, generate and start using.

As much as usable but lots need to be implemented and tested

-Recheck simplification algorithm, implement a better one even
-Recheck Quantized mesh calculations and fix
-New data integration (generation) with the existing generated tile set (Working on this at the moment)
-Recheck and clean heightmap generation code
-Extensions coding(Normals and water line)(Next on todo list)
-Review entire tileset generation logic
-Interface for software control and workflow implementation
-Performance improvements

bj...@mastermaps.com

unread,
May 31, 2016, 2:54:47 PM5/31/16
to cesium-dev, dr.drom...@gmail.com, kalka...@gmail.com
Great news!

I'm happy to help with testing this code.

Bjørn

bobac...@gmail.com

unread,
Jun 1, 2016, 12:29:32 AM6/1/16
to cesium-dev, dr.drom...@gmail.com, kalka...@gmail.com, bj...@mastermaps.com
Hello,
I'm interessing in your works. Could you publish in a github repository. Thus some people, like Bjorn (sorry for the o) and me, could help.
Message has been deleted

Mark Erikson

unread,
Jun 2, 2016, 12:14:14 PM6/2/16
to cesium-dev, dr.drom...@gmail.com, kalka...@gmail.com, bj...@mastermaps.com, bobac...@gmail.com
Looks very promising.  Out of curiosity, what source datasets did you use?

On Thursday, June 2, 2016 at 8:44:49 AM UTC-4, kalka...@gmail.com wrote:
Hello again,

Thank you for your responses. For now i have published a test site.

You can review generated terrain here

http://viskon.bilgem.tubitak.gov.tr/terrain/Test.html

Data is limited and up to Level 6. Inputs are quite welcome.

Best regards

kalka...@gmail.com

unread,
Jun 2, 2016, 1:15:53 PM6/2/16
to cesium-dev, dr.drom...@gmail.com, kalka...@gmail.com, bj...@mastermaps.com, bobac...@gmail.com
It is a single file world DEM data. Not very high resolution. Free on the internet.

loicg...@gmail.com

unread,
Jun 23, 2016, 1:24:41 AM6/23/16
to cesium-dev
Also an alpha in python. I thought it was really missing as well and wanted to improve the situation.
It's available on pypi.
Here is a link to the doc.

https://quantized-mesh-tile.readthedocs.io/en/latest/

kalka...@gmail.com

unread,
Jun 23, 2016, 9:26:21 AM6/23/16
to cesium-dev, dr.drom...@gmail.com

Mark Erikson

unread,
Jun 23, 2016, 12:00:57 PM6/23/16
to cesium-dev, dr.drom...@gmail.com, kalka...@gmail.com
Fantastic!  Thanks to both of you for developing and publishing these tools.  Much appreciated!

On Thursday, June 23, 2016 at 9:26:21 AM UTC-4, kalka...@gmail.com wrote:
GitHub link https://github.com/Nymria/Cesium-Terrain-Generator-And-Server

Bjørn Sandvik

unread,
Aug 28, 2016, 5:55:37 AM8/28/16
to cesium-dev, dr.drom...@gmail.com

Hi, 

The Swiss Geoportal has published a library to read/write quantized-mesh tiles: 

It was demoed at FOSS4G in Bonn this week: 

Bjørn

tob...@gmail.com

unread,
Sep 19, 2016, 8:12:32 AM9/19/16
to cesium-dev, loicg...@gmail.com

pure gold. thanks!

mre...@gmail.com

unread,
Feb 6, 2017, 9:57:06 AM2/6/17
to cesium-dev, dr.drom...@gmail.com
On Thursday, June 23, 2016 at 4:26:21 PM UTC+3, Muhammed Kalkan wrote:
> GitHub link https://github.com/Nymria/Cesium-Terrain-Generator-And-Server

Is your project active?
Can we use it for DTED (DEM) to quantized-mesh conversion and serving in offline environment?

Muhammed Kalkan

unread,
Feb 10, 2017, 3:06:45 AM2/10/17
to cesium-dev, dr.drom...@gmail.com, mre...@gmail.com
Yes it is, first milestone is planned to be completed later this month

6 Şubat 2017 Pazartesi 17:57:06 UTC+3 tarihinde mre...@gmail.com yazdı:

Mark Erikson

unread,
Feb 10, 2017, 12:33:31 PM2/10/17
to cesium-dev, dr.drom...@gmail.com, mre...@gmail.com
A couple questions for you.  I'm curious how your tool compares to the existing Cesium Terrain Builder conversion utility ( https://github.com/geo-data/cesium-terrain-builder ).  For reference, CTB is written in C++, supports multi-threading, and uses the GDAL geodata library to be able to read a variety of input formats.

- What geodata file formats does your tool support?  GeoTIFF, DTED, ... ?
- Does your tool do multi-threading?  Do you have some rough benchmarks on performance and time needed to generate datasets?
- What additional dependencies, if any, does your tool require?

Just trying to get a feel for how things compare.

Thanks!

Muhammed Kalkan

unread,
Feb 11, 2017, 3:25:13 AM2/11/17
to cesium-dev
Hi,

All GDAL formats are accepted, however currently not tested.

Currently there is multi processing support but it is also in development. I can not give a benchmark since trying to make algorithm robust atm. However, we can say it is pretty slow at the moment.

Detecting bugs in tile consistency, and fixing them. But it is almost done.

I am planning to publish new quantized datasets this week if all goes well

soniu...@gmail.com

unread,
Aug 8, 2017, 2:38:21 AM8/8/17
to cesium-dev
在 2017年2月11日星期六 UTC+8下午4:25:13,Muhammed Kalkan写道:
When will open source your project?

Thanks!

Muhammed Kalkan

unread,
Aug 9, 2017, 4:45:39 AM8/9/17
to cesium-dev, soniu...@gmail.com
I was on a break, will continue next month. 

8 Ağustos 2017 Salı 09:38:21 UTC+3 tarihinde soniu...@gmail.com yazdı:

robert.g...@gmail.com

unread,
Sep 3, 2017, 7:01:00 PM9/3/17
to cesium-dev

Hi, I am really interested in your work. I would love to try it out even if it's not completed yet.
I really would appreciate early access ;)

rahimeyi...@gmail.com

unread,
Oct 23, 2017, 9:17:24 PM10/23/17
to cesium-dev
9 Ağustos 2017 Çarşamba 11:45:39 UTC+3 tarihinde Muhammed Kalkan yazdı:
> I was on a break, will continue next month. 
>
> 8 Ağustos 2017 Salı 09:38:21 UTC+3 tarihinde soniu...@gmail.com yazdı:在 2017年2月11日星期六 UTC+8下午4:25:13,Muhammed Kalkan写道:
>
> > Hi,
>
> > Congratulations for your project,
I'm working on same lesson at university.I have to find a solution for finding route in terrain using quantized mesh.But ,i don't know how can i integreted this two theme? Thanks for texts...

Mussb Abulhassen

unread,
Oct 25, 2017, 5:02:56 AM10/25/17
to cesium-dev
Hi there Muhammed,

  I'm currently working on a (node.js) tool  Here  that re-draw input DEM with height values sampled from "STK-World" terrain data, and I was wondering if your source-code is available now , i t might help me fix the slowness in performance for my tool.

Thank you,

Mussab

Muhammed Kalkan

unread,
Oct 26, 2017, 3:57:48 AM10/26/17
to cesium-dev
@ Rahime

I have focused more on terrain generation and serving thus i am afraid i cant be of any help about that.

One idea is to make your algorithm to work with regular heightmaps and move on to the quantized format. Since it has regular distances, you can proceed in your algorithm more easily.

Route finding is a kind of constrained optimization problem and can be applied any kind of sampled data.

@Mussab

Code is not available but i believe it wouldnt be any use since sampling which is what you are trying to do is much more calculation free than generation part. Generation and re-sampling focus completely different parts of the data.

ahua...@gmail.com

unread,
Jan 8, 2018, 1:06:43 AM1/8/18
to cesium-dev

Hi, I have implemented the quantized-mesh output to the CTB (ctb-tile tool). 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/

Reply all
Reply to author
Forward
0 new messages