geos icon indicating copy to clipboard operation
geos copied to clipboard

Curved geometries: Implement length, area, point-in-polygon testing

Open dbaston opened this issue 1 year ago • 0 comments

This PR extends implements getLength() and getArea() methods for curved geometry types. It also extends SimplePointInAreaLocator and RayCrossingCounter to handle rings defined by a combination of line segments and circular arcs (as in CompoundCurve geometries).

The PIP functionality is not yet exposed in the Geometry API. This could either be done by adding a special case to Geometry::intersects or by allowing PreparedGeometry to be constructed from curved geometries. To do this, IndexedPointInAreaLocator would also need to support curved geometries. I'm not sure if this is actually useful for real datasets that use curved geometries, which I'd imagine to more commonly be smaller regions like tax parcels rather than the large polygons that drive the need for IndexedPointInAreaLocator.

The RayCrossingCounter work relies on computing the intersection points between arcs and a horizontal ray so it is not as robust as the linear version, but it should be an improvement over the alternative of linearizing the arcs.

dbaston avatar Jun 14 '24 12:06 dbaston