[OSM-talk] Making the sea blue in mapnik [getting there]

Martijn van Oosterhout kleptog at gmail.com
Sun Nov 4 09:20:36 GMT 2007


On 11/3/07, Jon Burgess <jburgess777 at googlemail.com> wrote:
> A single polygon for a very large area (e.g. UK, or Europe) will have an
> enormous number of points. This makes it really inefficient to determine
> whether a given point is inside or outside the polygon.

Well, mapnik only needs to draw it, the bounding box indicates if it
needs to. It's true that drawing a polygon of a few hundred-thousand
vertices take a while...

> What Artem did with the existing shoreline_a.shp was to slice up the
> polygons along a square grid. The number of point within a single square
> is quite small and is much more efficient for Postgis & Mapnik to
> operate with.

I was planning on doing this but had no idea what size grid to use.
Any suggestions? 0.1x0.1 degree polygons would be too small, there be
millions of them. On the other hand, rectangular polygons would be
quick to draw, no matter what their size. Which suggests small polygon
near coastlines and large polygons inside the landmass.

> Artem: Is there an tool available to create tiled polygon like you did
> with shoreline_a.shp?

Perhaps there is a solution for this already, but otherwise I'll just
have to write one...

Have a nice day,
-- 
Martijn van Oosterhout <kleptog at gmail.com> http://svana.org/kleptog/




More information about the talk mailing list