geo-data / cesium-terrain-builder

A C++ library and associated command line tools designed to create terrain tiles for use in the Cesium JavaScript library
Other
729 stars 345 forks source link

`RangeError: "invalid array length"` when viewing ctb generated tiles with quantized-mesh-viewer (heremaps). #89

Open swiss-knight opened 4 years ago

swiss-knight commented 4 years ago

I've generated some tiles from a DEM (Erdas Imagine format) using the ctb-tile tool under Ubuntu 18.04.

I want now to visualize the generated tiles.
For this purpose, I used quantized-mesh-viewer.
I placed a symlink in my local repo of the quantized-mesh-viewer to replace the default example-tile/ folder. I made the necessary changes in the meshUrl variable in the ./src/tile/index.js file.

After what, while navigating to my tile, it doesn't show up, the box stays black.
I double checked that the tile file I used do have a few kilo bytes of data.

In the browser console, this error raises; RangeError: "invalid array length". Details:

THREE.WebGLRenderer 92 three.js:21172:11
RangeError: "invalid array length"
    node_modules index.js:44
    node_modules index.js:246
    createQuantizedMesh create-quantized-mesh.js:326
create-quantized-mesh.js:355
RangeError: "invalid array length"
    node_modules index.js:44
    node_modules index.js:246
    createQuantizedMesh create-quantized-mesh.js:326
create-quantized-mesh.js:355
(...)

I don't know from which side does the errors come from; ctb-tile or the quantized-mesh-viewer? Do you have any cue on how to fix this or on the source of the problem?

This issue was originally posted here: https://github.com/heremaps/quantized-mesh-viewer/issues/16

Cq5616 commented 4 years ago

i have met the exactly same problem when using quantized-mesh-viewer

philippfra commented 1 year ago

I'm facing a similar Error while trying to decode a Tile with python-library "quantized-mesh-tile". Tiles are generated with the ctb-docker and are productiv with cesium. I tried to read and mutate single tiles with python. The problem described above seems to have the same source. For me it looks like the tile generated with ctb are not compatible with other tools. Are there any News about this Issue? Python-Traceback: image

sraimund commented 4 months ago

The terrain tiles produced by ctb-tile are gzipped. You can use 7-Zip or python's gzip module to unzip them.

However, as far as I know, this repository is only able to create terrain tiles in the heightmap format. I'm getting a RangeError: offset is outside the bounds of the DataView when trying to view them after unzipping.

Quantized mesh tiles can be generated by ahuartes47's fork, which is also available on Docker. The unzipped tiles can be inspected with the quantized-mesh-viewer:

grafik