songjiahong/Geo.Library

How to check if a point is in a Multipolygon

Closed this issue · 4 comments

Hi,

Do you have any thoughts on how I can use the library to check if a point is within a multipolygon?

Thanks
Scott

You can go through each polygon in the multipolygon and check whether the point is in the polygon with the function Polygon.IsPointInside(Point point)

Thanks I will give that a go.

I think I might have to take into account this sort of multi polygon though outer and inner

@meyumeapps The outer-inner case is correctly handled (see

[InlineData(30, 17, true)] // inside polygon
). So if you check each point in a loop, the issue could be resolved.

Add a method in multipolygon to check whether point is inside.