[OSM-dev] (Multi)Polygon handling

Even Rouault even.rouault at mines-paris.org
Fri Jul 13 14:24:47 BST 2012


Hi

> That sounds reasonable. But we need to agree on what is valid and what is
> treated as invalid. In the testsuite of closed ways that I commited to
> github I defined an output for every case, but I'm not sure if the inputs
> are valid. My guess would be:

> 1) Definitely valid

OK

> 2) valid

Why do you need to reverse the winding order ? I thought that the WKT convention
did not say anything about that, or did I miss something ? (Winding order is
indeed significant in shapefiles, but that's another story). So I'd say it is up
to the rendering engine to do any transformation that is needed for correct
rendering according to the filling algorithm it uses.

> 3-5 not sure
> 6) invalid
> 7) valid
> 8) not sure
> 9) invalid
> 10) valid
> 11,12) invalid

I think I disagree with all those ones ;-) For me, a way is a LINESTRING or a
POLYGON with a single ring. I'd take it unmodified. And if it needs more clever
transformations, then IMHO, the way (in the database) should be splitted into
multiple ones that aren't degenerated.

My perception was that the only part that need some thinking is when building a
MULTIPOLYGON from multiple ways referenced by a relation ( bascially what is
described in http://wiki.openstreetmap.org/wiki/Relation:multipolygon ). But I'm
definitely not an expert on OSM specificities, so you can prove me wrong :-)

Best regards,

Even



More information about the dev mailing list