[OSM-dev] Improvement of tile rendering

Dane Springmeyer blake at hailmail.net
Tue Mar 17 23:42:14 GMT 2009


Hey Udo,

On Mar 17, 2009, at 8:36 AM, Udo Giacomozzi wrote:

> I just set up my own Mapnik server that renders map tiles on demand
> and saves them on disk so that they are efficiently cached. Currently
> this is done using a PHP script (FastCGI handler with 5 instances)
> that handles 404 errors and invokes a python script to render the
> tile which then gets stored at the location that caused the 404 error.
> Invoking python from PHP is suboptimal, I know, but I'm no Python
> programmer, PHP lacks Mapnik support and so far this was only a proof
> of concept.
>

Cool, sounds like it works fine though and many people use PHP so you  
might considering adding your script to http://code.google.com/p/mapnik-utils/ 
  since others might find it useful.

Stefan pasted his python/cherokee solution, so I'll offer mine too. I  
like to deploy TileLite using mod_wsgi, and for anyone interested the  
code can be found here:
http://bitbucket.org/springmeyer/tilelite/

I should stress though that Mod_tile is the optimal solution for tile  
rendering for most OSM related purposes.

> Anyway..
>
> I noticed that to generate a tile, a 512x512 pixel map is generated,
> which gets then cropped to 256x256 pixels and reduced to 255 colors by
> using  'convert'.
>

Given mapnik trunk (or the upcoming 0.6.0) a 'map.buffer_size' can now  
be used to help avoid cut labels instead of this view based approach. (http://trac.mapnik.org/browser/trunk/CHANGELOG#L64 
)


Cheers,

Dane




More information about the dev mailing list