Skip to content

Conversation

@ikgh9
Copy link

@ikgh9 ikgh9 commented Aug 8, 2025

I've added the HausdorffDistancePercentile class. The percentile parameter allows for neglecting the impact of a specified percentage of the largest distances, which are treated as outliers.
I need this algorithm to provide a more flexible way of comparing line geometries and finding the best match.

The algorithm is based on the one from the HausdorffDistance class. However, there is a significant difference in the distribution of densification points. For HausdorffDistancePercentile, it is crucial to distribute these points evenly along the geometry, in other words, the distance between them should be same/similar. In the HausdorffDistance class, the distribution is proportional to the subsegment length, since each subsegment is divided by the same number.

I didn’t want to modify the existing HausdorffDistance algorithm, so I placed the version with the percentile parameter in a separate class.

ikgh9 added 4 commits August 5, 2025 13:13
Signed-off-by: Aleksander Rubelek <[email protected]>
Signed-off-by: Aleksander Rubelek <[email protected]>
Signed-off-by: Aleksander Rubelek <[email protected]>
@ikgh9
Copy link
Author

ikgh9 commented Sep 3, 2025

Pinging @dr-jts for a review on this.

@ikgh9
Copy link
Author

ikgh9 commented Sep 16, 2025

Thanks for the review @dr-jts, please merge the changes

@ikgh9
Copy link
Author

ikgh9 commented Nov 25, 2025

@dr-jts

Hi Martin,

This is Aleksander from HERE Technologies.

These changes are important for improving the identification of corresponding line geometries from different data sources. The Hausdorff distance is a key metric in this process, but its sensitivity to outliers in low-quality datasets can lead to inaccurate matches. Applying a percentile-based threshold to the Hausdorff distance reduces the impact of extreme deviations and improves matching accuracy, as confirmed by our tests.

We kindly ask you to merge this PR.

Thanks,
Aleksander

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant