Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented Polygon.Contains(Coordinate ) method #18

Closed
wants to merge 1 commit into from

Conversation

asapostolov
Copy link

Implemented the Polygon.Contains method described here

http://alienryderflex.com/polygon/

Also made some Tests for it.

If you need to see the polygon which I test against you can check it out with this script https://gist.github.com/asapostolov/35bb3e03b7f5dedaa000

Please review the code and share your thoughts.

@sibartlett
Copy link
Owner

Hi, thank you for the pull request.

Unfortunately I can not merge it. The algorithm you have implemented is for polygons on a 2D plane.

As Geo specializes in geometries on a Earth-like spheroid or sphere - we'd ideally need an algorithm that takes that into account, and as part of that it would also need to support polygons that intersect with the poles or date line.

I've been meaning to look at Google's s2 geometry library, which we may be able to use for some inspiration. However we'd need to be careful as I am not sure if the Apache license is compatible with the LGPL license.

@asapostolov
Copy link
Author

Hey, thanks for the feedback.

I'll take a look at the s2 library. On first glance it seems that there are lot of things going on in there.

I'll think about how can we translate the algorithms in there to fit our cases.

@sibartlett sibartlett closed this Jan 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants