[OSM-dev] Gisify relations

Frederik Ramm frederik at remote.org
Fri Jun 12 13:33:32 BST 2009


Hi,

Andreas Kalsch wrote:
> 1) complete:
> 2) correct:
> 3) performant:

It strikes me as odd that someone who wants to write something complete, 
correct, and peformant should deal with OSM. Are you sure you have the 
right data for your philosophy, or the right philosophy for our data?

> I have solved nodes and ways, and I think the osm2pgsql script is the 
> best starting point to understand how the boundaries are exactly 
> working. 

Be warned though that osm2pgsql is not exactly a prime example of 
dealing with complex multipolygons.

> I am currently not sure how to interpret the linearrings, 
> because they can be made of several ways. But some polygons start with 
> "inner" and then comes "outer", so I don't know to which "outer" the 
> "inner"s belong to.

Simply construct rings out of all the members and then check inside 
which outer ring each inner ring lies. - There's always the danger of 
people creating intersecting inner and outer rings but of course that 
should not happen.

Check out this for more info:
http://wiki.openstreetmap.org/wiki/Relation:multipolygon

Also note that many people don't use multipolygon relations but instead 
if they want a hole in an area, they create two half-donut shaped areas. 
If you're so bent on correctness and completeness then you will have to 
detect such cases and form proper polygons with holes from them ;-)

Bye
Frederik





More information about the dev mailing list