3

I am creating an app in Android that requires cached areas. I allow the user to cache an area of reasonable size. The server provides these tiles in a zip in the format /z/x/y.png.

I took a (very) naive approach and simply wrote a python script to grab the images from the localhost using apache2 with mod_tile (127.0.0.1/osm/z/x/y.png), save to a directory, then zip.

Under a load test, this failed terribly. Is there a more efficient way to create the png files locally? (Mapnik api and python?) Or is a queue for users an absolute necessity to prevent server overload?

3
  • I'm having trouble understanding your actual problem. Do you want help with the downloading of tiles, or Creating the tiles, or storing the tile? Furthermore, what server/service are you using? Commented Jul 28, 2014 at 3:24
  • I don't really understand your question, but I suspect the answer is MapBox's mbtiles format. It uses an SQLite database. Commented Jul 28, 2014 at 3:39
  • Me too, is the issue the tile creation process, the tile caching process, or the download/extraction process .. If you want the tiles, just populate the cache and zip the whole directory. In Geowebcache it is called a Seeding Operation, you can also use TileCache .. Commented Jul 28, 2014 at 3:41

1 Answer 1

0

Use GeoWebCache or Tilecache to generate your tiles. The Process is called Seeding .. You need to be aware of the different file storage schemas ..

References:

TileCache Seeding

Discussion on the Tilecache Disk Format

GeoWebCache Seeding

There is also this process Exporting and extracting the tiles from TileMill That may suit as well ..

With GeoWebCache, accessing the data store directly is problematic, but you should be able to build a script to pull the tiles without any load issues, it is very efficient.

Once you have your scripts in place, you can reseed and re-download your zip files to keep your app up to date.

Not the answer you're looking for? Browse other questions tagged or ask your own question.