Skip to contents

This function creates a line graph where nodes represent the midpoints of links in the input network.

Usage

create_line_graph(network)

Arguments

network

A road_network or segmented_network object.

Value

A igraph object representing the midpoint graph.

Examples

# Create a road network
network <- create_road_network(sample_roads)
#> Warning: CRS is missing. Returning the input object without transformation.

# Plot the road network
plot(network$graph)


# Create a midpoint graph from a road network
graph <- create_line_graph(network)

# Plot the midpoint graph
plot(graph)