I’m attempting to use the REST API for Imagery data. With my current setup, asset 3954 works great. However, switching to other Imagery assets (so far tried 3845 and 3812) gives NoSuchKey errors. I’m fairly certain my tile requests are valid though. For example (all give NoSuchKey error):
I tried with .png and .jpeg as well with same results.
QUESTIONS
Why are these requests returning NoSuchKey errors?
I’m using https://api.cesium.com/v1/assets/{assetId}/endpoint to get data about the asset. Is there a way to get more info on an Imagery asset? For example, min/max zoom level, supported imagery types (jpg, png, etc).
Thank you for providing that additional information. We have investigated further and determined that the issue is with the URLs provided. Asset 3845 specifies png extension. The URLs you provided are using a jpg extension.
QUESTION
Which REST API from the TMS page you linked should I use to get the correct tile extension (jpg, png, etc) and maximum supported zoom level? …/services/root.xml gives NoSuchKey.
Hi. Sorry for the inconsistency with the specification and the implementation. For TMS services Cesium stores the metadata at {base-url}/tilemapresource.xml. So the URL would be https://assets.ion.cesium.com/us-east-1/3845/tilemapresource.xml. While that information is not part of the specification it has historically been what Cesium has always done.
This works well for some assets (3845, 3812, 3954), but I’m having similar issues with NoSuchKey response with 3827. For example, tilemapresource.xml for asset 3827 gives:
Does this mean zoom levels 4 - 20 are valid? I’m getting NoSuchKey responses for seemingly valid tile requests (zoom level 14, within bounds, correct extension (png)):
Hi,
It is possible that there is no data at that particular location so the server sends an error response instead of sending an transparent tile. For reference you can see what CesiumJS does in its TileMapServiceImageryProvider and WebMercatorTilingScheme.
I tried pulling asset 3827 at zoom level 9,14, and 16 at the origin, (-77.12237331552723, 38.78548120381974) and from the center of the bounding box: (-77.0115415, 38.89361345764025). Nothing came back with a valid tile, all returned NoSuchKey error. I believe I’m following the same logic as the code you linked.
Can you give me a valid zoom level, tileX, and tileY for this asset so I can verify on my end?
15/9375/20229.png is one example of a valid tile. You can find examples by opening up the network tab of the inspector in your browser when viewing the asset either in the ion preview window, or in Sandcastle (by using the Open complete code example link). You should be able to see the network requests for the individual map tiles.
If you download the CesiumJS repository and run sandcastle locally, you can step through the code in TileMapServiceImageryProvider and WebMercatorTilingScheme to see how it is generating the requests.