Description Usage Arguments Details Value See Also Examples
This function simplifies a Konigsbergr graph by reducing the graph to a simpler representation where intersections are directly connected by straight edges.
1 | simplify_konigsbergr(graph, preserve_bridges = TRUE)
|
graph |
A Konigsbergr graph created from |
preserve_bridges |
Boolean. Preserve full bridge geometry? |
This reduces to a simple, undirected graph, so note that the distinction
between two-way and one-way roads will be discarded. The sum of the total
distances of the removed edges are maintained, however. The real-world road
distance in meters along an edge will be saved in the distance
edge
attribute of the new graph.
A simple, undirected igraph
object.
This function relies on the simplify_topology() function from the pathfinder package.
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
boston_konigsbergr <- konigsberg_graph(boston)
boston_sf <- graph_to_sf(boston_konigsbergr)
plot(boston_sf$edges["geometry"])
simple_boston <- simplify_konigsbergr(boston_konigsbergr)
simple_boston_sf <- graph_to_sf(simple_boston)
plot(simple_boston_sf$edges["geometry"])
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.