Which outer polygon does an inner polygon go inside?

Hi, in a relation there are member ways with a role of outer or inner. There can be more than one outer polygon defined within a relation. Is it safe to assume that ways marked as inner members are inner to the immediately proceeding outer members when listed in the relation?

For example, if I have two islands and each has an internal body of water, when I read down the list of members for the relation, will the outer members of one island come first, then the inner members, followed by the second islands outer members and then the second island’s inner members?

Or to be really sure, do I have to do a spatial query to determine which outer polygon an inner member is in?

Best, Chessel

1 Like

I don’t think so. I’ve never mapped this way and I’ve never seen such a requirement.

2 Likes

No. It’s up to the applications to figure this out.

Best is to use one relation for one polygon.

Hi, I was worried that was going to be the answer.

This isn’t precisely the scenario I gave earlier but Spain relID=1311341 has 630 or so outer way members and 5 inner ways. I think there are 13 polygons detailed by the outer ways.

I’m looking to create geometric polygon objects in Spatialite which consist of an outer ring plus any inner rings.
So I will need to create the outer polygons, then create the inner polygons, then do a spatial in-polygon test to work out which outer polygons the inner ones go in. Then add the inner polygons to the outer polygon objects.

Or is there an easier way?

Best, Chessel

It is perfectly fine to have a multipolygon that has more than one outer way (aka outer ring).

No, you have to do a spatial query to determine which outer way the inner way is inside.

3 Likes

True, but in the case of unnamed objects (e.g. landuse) this can often be simplified to several (multi)polygons with a single outer ring for each.

Also, relations are not categories, so we shouldn’t put e.g. all meadows within an administrative boundary into a single multipolygon, regardless if it fits within the OSM data model.

1 Like