You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, @bagusflyer! Unfortunately there is no API method to do that. But I think it should be as simple as calculating "average" among all of Polygon's coordinates.
The iOS map SDK (until v10) has an MGLPolyline.coordinate property that’s very useful for this purpose. Under the hood, it relies on Polylabel, a C++ implementation of the pole-of-inaccessibility algorithm (equivalent to ST_MaximumInscribedCircle in PostGIS). There are other centroid algorithms, but the pole of inaccessibility algorithm yields very good results overall. Now that iOS map SDK v10 relies on Turf for geometric functionality, it’s going to be more important that Turf provides some sort of centroid functionality equivalent to previous map SDK releases.
Is there a way to get the center of the polygon by using
turf-swift
?The text was updated successfully, but these errors were encountered: