osm_get_junctions: Extract junction points from OSM road linestrings

Description Usage Arguments Details Value See Also Examples

View source: R/osm_cleaning_functions.R

Description

Gets junction points from route networks, building on functions in the stplanr package: https://github.com/ropensci/stplanr/blob/master/R/rnet-clean.R

Usage

1
osm_get_junctions(x, method = "stplanr", overline = FALSE)

Arguments

x

a SF data frame of OSM linestrings

method

which method to use? The default, "stplanr" uses the rnet_breakup_vertices() function in the stplanr package. An alternative method, "duplicated", is simpler but returns junctions on straight road sections, e.g. where a road name changes.

overline

should the route network be pre-processed with the overline function?

Details

This function finds all junction points in a road network, i.e. where two roads meet. It excludes road crossings e.g. bridges.

Value

Returns an SF data frame of POINTS

See Also

Other OSM: cluster_junction(), line_segment_sf(), nn_line(), nn_point(), osm_consolidate(), osm_main_roads()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
x = osm_main_roads(tc_data_osm)
class(x$geometry)
junctions = osm_get_junctions(x)
boundary_points = stplanr::rnet_get_nodes(x)
summary(duplicated(boundary_points))
junctions2 = osm_get_junctions(x, method = "duplicates")
length(junctions)
length(junctions2)
plot(x$geometry, col = "grey")
plot(junctions, add = TRUE)
plot(junctions2, add = TRUE, col = "red", cex = 0.5)

saferactive/traffiCalmr documentation built on Nov. 18, 2021, 5:06 a.m.