Learn R Programming

dodgr (version 0.4.2)

dodgr_to_sf: Convert a dodgr graph into an equivalent sf object.

Description

Works by aggregating edges into LINESTRING objects representing longest sequences between all junction nodes. The resultant objects will generally contain more LINESTRING objects than the original sf object, because the former will be bisected at every junction point.

Usage

dodgr_to_sf(graph)

Value

Equivalent object of class sf.

Arguments

graph

A dodgr graph

See Also

Other conversion: dodgr_deduplicate_graph(), dodgr_to_igraph(), dodgr_to_sfc(), dodgr_to_tidygraph(), igraph_to_dodgr()

Examples

Run this code
hw <- weight_streetnet (hampi)
nrow (hw) # 5,729 edges
xy <- dodgr_to_sf (hw)
dim (xy) # 764 edges; 14 attributes

Run the code above in your browser using DataLab