Open agila5 opened 2 years ago
One question: since the network is recreated with as_sfnetwork
this would also connect edges that share an interior point right, like to_spatial_subdivision
does? I am not sure if that is expected or not
I see the name comes from PostGIS, but I think to_spatial_segmentation
would be clearer, considering our other morpher names
I see the name comes from PostGIS, but I think to_spatial_segmentation would be clearer, considering our other morpher names
Fixed
One question: since the network is recreated with as_sfnetwork this would also connect edges that share an interior point right, like to_spatial_subdivision does? I am not sure if that is expected or not
Do you mean something like the following example?
# packages
library(sf)
library(tidygraph)
library(sfnetworks)
# data
my_sfc <- st_sfc(
st_linestring(rbind(c(-1, 0), c(0, 0), c(1, 0))),
st_linestring(rbind(c(0, -1), c(0, 0), c(0, 1)))
)
my_sfn <- as_sfnetwork(my_sfc)
my_sfn1 <- convert(my_sfn, to_spatial_segmentation, .clean = TRUE)
# plot
par(mfrow = c(1, 2), mar = rep(0, 4))
plot(my_sfn)
plot(my_sfn1)
Created on 2022-09-08 by the reprex package (v2.0.1)
We can notice that the morpher creates a new "link" between the existing edges (i.e. the new dot in the middle of the map).
I'm not 100% sure that this is expected but:
to_spatial_subdivision
morpher before this other morpher (and this is particularly relevant for OSM data); Patch coverage: 25.00
% and project coverage change: -0.63
:warning:
Comparison is base (
d3374b5
) 67.92% compared to head (befbf31
) 67.29%.:exclamation: Current head befbf31 differs from pull request most recent head 5fb61a6. Consider uploading reports for the commit 5fb61a6 to get more accurate results
:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Showcase of the new spatial morpher:
Created on 2022-06-08 by the reprex package (v2.0.1)
I know that the approach is not perfect (since we could also infer the new nodes without running
as_sfnetwork()
again), but I think it's good enough for the moment. If you don't have any particular comments, I will add examples and tests as soon as possible.cc @mkvasnicka