-
Notifications
You must be signed in to change notification settings - Fork 66
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
Conditionally use rsgeo::line_segmentize() if available #542
Conversation
Amazing. Will check it out now! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! Will have a quick play on this branch and maybe add another example or 2 but overall, huge 👍 and big thanks.
… JosiahParry-segment
Straight back at ya, minor changes suggested including exposing |
For some reason I get this note, not sure if it's new, but should add to the global allowed names I'm thinking to make checks happier:
|
That's after my changes... |
This is likely because there is a variable declared an unused? I won't be able to review for a few more hours. |
Merged 👍 |
Closes #522.
This PR speeds up
line_segment()
by utilizingrsgeo
. This only occurs when the package is installed (there is no prompting introduced in this PR as might be done usingrlang::check_installed()
), and the input geometry either has a missing CRS or is not a geographic CRS this is because rsgeo utilizes euclidean distance to segmentize. If there is a desire to use geodesic / haversine distance in a line_segmentize function, theres potential to add that upstream. However, its my understanding that most road network anlaysis is done on a fairly localized level which should be done using a projected CRS anyways! :)Further, this PR converts
line_segment()
into an S3 generic with ansf
andsfc_LINESTRING
method enabling people to work with only their geometries and not always have to have a data frame.rsgeo is added to the DESCRIPTION's
Suggests
field.Benchmark: