"Failed to obtain image tile" with custom GeoTIFF & Expected rectangle to be typeof object

Hi everyone,

I am getting a persistent Failed to obtain image tile error when trying to load a custom imagery asset from Cesium Ion. I have thoroughly searched the forum, and while many suggest CORS or proxy issues, I am encountering this directly within the Ion Preview and Sandcastle, so CORS is strictly ruled out.

The Context: I am draping large-scale Vector data onto 3D Terrain. To optimize client-side performance, I decided to pre-bake our vector data into Raster Imagery offline before uploading to Cesium Ion using Node.js (canvas) and GDAL .

My Pipeline:

  1. Generate high-res PNG using Node.js (canvas).

  2. Warp and georeference via GDAL to output a standard WGS84 (EPSG:4326) GeoTIFF.

  3. Upload to Cesium Ion as an Imagery Asset. (Dashboard reports “Complete” with no errors).

The Issue: The upload to Cesium Ion is 100% successful and actually displays on the map. It passes the georeferencing checks and processes without throwing any errors on the Ion dashboard. However, when I load it into CesiumJS via IonImageryProvider, the console is flooded with errors like: An error occurred in "IonImageryProvider": Failed to obtain image tile X: 26007 Y: 14468 Level: 15. Shortly after that, upon interacting with the map (panning/zooming or waiting a bit of time), I encounter missing tiles and a subsequent fatal engine crash with the following trace:

An error occurred while rendering.  Rendering has stopped.
DeveloperError: Expected rectangle to be typeof object, actual typeof was undefined
Error
    at new DeveloperError (https://sandcastle.cesium.com/js/engine/index.js:7476:11)
    at Check.typeOf.object (https://sandcastle.cesium.com/js/engine/index.js:7570:11)
    at _Rectangle.southwest (https://sandcastle.cesium.com/js/engine/index.js:24763:26)
    at WebMercatorTilingScheme.rectangleToNativeRectangle (https://sandcastle.cesium.com/js/engine/index.js:112139:60)
    at ImageryLayer._createTileImagerySkeletons (https://sandcastle.cesium.com/js/engine/index.js:118560:25)
    at prepareNewTile (https://sandcastle.cesium.com/js/engine/index.js:229482:13)
    at GlobeSurfaceTile.initialize (https://sandcastle.cesium.com/js/engine/index.js:229287:5)
    at GlobeSurfaceTile.processStateMachine (https://sandcastle.cesium.com/js/engine/index.js:229292:20)
    at GlobeSurfaceTileProvider.loadTile (https://sandcastle.cesium.com/js/engine/index.js:232005:28)

Source:

My Questions / Bug Report:

  1. Ion Tiling Issue: Why is Ion’s backend returning 404s for specific tiles (likely edge cases) when the GeoTIFF upload was marked as completely successful?

  2. Are there specific GDAL creation options (-co) or NoData configurations that we must set so Ion doesn’t generate these “poison pill” edge tiles that crash the client?

Any insights into how Ion handles these custom GeoTIFFs behind the scenes would be greatly appreciated. Thank you! :grin:

Hey @zanzandora, thanks for the thorough writeup, the Sandcastle, and the source file. That’s really helpful!

I think there are two separate things happening here:

1. The ion edge tile 404s/undefined typeof

I’m going to flag this with our tiling team so they can look at what’s happening on the backend when your GeoTIFF gets processed. The 404s/typeof undefined on edge tiles suggest something in the tiling pipeline isn’t matching expectations, but I don’t want to speculate on the exact cause without them looking at it.

2. The client-side crash

Regardless of why the 404s/typeof undefined happen, CesiumJS should handle missing tiles gracefully rather than crashing with Expected rectangle to be typeof object. I’d encourage you to file this as a GitHub issue on the CesiumJS repo (Issues · CesiumGS/cesium · GitHub) with your stack trace and Sandcastle link. The engine should treat 404 tile responses as transparent/missing rather than halting the render loop.

I’ll follow up once I hear back from the tiling team. Cheers!

Hi @darcyvdd,

Thanks for the detailed breakdown! I completely agree with your point—the client-side engine should definitely handle these edge/missing tiles more gracefully instead of breaking the entire rendering loop.

Following your advice, I have created a GitHub issue tracking this crash on the repository. You can follow it here: Issue #13513. I’ve included the complete stack trace and the reproduction context there.

On my end, due to tight work schedules and project priorities, I have to temporarily archive this task and jump onto another project for a while. However, since this is still important to our pipeline, I have subscribed to the GitHub issue and will be keeping a close eye on any updates or workarounds from the development team.

Thanks again for your awesome support! :grin: