An error occurred in " " Failed to obtain image tile X: Y:

Hello,

I have ceisumJS running on a completely closed network. I am trying to provide maptiles from a local map server on that same network. I am using GitHub - DenisCarriere/mbtiles-server: Provides a compatible WMTS Tile Server from MBTiles. to start the server.
I am using maptiles data from OpenStreetMap vector tiles of Planet OpenStreetMap Tiles, GeoData and OpenData Maps | MapTiler Data
The format is PBF so I am serving the images in that format. I have both an mbtiles file and also ran mbutil (GitHub - mapbox/mbutil: Importer and Exporter of MBTiles) to unpack the tiles. Everything exists on my F drive.
So in F:unzippedTiles is a list of PBF formatted images. In F:mbtiles/2017-07-03_planet_z0_z14.mbtiles I have the mbtiles file.
I have tried to serve from both the mbtiles folder alone and from the actual pbfs in unzippedTiles.
I have tried to use WebMapTileServiceImageryProvider and TileMapServiceImageryProvider and UrlTemplateImageryProvider.
I can even download a pbf image through the URL.Cesium just can’t display it.

The example I have below can request the server and get a clear response but unfortunately I get "An error occurred in “UrlTemplateImageryProvider”: Failed to obtain image tile X: 1 Y: 1 Level 1.

I am getting a response from the server. I also made my own cert so i am using HTTPS so CORS should not be an issue (I saw CORS can affect users using HTTP )

This error is so broad and I am not sure what to do next. I have read every google article mentioning this error and usually it’s a CORS issue but I am using HTTPS.

Here is the code I am using now

imageryProvider: new Cesium.UrlTemplateImageryProvider({

url: Cesium.buildModuleUrl(‘https://IP_ADDRESS:PORT/2017-07-03_planet_z0_z14’) + /{z}/{x}/{reverseY}.pbf’,
layer: ‘baselayer’,
maximumLevel: 14,
style: ‘default’,
format: ‘openmaptiles’,
})

Preferably I would like to not use the mbtiles file at all as I already have the unzipped tiles on the server (As well as PLENTY of RAM and Memory)

Does anyone have any ideas on how to make this work? I am willing to use a different server but to me everything on the server side works fine (As I can request and get a response) I am leaning towards something being off with the PBF format. I also have the tiles unzipped as jpeg as well but I read online that could be an issue as the mbtiles file I downloaded is specifically in the PBF format. Do I need a new source of tiles? New server? Please help as I am running out of ideas.

I am using Cesium version 1.68 so that also could maybe be an issue but I glanced through all patch changes and did not see anything that would help me (I could be wrong)
The server is on windows.

Thanks, Kai

I’d like to add an update for anyone suffering from similar problems. MBtiles files can either be in raster or vector style. The source I used was vector and mbutil cannot properly unpack vector tiles. I was able to find a world map in raster format here (GitHub - klokantech/vector-tiles-sample: Vector tiles sample MBTiles file with PBF's made by mapnik via MapBox Studio) that I tried instead and it worked with no problem. However I do not like the coloring and would rather have a gray/white base plus a little more detail. I think my next plan is to use GitHub - consbio/mbtileserver: Basic Go server for mbtiles as it can properly serve vector tiles. If anyone knows where I can get a world map (nothing too detailed, would like country borders and names and maybe the names of the large cities) please let me know. Even If i can purchase a one time world raster package which I am having trouble finding that would be excellent.

Hi @kaikai,

Thanks for bringing this to the community. Before we deep dive, is it possible for you to send a sandcastle example that showcases this behavior?

-Sam

1 Like

Thanks for the help Sam. My first question is if cesium js is capable of rendering vector tiles (.pbf) ? I tried the Go server mentioned above and had the same result. I can serve the raster mbtiles just fine but cannot serve the vector mbtiles.

As you can see my requests are valid. Since I have ran two different servers and they both work with raster tiles I am starting to lean on CesiumJs as being the issue.

I am using the Imagery Layers Manipulation in the sandbox and starting my servers with both of the codes packages above. The image above was modifying code in the WebMapServiceImageryProvider but with my url http://127.0.0.1:3000/services/countries/tiles/{z}/{x}/{y}.pbf

Cesium supports pdf format. Maybe you should change your tilingScheme option when create imageryProvider?(Not sure). I remeber once I added tilingScheme: new WebMercatorTilingScheme() to reslove a similar problem.

1 Like

Did you mean to say pbf format? I am not trying to take in any PDFs
Regardless, ty for the suggestion, unfortunately I am still having the same problem

@kaikai,
to my knowledge, pbf is not supported yet, but there is a 3rd party module, that maybe does what you want. Look at the post in this GitHub Issue.

Best, Lennart

@lennart.imberg That is the conclusion I have come to as well. Thank you for that link. That is promising and I have not stumbled upon that yet.

I am currently dealing with the same problem. Did you find a solution?

Unfortunately no. I ended up downloading the highest res picture of earth I could find and generated my own tiles using GDAL.