georust / geo

Geospatial primitives and algorithms for Rust
https://crates.io/crates/geo
Other
1.51k stars 195 forks source link

Add Hausdorff Distance trait #1041

Closed JosiahParry closed 1 year ago

JosiahParry commented 1 year ago

This PR adds a new trait HausdorffDistance which is implemented for all geometries.

This is my first Rust library PR so I'll need some guidance getting this through the finish line!

Outstanding questions for maintainers:

JosiahParry commented 1 year ago

@frewsxcv thanks! I've added a note in the documentation that it uses euclidean distance. Is this explicit enough?

https://github.com/JosiahParry/geo/blob/1c44e3b5578b4e2af24bf3755827ca2b87c7e2eb/geo/src/algorithm/hausdorff_distance.rs#L9-L10

I've also added a handful of tests as well. Please let me know if this is sufficient or if there ought to be exhaustive tests (every combo of geometry types).

JosiahParry commented 1 year ago

I've pushed a commit that addresses formatting using cargo fmt.

JosiahParry commented 1 year ago

I've added a note to the changelog. Please let me know what else is needed to close this PR. Thanks! :)

michaelkirk commented 1 year ago

bors r+

bors[bot] commented 1 year ago

This PR was included in a batch that successfully built, but then failed to merge into main. It will not be retried.

Additional information:

Response status code: 422
{"message":"Changes must be made through the merge queue","documentation_url":"https://docs.github.com/articles/about-protected-branches"}
michaelkirk commented 1 year ago

bors retry

Whoops. My bad I think. Let's try again now that I have (for real this time) disabled the merge queue.

bors[bot] commented 1 year ago

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here. For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

michaelkirk commented 1 year ago

Thanks!

JosiahParry commented 1 year ago

Thank you!