Solved

MBTiles (RASTER) writing

  • 13 February 2024
  • 5 replies
  • 110 views

Userlevel 1
Badge +2

Any way to write to different zoom levels on the same MBTile? 

If I change the mbtiles_zoom_level and send 2 rasters to the writer - it still writes 2 different tiles, and not within a single MBTile and different layers/overview. Is this not possible?

icon

Best answer by kailinatsafe 15 February 2024, 20:01

View original

5 replies

Userlevel 3
Badge +13

Hello @sigher! The zoom level parameters in the writer feature type should allow you to control zoom level. The maximum zoom level should be determined automatically based on the spacing/resolution of the dataset (with the Base Zoom Level Strategy parameter). Then the minimum zoom level is determined by the Minimum Zoom Level parameter. You should only need to send a single raster to the writer. Can you explain a bit more about what you’re trying to do? Happy to help, Kailin.

Userlevel 1
Badge +2

I tried, but it seems that it adds the data to individual files, one with the filename and one with _1 filename. So two different files instead of a single mbtile 

Userlevel 3
Badge +13

Hello @sigher, hmm thinking more about this, I am unsure it is possible. I think each tile only supports a single zoom level. In the MBTiles dataset, you would have a number of tiles for each zoom level. For example, you would have a set of tiles for zoomlevel 5, twice as many for zoomlevel 6, then twice as many again for zoomlevel 7, and so forth. Each zoomlevel has a fixed pixel size in world coordinates, so it would be impossible to have a tile with more than one zoomlevel, which is why I think FME is writing a seperate MBTile. I hope this makes sense, sorry for the bad news! Happy FMEing, Kailin.

Userlevel 1
Badge +2

I have done some more testing and this post seems to describe things a bit more: https://gis.stackexchange.com/questions/317690/gdal-create-mbtiles-with-differing-image-by-zoom-level

I have figured out that I can read the two separate mbtiles files in FME as a SQLite db and there I can see that they have different zoom levels. I am trying to have high resolution of only a small area and not all tiles at the lower zoom levels.

 



 

 

Userlevel 3
Badge +13

Hello @sigher, sorry for my late reply! I am still unsure this is possible, FME will write all the features per zoom level with the same extents/resolution. Perhaps someone who is more familiar with MBTiles and zoomLevels can chime in, sorry I don’t have a better solution for you. Happy to help, Kailin! 

Reply