Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add interpolated coordinate feature #847

Merged
merged 5 commits into from
Jun 18, 2022
Merged

Add interpolated coordinate feature #847

merged 5 commits into from
Jun 18, 2022

Conversation

urschrei
Copy link
Member

@urschrei urschrei commented Jun 17, 2022

  • I agree to follow the project's code of conduct.
  • I added an entry to CHANGES.md if knowledge of this change could be valuable to users.

This PR adds "densification" methods to all geometries with linear components (Line, LineString, Polygon, MultiLinestring, MultiPolygon). The algorithm works on line segments, "densifying" them by adding additional segments with length max_distance between the existing line endpoints, producing a new LineString.

Actual logic: https://github.com/georust/geo/pull/847/files#diff-1e6b7ec38d282e44d7225459b81fa17d1ca9b7529763d44d0550c303077f6826R29-R46

Fixes #846

Copy link
Member

@michaelkirk michaelkirk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than re-exporting Densify in geo::algorithms, LGTM!

(remaining feedback should be considered optional)

Thanks for jumping on this so quickly.

geo/src/algorithm/line_interpolate_point.rs Outdated Show resolved Hide resolved
geo/src/algorithm/line_interpolate_point.rs Outdated Show resolved Hide resolved
geo/src/algorithm/line_interpolate_point.rs Outdated Show resolved Hide resolved
geo/src/algorithm/line_interpolate_point.rs Outdated Show resolved Hide resolved
geo/src/algorithm/line_interpolate_point.rs Outdated Show resolved Hide resolved
geo/src/algorithm/line_interpolate_point.rs Outdated Show resolved Hide resolved
@urschrei
Copy link
Member Author

Thanks for the quick review @michaelkirk. I think that's all the suggestions implemented…PTAL

I'd like to contrive a Polygon test, so feel free to approve if you're happy and I'll add and merge tomorrow.

Copy link
Member

@michaelkirk michaelkirk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all LGTM, though it seems like there's no reason to modify geo-bool-ops-benches/rust-geo-booleanop-fixtures.json right?

@urschrei
Copy link
Member Author

No idea how that happened…will revert.

@urschrei
Copy link
Member Author

bors r=michaelkirk

@bors
Copy link
Contributor

bors bot commented Jun 18, 2022

Build succeeded:

@bors bors bot merged commit 8db1830 into georust:main Jun 18, 2022
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.

Feature Request: Add points to linestrings in equidistance
2 participants