[OSM-talk] fixing multipolygons

Jon Burgess jburgess777 at googlemail.com
Sun Mar 9 18:38:08 GMT 2008


On Sun, 2008-03-09 at 18:42 +0100, Martijn van Oosterhout wrote:
> On Sun, Mar 9, 2008 at 5:58 PM, Jon Burgess <jburgess777 at googlemail.com> wrote:
> >  It just so happens that the existing multipolygon handling code in
> >  osm2pgsql will convert these ways into a closed area for the Mapnik
> >  rendering. I can not remember whether this was by accident or design but
> >  it would be nice not to lose these areas.
> 
> FWIW, it was pointed out to me today that osm2pgsql actually creates
> invalid geometries, presumably via this relation parsing (I havn't had
> a chance to track it down). If you do:
> 
> # select count(*) from planet_osm_polygon where not  isvalid(way);
> 
> You get 138 for just the NL portion of the planet dump. The errors are
> a combination of:
> 
> NOTICE:  Self-intersection
> NOTICE:  Hole lies outside shell
> NOTICE:  Ring Self-intersection
> 
> The first being the most common. It's probably stupid errors but maybe
> it's stuff that will be fixed at the same time.

I think many of these are due to bad OSM data. Historically osm2pgsql
has just ignored or silently fixed up minor data errors. I'm wondering
whether instead it should emit a list of the problems. 

These could be turned into an HTML file with generated API and map links
to view or download the data. I know there are some other tools which
perform similar functions but I guess they are not being run on the
whole planet dump every week.

	Jon






More information about the talk mailing list