[OSM-Devserver] How to make renderd call my own renderer?

Jochen Topf jochen at remote.org
Do Jul 1 06:55:55 CEST 2010


On Wed, Jun 30, 2010 at 06:16:57PM +0200, Kay Drangmeister wrote:
> I wrote a render script that (similar to the compositing that
> hike&bike map does) does things that mapnik is not capable of.
> 
> My script is written in python and can render bboxes into
> arbitrarily sized images, as well is able to serve tiles
> (e.g. http:localhost/bla.../12/345/678.png)
> 
> However it is probably the utmost slow renderer there is,
> it takes about 3 minutes for a simple tile. (Which is ok, because
> it's experimental only at the time. :))
> 
> How can I make renderd (or tirex, or tilecache) call that
> script, I found no documentation on that. I want to create
> metatiles of course, too, because I have a thin lines of garbage
> at the tile boundaries.

There are several ways how you can integrate your renderer with Tirex, all
of them need some programming:

1. Add WMS capability to your program and use the WMS backend of Tirex.
   Basically your script needs to understand a http WMS request containing
   a bbox in lon/lat instead of the usual tile notation that it already
   supports. See http://wiki.openstreetmap.org/wiki/Tirex/Backends/WMS
   This is probably the easiest way as you seem to already have all the
   building blocks. And as a plus, WMS is a standard, so your script can
   work in other environments, too.
2. Write a new "tile backend" for Tirex which does basically the same as
   the WMS backend but uses the different tile naming convention. Should be
   fairly simple, but you have to think about the tile-vs-metatile issue.
   Tirex always works with metatiles internally, so you would have to do
   64 (8x8) tile requests and stich together the metatile in the Tirex
   backend or convert your program to directly render metatiles.
3. Create a new Tirex rendering backend using your script. You will have
   to write some code to understand the Tirex backend protocol. See
   http://wiki.openstreetmap.org/wiki/Tirex/Backends . This should be
   pretty easy to do, you can use the Test backend as a template. Programming
   language doesn't matter (your backend can stay a Python script) as the
   backend runs in its own process. This gives the tightest integration
   with Tirex which is best performance-wise.

Jochen
-- 
Jochen Topf  jochen at remote.org  http://www.remote.org/jochen/  +49-721-388298