loicgasser / quantized-mesh-tile

Quantized-Mesh encoder/decoder and topology builder
MIT License
89 stars 20 forks source link

may i know if this quantized-mesh tiles has “metadata” extension? #43

Open zhangiser opened 2 years ago

zhangiser commented 2 years ago

Hi there I'm not a python programmer,this is my first meet python tools.I used CTB before to generate quantized-mesh.But there may have some bugs.Because the CesiumJS not only need layer.json but also need metadata extension in 0/0/0.terrain and 0/1/0.terrain and every tile in level10 to init the availbility.We can trace the code at Cesium Source Code.

This rule can be find by Cesium World Terrain which provide by Cesium ion.

So I'm looking for a new tools to generate the quantized-mesh tiles ,and my problem is does the tiles created by this python tools has metadata extension in 0/0/0.terrain and 0/1/0.terrain and every tile in level10 ?

Best,zhangiser

loicgasser commented 2 years ago

This library doesn't handle the generation of the layer.json. Looking at the code you linked if you don't define metadataAvailability it will just use available which is what you want. Now if you are referring to the metadata extension in the tile (https://github.com/CesiumGS/quantized-mesh#metadata) this library doesn't support it. It has only water mask and lightning. I suspect you can configure your client to tell Cesium that your tiles don't have any metadata.

zhangiser commented 2 years ago

maybe you are right,i'll try it later.and i'm curious about why there has no metadata extension in your quantized mesh,but cesium terrain layer could still work well?

loicgasser commented 2 years ago

metadata extension in the terrain tile is optional. It is there to store extra arbitrary data, not used directly by Cesium to do any of the terrain rendering.

zhangiser commented 2 years ago

@loicgasser

metadata extension in the terrain tile is optional. It is there to store extra arbitrary data, not used directly by Cesium to do any of the terrain rendering.

I used Ceisum World Terrain from Cesium ion as a test,there has some problems.I set the requestMetadata:false

      Cesium.Ion.defaultAccessToken = "some token"
      var terrainProvider = new Cesium.CesiumTerrainProvider({
        url : Cesium.IonResource.fromAssetId(1),
        requestVertexNormals : false,
        requestWaterMask : false,
        requestMetadata:false,
      })
      viewer.terrainProvider=terrainProvider;

When i tracked from chrome network,found there only requested 0/0/0.terrain and 0/1/0.terrain,then continue to zoom in,the terrain layer doesn't request terrain tile anymore,so terrain is not shown in the map,If set requestMetadata:true,then everything is ok,we can see terrain in the map again. So,i guess metadata is not optional,it's required.