Imagery REST API

Hi,

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):

https://assets.ion.cesium.com/us-east-1/3845/4/8/11.jpg
https://assets.ion.cesium.com/us-east-1/3845/8/143/177.jpg
https://assets.ion.cesium.com/us-east-1/3845/10/573/711.jpg

I tried with .png and .jpeg as well with same results.

QUESTIONS

  1. Why are these requests returning NoSuchKey errors?
  2. 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).

Thanks!

Hi, if you are able to provide more information, it will help us troubleshoot the issue.

  1. What country are you trying to access the data from?
  2. Are you using one of the Cesium provided viewers (eg. CesiumJS, Cesium for Unity, etc)?
  3. Are you able to provide code samples of how you are accessing the assets?

Thanks

  1. United States
  2. Not using a provided viewer; using the provided REST API though.
  3. I’m creating an http request as a GET with the URL provided. Using the header: authorization → Bearer [access code].

Hi all,

Is there any other information I can provide to help figure this out?

Thanks!

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.

Please refer to the WMTS (web map tile service) or TMS (tile map service) specifications for more information about the formats.

Hi, thanks for the response!

Switching to png gave the expected imagery.

I tried some REST request listed in the TMS guide that you linked and also receive the NoSuchKey error with those requests. For example:

https://assets.ion.cesium.com/us-east-1/3845 (NoSuchKey)
https://assets.ion.cesium.com/us-east-1/3845/services/root.xml (NoSuchKey)

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.

Thanks for the help!

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.

If you are implementing your own version you can see what CesiumJS does here in the source code.

Thanks for your help!

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:

<?xml version="1.0" encoding="utf-8"?>
<TileMap version="1.0.0" tilemapservice="http://tms.osgeo.org/1.0.0">
  <Title></Title>
  <Abstract></Abstract>
  <SRS>EPSG:3857</SRS>
  <BoundingBox minx="-77.12237331552723" miny="38.78548120381974" maxx="-76.90071578827998" maxy="39.00174571146076"/>
  <Origin x="-77.12237331552723" y="38.78548120381974"/>
  <TileFormat width="256" height="256" mime-type="image/png" extension="png"/>
  <TileSets profile="mercator">
    <TileSet href="4" units-per-pixel="9783.939620502561" order="4"/>
    <TileSet href="5" units-per-pixel="4891.96981025128" order="5"/>
    <TileSet href="6" units-per-pixel="2445.98490512564" order="6"/>
    <TileSet href="7" units-per-pixel="1222.99245256282" order="7"/>
    <TileSet href="8" units-per-pixel="611.49622628141" order="8"/>
    <TileSet href="9" units-per-pixel="305.748113140705" order="9"/>
    <TileSet href="10" units-per-pixel="152.8740565703525" order="10"/>
    <TileSet href="11" units-per-pixel="76.43702828517625" order="11"/>
    <TileSet href="12" units-per-pixel="38.21851414258813" order="12"/>
    <TileSet href="13" units-per-pixel="19.10925707129406" order="13"/>
    <TileSet href="14" units-per-pixel="9.554628535647032" order="14"/>
    <TileSet href="15" units-per-pixel="4.777314267823516" order="15"/>
    <TileSet href="16" units-per-pixel="2.388657133911758" order="16"/>
    <TileSet href="17" units-per-pixel="1.194328566955879" order="17"/>
    <TileSet href="18" units-per-pixel="0.5971642834779395" order="18"/>
    <TileSet href="19" units-per-pixel="0.2985821417389697" order="19"/>
    <TileSet href="20" units-per-pixel="0.1492910708694849" order="20"/>
  </TileSets>
</TileMap>

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)):

https://assets.ion.cesium.com/us-east-1/asset_depot/3827/WashingtonDC2017/v1/14/9376/11729.png (NoSuchKey)
https://assets.ion.cesium.com/us-east-1/asset_depot/3827/WashingtonDC2017/v1/14/9371/11733.png (NoSuchKey)
https://assets.ion.cesium.com/us-east-1/asset_depot/3827/WashingtonDC2017/v1/14/9372/11733.png (NoSuchKey)

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.

Hi, thanks for the quick response.

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?

Thanks!

Hi

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.

Finally got it working, thanks for all the help!

Issue was <TileSets profile="mercator">. I didn’t realize datasets can have different projections.

1 Like