Learn R Programming

osmplotr (version 0.2.0)

order_lines: order_lines

Description

Accepts a SpatialLinesDataFrame representing an OpenStreetMap line object such as a highway. The list items of these objects are arbitrarily organised within OpenStreetMap. This function orders the components, returning a list of components each of which is ordered sequentially along the line. Points of intersection between components are also inserted where these are not explicitly present in OpenStreetMap. Nodes are also sequentially renumbered, starting at (i0+1)

Usage

order_lines(spLines, i0 = 0)

Arguments

spLines
A SpatialLinesDataFrame returned from extract_osm_objects()
i0
The first node is numbered (i0+1), with other nodes (except junction nodes) numbered sequentially .

Value

  • A list of ordered line segments.

Note

This function is primarily used in extract_highways()