mapbox / mapbox-unity-sdk

Mapbox Unity SDK - https://www.mapbox.com/unity/
Other
725 stars 210 forks source link

PointInPolygon should take a List<Point2d>, not List<List<Point2D>> #1873

Open artoonie opened 2 years ago

artoonie commented 2 years ago

See: https://docs.mapbox.com/mapbox-unity-sdk/api/unity/Mapbox.Utils.PolygonUtils.html

It seems like PointInPolygon should take List, not List<List>. Indeed, the first thing that function does is just grab the first element. Is there a good reason to take a List of Lists, instead of just a List?

brnkhy commented 2 years ago

I think the original idea there was to use it to check for polygon features instead of just abstract polygons. and building features are lists of lists where the first list is the outline and the following lists are holes. so method header is written to take holes into account, method code....is not :(