I'm developing a PC application that uses local OSM tiles. I'm using OSM docker from switch2osm to generate XYZ .png tiles for a given area and supply directory with tiles to our clients with our app. I'm using Python/Kivy/MapView for displaying tiles.
My problem is with the number of tiles - for example map of Poland in zoom levels 9-16 takes up over 20GB disk space and over 4 million files. Reducing disk space usage would be nice, but most importantly I want to reduce numer of tiles that need to be compressed, extracted, copied etc. I know that standard 256x256 tiles are great for serving over web, but I'm thinking to moving to 512x512 (or even 1024x1024) tiles for local tiles in hope of reducing number of files while still maintaining the details shown on the map.
I have few ideas that I'd like to get some feedback from more experienced OSM developers:
- simply stitch 4 256x256 .png files together into one 512x512 file (for example 4 tiles of zoom=16 become one tile of zoom=15)
- change mapnik/renderd configuration to render 512x512 tiles with higher level of details (on zoom=15 tiles show everything that's visible by default on zoom=16)
- switch to raster .mbtiles
I would prefer going with 2. since it's more general solution than 1. and needs less changes in app code than 3., but I'm in the dark as what exactly needs to be changed in tile server configuration. If anybody have any tips / resources I'd appreciate it.