I’m trying to render local versions of OSM maps and it is very slow to render one tile at a time. I tried to change the code to render meta tiles but my changes don’t work properly. Anyone have existing code to do that already?
You’re not giving enough info. What software are you using to render tiles?
I use mapnik with postgis, I tried to modify the python script that exists in the OSM svn repository to do meta tiles, os far without success. Generating single tiles works but takes too long.
You could instead of 256x256 render 2176x2176 tiles, discard the outer 128 pixel buffer area (for other, labeling, reasons), and cut out the rest into 8x8 tiles and save those to the file system. I think you can easily use the Python Imaging Library for that.
Or take a look at mod_tile or TileCache, both of which can do metatiling.
I’ve tried to do the meta tiling and I can create the meta tile but it appears something in my code is wrong and the generated tiles are not in the right location as I intended it to be. That’s why I wonder if anyone else already did the same and can provide his code.
I looked at TileCache but they don’t work with PostGIS, or at least I couldn’t find any hint on how to get it to work.
I’d still prefer to work with a python script I can understand since I can render on one machine but need to sync the data to another machine for serving, so I need to hook into methods for de-duplication of tiles and limit modification of tiles on disk so that rsync will do the best possible job.
TileCache works at another level. It provides a TMS to e.g. OpenLayers, and calls mapnik to render requested tiles. Mapnik does all the postgis stuff.
Maybe mod_tile’s renderd.py script may help you to understand metatiling? On the NL tileserver, we run a python script in Cherokee, to call the mod_tile’s renderd to actually render tiles for us. Find rullzer on irc.oftc.net for details of the Cherokee script.