Construction

The core of the package is a data structure that can be provided as input to both graph analytical functions of tidygraph and to spatial analytical functions of sf, without the need for conversion.

sfnetwork()

Create a sfnetwork

as_sfnetwork()

Convert a foreign object to a sfnetwork

is.sfnetwork()

Check if an object is a sfnetwork

Extensions

The package extends the existing functionalities of tidygraph and sf with a set of functions specific for spatial network analysis.

st_network_paths()

Paths between points in geographical space

st_network_cost()

Compute a cost matrix of a spatial network

st_network_join()

Join two spatial networks based on equality of node geometries

st_network_blend()

Blend geospatial points into a spatial network

st_network_bbox()

Get the bounding box of a spatial network

node_intersects() node_is_disjoint() node_touches() node_is_within() node_equals() node_is_covered_by() node_is_within_distance()

Query nodes with spatial predicates

node_X() node_Y() node_Z() node_M()

Query node coordinates

edge_intersects() edge_is_disjoint() edge_touches() edge_crosses() edge_is_within() edge_contains() edge_contains_properly() edge_overlaps() edge_equals() edge_covers() edge_is_covered_by() edge_is_within_distance()

Query edges with spatial predicates

edge_azimuth() edge_circuity() edge_length() edge_displacement()

Query spatial edge measures

to_spatial_contracted() to_spatial_directed() to_spatial_explicit() to_spatial_neighborhood() to_spatial_shortest_paths() to_spatial_simple() to_spatial_smooth() to_spatial_subdivision() to_spatial_subset() to_spatial_transformed()

Spatial morphers for sfnetworks

Integration with sf

The package enables smooth integration with sf by implementing several sfnetwork methods for sf functions.

st_as_sf(<sfnetwork>) st_as_s2(<sfnetwork>) st_geometry(<sfnetwork>) `st_geometry<-`(<sfnetwork>) st_drop_geometry(<sfnetwork>) st_bbox(<sfnetwork>) st_coordinates(<sfnetwork>) st_is(<sfnetwork>) st_is_valid(<sfnetwork>) st_crs(<sfnetwork>) `st_crs<-`(<sfnetwork>) st_precision(<sfnetwork>) st_set_precision(<sfnetwork>) st_shift_longitude(<sfnetwork>) st_transform(<sfnetwork>) st_wrap_dateline(<sfnetwork>) st_normalize(<sfnetwork>) st_zm(<sfnetwork>) st_m_range(<sfnetwork>) st_z_range(<sfnetwork>) st_agr(<sfnetwork>) `st_agr<-`(<sfnetwork>) st_reverse(<sfnetwork>) st_simplify(<sfnetwork>) st_join(<sfnetwork>) st_join(<morphed_sfnetwork>) st_filter(<sfnetwork>) st_filter(<morphed_sfnetwork>) st_crop(<sfnetwork>) st_crop(<morphed_sfnetwork>) st_difference(<sfnetwork>) st_difference(<morphed_sfnetwork>) st_intersection(<sfnetwork>) st_intersection(<morphed_sfnetwork>) st_intersects(<sfnetwork>) st_sample(<sfnetwork>) st_nearest_points(<sfnetwork>) st_area(<sfnetwork>)

sf methods for sfnetworks

sf_attr()

Query sf attributes from the active element of a sfnetwork

as_tibble(<sfnetwork>)

Extract the active element of a sfnetwork as spatial tibble

Integration with other packages

The packages implements basic functions to coerce sfnetwork objects into other formats.

as.linnet.sfnetwork()

Convert a sfnetwork into a linnet

as_s2_geography.sfnetwork()

s2 methods for sfnetworks

Visualization

The package offers basic plot methods. For more advanced plotting, the use of specific plotting and mapping libraries is recommended.

plot(<sfnetwork>)

Plot sfnetwork geometries

autoplot.sfnetwork()

Plot sfnetwork geometries with ggplot2

Demo data

roxel

Road network of Münster Roxel