Integrate 'routeGraphics' with tile expiration, trigger from tile update
kennykb opened this issue · 0 comments
The current mode of operation of 'routeGraphics.tcl' is to run as a batch, searching the database for route relations for which graphics are available but have not yet been generated.
This takes a while - it's too heavyweight for minutely updates.
There are several possibilities for how to address this.
One possibility would be to generate graphics on demand in 'osm2pgsql' when doing the import. I don't much like this; it's piling too much responsibility into that program.
A better possibility is to trigger running 'routeGraphics' separately when inserting a route for which graphics are not yet available, or to run it as a 'cron' job. This is somewhat more attractive, except that in some systems updating a route immediately triggers re-rendering of tiles in which it appears. There would therefore be a rendered tile with the new route and no shields.
This could be mitigated by having the 'routeGraphics' program also produce a tile expiry file, like the one that comes from 'osm2pgsql', so that the presence of new graphics will redraw the routes that use them. Some sort of functionality like this is needed anyway, so that when new graphics templates become available, the tiles that would benefit from them can be expired.
Some of this would be moot if the downstream pipeline could be altered to allow Mapnik to render directly from template SVG's, but there still needs to be a way to force tile refresh when new templates are provided.