match_pts_to_graph
Match spatial points to a spatial graph which contains vertex coordinates
match_pts_to_graph(verts, xy, connected = FALSE)
verts |
A |
xy |
coordinates of points to be matched to the vertices, either as
matrix or sf-formatted |
connected |
Should points be matched to the same (largest) connected
component of graph? If |
A vector index into verts
Other misc:
compare_heaps()
,
dodgr_flowmap()
,
dodgr_full_cycles()
,
dodgr_fundamental_cycles()
,
dodgr_insert_vertex()
,
dodgr_sample()
,
dodgr_sflines_to_poly()
,
dodgr_vertices()
,
match_points_to_graph()
,
merge_directed_graph()
,
summary.dodgr_dists_categorical()
,
write_dodgr_wt_profile()
net <- weight_streetnet (hampi, wt_profile = "foot") verts <- dodgr_vertices (net) # Then generate some random points to match to graph 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)) ) pts <- match_pts_to_graph (verts, xy) pts # an index into verts pts <- verts$id [pts] pts # names of those vertices
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.