[OSM-dev] [OSM-talk] tiles rendering
Artem Pavlenko
artem at pavlenko.uklinux.net
Fri Feb 2 17:29:17 GMT 2007
Hello,
I've been thinking about improving the rendering of coastlines, and here is
what I came up with. Originally I was hoping to have one script that could be
run on Global Shoreline data and output boundary polygons. Unfortunately the
dataset has got too many broken geometries etc etc and it does
require 'human' interaction to fix them.
So here is how I solved this. I devided the world into 100x100km tiles. For
each tile I ran 'overlay' query and stored the results (LineStrings +BBOX
polygon ).
This is how it looks:
http://media.mapnik.org/osmturk.png
http://media.mapnik.org/osmturk-2.png
Then using JUMP 1.2 (http://www.vividsolutions.com/JUMP/) it is possible
to 'polygonize' linestrings , remove 'water' polygons and output
nice 'clean' polygons ready to go:
http://media.mapnik.org/osmturk-3.png
The results are quite good and make nice maps :
http://media.mapnik.org/coast.jpg
The whole process is pretty straight forward and requires just a few mouse
clicks. Think 'mechanical turk'!
I reckon three-four people could create UK boundaries in a couple of hours.
Anyone in the Oxford area fancy meeting up for a beer at coastlines event this
weekend?
Cheers,
-- Artem
On Wednesday 31 January 2007 23:11, Jon Burgess wrote:
> On Wed, 2007-01-31 at 22:36 +0000, Jon Burgess wrote:
> > On Wed, 2007-01-31 at 21:43 +0000, Artem Pavlenko wrote:
> > > Yes, good idea. We should only output 'closed' polygons
> > >
> > > if (polygon && start_point == end_point)
> > > {
> > > ...
> > > }
> > > else
> > > {
> > > ..
> > > }
> > >
> > > Artem
> >
> > That didn't seem to make any difference.
> >
> > It seems the issue is in osm.xml. The PolygonSymbolizer will render any
> > data as a polygon, even if the source data is a linestring :-). This
> > attached patch makes things look much better in my eyes. The style may
> > need more tweaking.
> >
> > The data I have loaded in postgis currently is from the "open areas are
> > not polygons" version of osm2pgsql currently so I can't be 100% certain
> > that this style change alone fixed it, but i'm quite confident the
> > osm.xml change is sufficient.
> >
> > Please try it out on your system and see if it fixes the grey
> > triangulated coastline.
> >
> > Jon
>
> I found some issues with the last patch, I think this one renders more
> cleanly at all zoom levels. It treats all natural= the same as
> waterways, i.e draws as a blue line for the coastline.
>
> The only downside I see with this is that natural=water no longer gets
> filled, you'll just get a blue outline. This may effect ponds, lakes
> etc.
>
> Perhaps natural=water should be rendered as a polygon but I don't
> understand the mapnik rule/scale/filter/else model well enough to make
> the rendering work reliably at all zooms.
>
> Jon
More information about the dev
mailing list