Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

All interior rings are treated as holes #17

Open
timonmasberg opened this issue Feb 8, 2022 · 4 comments
Open

All interior rings are treated as holes #17

timonmasberg opened this issue Feb 8, 2022 · 4 comments
Assignees

Comments

@timonmasberg
Copy link

if int.ContainsCoord(c) {

Not all interior rings have to be holes. When an interior ring intersects another interior ring, the intersection is not treated as a hole.

Simple example:

image

{ "type": "Feature", "properties": {}, "geometry": { "type": "Polygon", "coordinates": [ [ [ 14.897460937499998, 27.21555620902969 ], [ 8.26171875, 19.932041306115536 ], [ 23.90625, 15.792253570362446 ], [ 14.897460937499998, 27.21555620902969 ] ], [ [ 14.1064453125, 24.246964554300924 ], [ 19.2041015625, 17.769612247142653 ], [ 11.1181640625, 19.89072302399691 ], [ 14.1064453125, 24.246964554300924 ] ], [ [ 13.9306640625, 21.94304553343818 ], [ 13.095703125, 20.46818922264095 ], [ 16.611328125, 19.02057711096681 ], [ 13.9306640625, 21.94304553343818 ] ] ] } }

@thisisaaronland
Copy link
Member

Thanks for this, you are correct.

Have you found a situation where this occurs in practice? We should account for this regardless but I am pretty sure we didn't (account for it up front) on the grounds that it almost never happens in the context of WOF-related features.

@timonmasberg
Copy link
Author

e.g. https://spelunker.whosonfirst.org/id/85682555/

If the point is within Bremen, we will receive Lower Saxony as a hierarchy member. Maybe it is a tradeoff one has to take, since i believe that checking for holes might be expensive.

@thisisaaronland
Copy link
Member

Ah, good to know. I will investigate this in the next day or two.

Thanks for the report.

@thisisaaronland thisisaaronland self-assigned this Feb 8, 2022
@nvkelso
Copy link
Member

nvkelso commented Feb 9, 2022

Here's an example in the USA:

https://spelunker.whosonfirst.org/id/102084863/

Where Fairfax city is within Fairfax county (both county-level admin, because Virginia), and the "county" courthouse in the "city" is legally the county not the city.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants