Also add the possibility to create a LineString using Point objects.
Polygon has currently a few limitations that we can address later:
Only shell vertices can be provided (no holes)
The order of vertices is always normalized (in S2Geometry a S2Loop is oriented CCW in order to unambiguously define its interior but S2Geometry provides a method to automatically normalize the order by checking whether the area inside the loop is greater than 1/2 sphere). For performance reasons we might want to expose an option to skip this normalization.
The validity of the polygon (loop) is always checked, but again sometimes we might want to skip this check for performance reasons.
S2Geography actually provides constructor classes with such check and oriented options. Maybe we can simply reuse it, although these classes return a unique pointer to the Geography base class which may make things a bit more complicated on the spherely side.
Also add the possibility to create a
LineString
usingPoint
objects.Polygon
has currently a few limitations that we can address later:S2Loop
is oriented CCW in order to unambiguously define its interior but S2Geometry provides a method to automatically normalize the order by checking whether the area inside the loop is greater than 1/2 sphere). For performance reasons we might want to expose an option to skip this normalization.S2Geography actually provides constructor classes with such
check
andoriented
options. Maybe we can simply reuse it, although these classes return a unique pointer to the Geography base class which may make things a bit more complicated on the spherely side.