[OSM-dev] Gisify relations

Andreas Kalsch andreaskalsch at gmx.de
Fri Jun 12 13:58:44 BST 2009


Frederik Ramm schrieb:
> 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?
Correct. I am already into OSM for over a year and I know that those 
points are just ideals.
It's somewhere in between. "As much philosophy as necessary" to get "as 
much data as possible".
Without this chaos OSM wouldn't be where it is now. But more well-tuned 
robot scripts to force some data into order would be a good idea.
>> 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.
This is the point. It seems that the order of ways does not matter. So 
to simply connect all equal endpoints to get rings instead of relying on 
the new tagging scheme is currently a better practice ...
>
> Check out this for more info:
> http://wiki.openstreetmap.org/wiki/Relation:multipolygon
I have added some ramblings some time ago to the discussion - but that 
was another issue.
>
> 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 ;-)
There are many cases which are so odd (e.g. ways with tags instead of 
relations) that I will just ignore them. I want to focus on the most 
frequent and logical cases.

;-)




More information about the dev mailing list