Skip to content
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

Self-Loop creation after bNode #1

Open
carl-mc opened this issue Jan 2, 2019 · 0 comments
Open

Self-Loop creation after bNode #1

carl-mc opened this issue Jan 2, 2019 · 0 comments

Comments

@carl-mc
Copy link

carl-mc commented Jan 2, 2019

For some reason, bNode adds 0-length lines to a grid where there should be none. I remember that we had discussed that issue back in December 2017 and didn't find the error -- I will have another look when I have the time. Quick and dirty solution lies in igraph::simplify. All the best and many thanks for all the help, Carl

library(BoostLines)
library(raster)
r <- raster(ext = extent(c(0,1,0,1)), res = 1/7)
grid.bl <- BoostLines::bGrid(r, n8 = TRUE)

g <- boost2graph(x = node.ls[[1]], df = data.frame(rep(1, length(node.ls[[1]]))),
lonlat = TRUE, plot.result = F)

plot(g, vertex.size = 0.25, vertex.label = NA, layout = as.matrix(cbind(V(g)$x, V(g)$y)))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant