geos icon indicating copy to clipboard operation
geos copied to clipboard

Surface the chosen points in the C API (and threadsafe C API) for `GEOSHausdorffDistance` and `GEOSHausdorffDistanceDensify`

Open markt-latai opened this issue 1 month ago • 1 comments

The discrete Hausdorff distance class in include/geos/algorithm/distance/DiscreteHausdorffDistance.h when used to compute the Hausdorff distance populates a point pair distance and includes the ability to retrieve the pair of points used to compute the Hausdorff distance metric with getCoordinates, but this function is not surfaced through the C API.

This issue requests surfacing of that functionality. Some suggested avenues:

  1. Add a PointPairs struct to the C API and a corresponding PointPairs* points argument to GEOSHausdorffDistance and GEOSHausdorffDistanceDensify. If that pointer is non-null, return the chosen points.
  2. (To maximize backwards compatibility) similar to (1), but add two new functions, GEOSHausdorffDistanceWithPoints and GEOSHausdorffDistanceDensifyWithPoints, which include (required non-null) pointer to the PointPairs structure.
  3. As (2), but instead of a PointPairs struct, GEOSHausdorffDistanceWithPoints and its counterpart densify function take four additional pointers to doubles: pt1_x, pt1_y, pt2_x, and pt2_y.

markt-latai avatar Nov 17 '25 22:11 markt-latai

I'd lean towards option 3.

dbaston avatar Nov 19 '25 19:11 dbaston