graph <- weight_streetnet (hampi, wt_profile = "foot")
dim (graph)
verts <- dodgr_vertices (graph)
set.seed (2)
npts <- 10
xy <- data.frame (
x = min (verts$x) + runif (npts) * diff (range (verts$x)),
y = min (verts$y) + runif (npts) * diff (range (verts$y))
)
graph <- add_nodes_to_graph (graph, xy)
dim (graph) # more edges than original
Run the code above in your browser using DataLab