Utilizing to_spatial_smooth on a directed network #236
-
I am facing an issue with removing pseudo nodes from a directed road network. I have a road dataset with a significant number of pseudo nodes at areas where road characteristics change (change of speed limit, number of lanes, etc.). I have implemented the instructions in this vignette (https://cran.r-project.org/web/packages/sfnetworks/vignettes/sfn02_preprocess_clean.html) to create a directed network with two-way and one-way streets. However, a problem arises when I try to remove these pseudo nodes on this directed network. Since, in many situations, these pseudo nodes take place on a part of the network that has two edges (because it is a two-way street), even though this is not a true intersection, to_spatial_smooth does not remove them. I have provided a simplified example below. Any suggestions on how to address this?
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Interesting, I had not thought about this. In principle, the smoothing does perform as expected (since the "non-intersection" node does have two incoming and two outgoing edges, and hence is correctly not detected as being a pseudo node). But I do see that in this case, with a network containing both oneway and two-way streets, it should in practice be treated as a pseudo node. I'll try to think of a flexible solution. |
Beta Was this translation helpful? Give feedback.
-
From sfnetworks v1.0, you can work around this by first creating the network, cleaning it, and only then creating the "mixed network" (i.e. the network with both directed and undirected edges through the duplicate-and-reverse workflow) using the new morpher as_sfnetwork(roxel) |>
convert(to_spatial_smooth) |>
convert(to_spatial_mixed, directed = oneway) |
Beta Was this translation helpful? Give feedback.
From sfnetworks v1.0, you can work around this by first creating the network, cleaning it, and only then creating the "mixed network" (i.e. the network with both directed and undirected edges through the duplicate-and-reverse workflow) using the new morpher
to_spatial_mixed()
: