simplify_konigsbergr: Simplify a Konigsbergr Graph for Network Analysis

Description Usage Arguments Details Value See Also Examples

View source: R/networking.R

Description

This function simplifies a Konigsbergr graph by reducing the graph to a simpler representation where intersections are directly connected by straight edges.

Usage

1
simplify_konigsbergr(graph, preserve_bridges = TRUE)

Arguments

graph

A Konigsbergr graph created from konigsberg_graph().

preserve_bridges

Boolean. Preserve full bridge geometry?

Details

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.

Value

A simple, undirected igraph object.

See Also

This function relies on the simplify_topology() function from the pathfinder package.

Examples

 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)

dSHARP-CMU/konigsbergr documentation built on Sept. 11, 2019, 3:55 p.m.