SAYEOR
April 9, 2024, 10:19am
1
Some of the content is shown below
"available": [
[
{
"endX": 21,
"endY": 31,
"startX": 0,
"startY": 0
},
{
"endX": 42,
"endY": 5,
"startX": 22,
"startY": 0
},
{
"endX": 63,
"endY": 31,
"startX": 49,
"startY": 5
},
{
"endX": 63,
"endY": 4,
"startX": 43,
"startY": 0
},
{
"endX": 48,
"endY": 5,
"startX": 43,
"startY": 5
},
{
"endX": 48,
"endY": 31,
"startX": 22,
"startY": 6
}
],
What do the X and Y coordinates in the content represent?
Does it represent the X and Y coordinates in TilingScheme
?
Hey @SAYEOR , thanks for the question. Kevin provided an explanation of the available property in response to another question here .
Tony,
As the error says, your tileset must provide availability. That means the “available” property of the terrain provider must not be undefined. Otherwise sampleTerrainMostDetailed can’t tell which tells exist, so it can’t request the most detailed ones in an area. For CesiumTerrainProvider, this means your layer.json must include the “available” property. Here’s an example of one that does:
http://www.ga.gov.au/terrain/terrain/layer.json
Each element in the “available” array is for a level of the tile hierarchy. i.e. the 0th element is for level 0, the 1st element is for level 1, etc. Each element itself is an array of rectangles of tiles that exist at that level. startX/startY/endX/endY specify the range of tile indices within that level that exist. The values are inclusive.
Kevin
Take this abbreviated example:
{
// rest of layer.json omitted
"tiles": ["{z}/{x}/{y}.terrain?v={version}"],
"available": [
[
{
"startX": 0,
"startY": 0,
"endX": 32,
"endY": 32
}
],
[
{
"startX": 64,
"startY": 32,
"endX": 128,
"endY": 64
}
]
]
}
Here, we’re telling Cesium that there’s two layers available, layer 0 and layer 1. The first element of the array defines the range of indices for layer 0, telling it that the tiles it needs for that layer can be found between 0/0/0.terrain
and 0/32/32.terrain
. Layer 1 says that the tiles are located between 64-128 on the X index and 32-64 on the Y index. This means that Cesium will make requests for tiles for layer 1 between 1/64/32.terrain
and 1/128/64.terrain
.
I hope this helps clear things up!
1 Like