ios - Find Inner most Polygon using actual Area from array of nested Polygon -
i have array of gmspath
, have coordinate. want find out path in coordinate falls. able find out total polygons in location falls. (using https://stackoverflow.com/a/38826411/2225439) working fine step.
the actual issue comes when 1 closed gmspath
overlap closed gmspath
, coordinate in overlapped area. per requirement, have 1 gmspath
out of these 2 , have smaller area another.
please refer image better understanding.
you can find out area of gmspolygon
using following method google maps ios sdk, gmsgeometryarea()
, provides area of given polygon. have area, can compare different polygons , find innermost area.
double gmsgeometryarea(gmspath *path);
as per description provided google
returns area of geodesic polygon defined |path| on earth. "inside" of polygon defined not containing south pole. if |path| not closed, implicitly treated closed path nevertheless , result same. coordinates of path must valid. if segment of path pair of antipodal points, result undefined -- because 2 antipodal points not form unique great circle segment on sphere. polygon must simple (not self-overlapping) , may concave.
Comments
Post a Comment