Open mkoohafkan opened 4 years ago
Hello, do you have any idea how to avoid the wrapping effect? The resulting network seems to link easternmost to westernmost cells.
@gvanhavre not sure what you mean, I don't get those connections with the example I posted. Are you using a geographic coordinate system or a projected coordinate system? If you are using a geographic (latitude/longitude) coordinate system that may be causing the issue since adjacency()
may treat the raster surface as sphere in that case.
library(ggraph)
coords = select(as_tibble(g, "nodes"), x ,y)
ggraph(g, layout = "manual", circular = FALSE, x = coords$x, y = coords$y) +
geom_node_point() +
geom_edge_link()
Sorry, my mistake. For some reason I'm still trying to understand, the network was folding in some troubling Lorenz' strange attractor pattern. In fact, I'm trying to use nodes values as edges values, in order to calculate multiple Least-Cost Paths.
Comments on https://hydroecology.net/generating-networks-from-rasters-with-r/