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

Point within Polygon? #107

Open
alienatorZ opened this issue Apr 13, 2020 · 5 comments
Open

Point within Polygon? #107

alienatorZ opened this issue Apr 13, 2020 · 5 comments

Comments

@alienatorZ
Copy link

I dont see a function for finding whether a point is within a polygon. Am I missing it, or can I request it be added to the API.

Thanks

@gdey
Copy link
Member

gdey commented Apr 13, 2020

You are not missing anything. Yes, you can request it to be added. What are you looking for the function to do? Should it support more than just polygons. A detail write up would be great!

Thank you.

@gdey
Copy link
Member

gdey commented Apr 13, 2020

@ear7h pointed out: https://godoc.org/github.com/go-spatial/geom/planar/intersect#Ring.ContainsPoint

Which may be a good starting point for an interface for something like this.

@alienatorZ
Copy link
Author

alienatorZ commented Apr 13, 2020

Yes I was thinking a function such as: Polygon.Contains(geom Geometry) bool {}

That way if any part of the passed in geometry was within the polygon it would cause the function to return true or else false.

@alienatorZ
Copy link
Author

Or you could say the passed in geometry would have to be fully in to return true which is probably better.

@missinglink
Copy link

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

No branches or pull requests

3 participants