Hi all,
I'd like to extend the usability of the Hausdorff discrete distance calculation to make it able to use a percentile parameter. The Hausdorff Distance with the percentile parameter gives ability to set a threshold for the outliers and therefore
to achieve more suitable geometry comparison.
Hausdorff Distance vs. Hausdorff Distance with percentile parameter:
For each point of first geometry, we calculate distance to the closest point of the second geometry. Then we do the same for each point of the second geometry. Having a set of calculated distances we can take the biggest value, which is
a Hausdorff Distance (HD). The HD with a percentile parameter set to 95 (HD95) means that from the mentioned set we take a distance for which 95% of all distances in the set are lower or equal. Therefore, HD100 is equal to the HD, and HD0 is the shortest distance
connecting two geometries. For short and simple geometries (with small amound of geometry points) HD and HD95 can be equal. It is crucial to give the user ability to properly and equally densify the geometry points which should also be parametrized.
It's quite common to use the percentile parameter at level of 95 to neglect an impact of 5% of biggest distances which are treated as outliers.
What I'd like to do is to extend the org.locationtech.jts.algorithm.distance.DiscreteHausdorffDistance class by adding a method to calculate HD with a percentile parameter. I thing it would be a valuable contribution to the jts library.
According to the instructions in CONTRIBUTING.md I'm asking for a confirmation that it's an acceptable contribution.
Best regards,
Aleksander