TerrainProvider - quantized Mesh

Hello,

I am following the guidelines at : cesium/Documentation/OfflineGuide at main · CesiumGS/cesium (github.com)

I have an http server running and it can serve up .terrain files with the appropriate mime encoding of application/octet-stream. My layer.json is correct.

I am getting the error:
An error occurred in “gh”: Failed to obtain terrain tile X: 0 Y: 0 Level: 0. Error message: “RangeError: Invalid typed array length: 10729171605”

Cesium.js:9418 An error occurred in “gh”: Failed to obtain terrain tile X: 1 Y: 0 Level: 0. Error message: “RangeError: Invalid typed array length: 855693507”

What could be wrong?

Please advise.

Thanks much,
-Timothy

gzip

1 Like

Hello, Im not sure I understand.
Do I need to gzip the files or specify gzip in the server config?

OK, the http-server is not real configurable, so to get the proper gzip content-encoding there are a couple things to do.
NOTE: .terrain files are gzipped, so for anyone interested here is a workaround:

  1. rename all .terrain files on the server to .terrain.gz using your favorite cmd/bash rename script
  2. set a custom.types file to have the following
    application/vnd.quantized-mesh;extensions=octvertexnormals terrain
  3. run the http-server with the -g --mimetype custom.types
  4. you are up an running.

unzipping the terrain files is a definite no-go, so the above is what worked for me.
Thanks much,
-Timothy

1 Like