-
Notifications
You must be signed in to change notification settings - Fork 21
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
Functions to snap points to nodes or edges #25
Comments
See also how the |
|
Ah, yes, I remember now we also used |
Yes it's a great figure, we need more good visuals like that. Good point. |
Hi all. In the |
This topic was getting a little bit scattered. There are now separate issues:
|
Is your feature request related to a problem? Please describe.
It would be nice to have a function that takes a (set of) spatial point(s), either as
sf
,sfc
orsfg
, and snaps them to the nearest node or nearest edge. In that way you can provide any spatial point to a shortest path query, no matter if it lies exactly on the network or not.Describe the solution you'd like
A function
st_snap_point_to_node
that replaces the geometry of the given point by the geometry of the nearest node, and a functionst_snap_point_to_edge
that replaces the geometry of the given point by the nearest point on the nearest edge. The first can simply use sf'sst_nearest_feature
(or st_nearest_node if we implement that), the latter can use sf'sst_nearest_points
to find the nearest point on the nearest edge.Probably these functions will need a
tolerance
argument, likest_snap
in sf.The text was updated successfully, but these errors were encountered: