[OSM-talk] Update my OSM Tiles after Diff DB Application??
Frederik Ramm
frederik at remote.org
Tue Sep 21 19:32:51 BST 2010
Hi,
maw269 wrote:
> I am creating my own tile server for OSM using Windows Server 2003.
> I need help on how to make tiles expire and create new tiles after updating
> my postgres DB with osm diffs.
I just answered the following on help.osm.org; if this discussion here
yields additional interesting points, feel free to copy them there:
First of all, you have to understand that this is not a high performance
setup and that you will not be able to keep a current set of tiles for
anything larger than a small country with this. With no on-demand tile
rendering you will always struggle to keep every single tile current,
spending lots of CPU cycles for nothing.
You are probably using generate-tiles.py from the OSM Mapnik SVN. There
is a function in there that calculates a single tile. With a little bit
of Python you should be able to adapt the script to actually read the
file generated by osm2pgsql and call the tile compute routine for each
tile in that file. I am not aware of a ready-made solution for that in a
renderd setup you could use render_expired but you'll have to do it that
way.
You can request osm2pgsql to output a list of modified tiles for a whole
range of zoom levels. Be aware that if you include small zoom levels
then the tiles on these zoom levels will be rendered very often; you
might want to employ some grep/sort magic and re-render those only once
every few days.
All in all, the mechanisms involved are complex and PostGIS caching
performance is less if you render a flurry of new tiles across a large
area compared to systematically rendering all tiles. You might find that
with the rather small area you're able to cover with your setup anyway,
it might be easier and not even slower to just re-render the whole lot
once in a while rather than trying to process updates.
Bye
Frederik
--
Frederik Ramm ## eMail frederik at remote.org ## N49°00'09" E008°23'33"
More information about the talk
mailing list