-
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
Apply to_spatial_smooth without merging different fields #124
Comments
Yes, I did implement it in an early function of to_spatial_smooth, but it was not working good and also very slow. Therefore it did not make it to master. Is your request generalizable to "only consider a node to be a pseudo node when all attributes of its incident edges are equal?", or do you specifically want to select only a subset of attributes to compare? Either way we should implement this when defining which nodes are pseudo nodes, i.e. here. Now the definition is: a node is a pseudo node if it has one incoming and one outgoing edge (or simply two incident edges in the case of undirected network). That should in your case then be changed to: a node is a pseudo node if it has one incoming and one outgoing edge (or simply two incident edges in the case of undirected networks) and the attributes of these two edges are equal. Right? I am not sure however what the most efficient way is to check this equality of attributes. |
Hi @luukvdmeer and thanks for the answer.
Yes, exactly. I'm not sure either, but I will try writing some code during the weekend (or sometimes next week)!
I think that the best approach would be creating a new parameter for selecting a subset of fields that should be used for testing "equality" of the edges, but I'm ok with both scenarios. |
What about the info we don't need for the merging of "pseudo-nodes", but that would be useful after the merge? I see that with other types of morphs, such as Would it be possible to include that in |
I really don't know how exception handling control flow works in R. Would it be possible to add a It looks like that kind of implementation would play insanely badly with vectorized operations, but maybe it can serve as inspiration on how to solve both |
Implemented in v0.6.0 through arugment |
Is your feature request related to a problem? Please describe.
I'd like applying the
to_spatial_smooth
morpher taking into account the value of one or more fields in the edges table. I think this is useful for statistical models with OSM data since, usually, I'd like removing the pseudo nodes (to simplify the network structure) without merging road segments with differenthighway
types. I'm not 100% sure but I think that this "feature" was already discussed but, at the moment, I cannot find the proper reference.Describe the solution you'd like
For example:
Created on 2021-02-10 by the reprex package (v0.3.0)
The second and the third edges should be merged (since they have the same
type
), while the first edge should remain separated from the other ones.The text was updated successfully, but these errors were encountered: