Sustainable Transport Planning
Calculate line length of line with geographic or projected CRS
Perform GIS functions on a temporary, projected version of a spatial o...
Add a node to route network
Calculate the angular difference between lines and a predefined bearin...
Scale a bounding box
Rapid row-binding of sf objects
Create matrix representing the spatial bounds of an object
Flexible function to generate bounding boxes
Perform a buffer operation on a temporary projected CRS
Convert text strings into points on the map
Select a custom projected CRS for the area of interest
Clip the first and last n metres of SpatialLines
Function to split overlapping SpatialLines into segments
Identify lines that are points
Do the intersections between two geometries create lines?
Find the bearing of straight lines
Break up line objects into shorter segments
Convert multilinestring object into linestrings
Find the mid-point of lines
Divide an sf object with LINESTRING geometry into regular segments
Segment a single line, using lwgeom or rsgeo
Add geometry columns representing a route via intermediary points
Convert geographic line objects to a data.frame with from and to coord...
Convert a spatial (linestring) object to points
Convert 2 matrices to lines
Vectorised function to calculate number of segments given a max segmen...
Retrieve the number of vertices in sf objects
Summary statistics of trips originating from zones in OD data
Summary statistics of trips arriving at destination zones in OD data
Create matrices representing origin-destination coordinates
Convert origin-destination coordinates into desire lines
Generate ordered ids of OD pairs so lowest is always first This functi...
Combine two ID values to create a single ID number
Aggregate od pairs they become non-directional
Convert origin-destination data from long to wide format
Convert origin-destination data to spatial lines
Extract coordinates from OD data
Convert origin-destination data from wide to long format
Aggregate flows so they become non-directional (by geometry - the slow...
Convert series of overlapping lines into a route network
Convert series of overlapping lines into a route network
Pipe operator
Convert a series of points into geographical flows
Convert a series of points, or a matrix of coordinates, into a line
Convert a series of points into a dataframe of origins and destination...
Split a spatial object into quadrants
Import and format Australian Bureau of Statistics (ABS) TableBuilder f...
Get points at the beginner and end of linestrings
Break up an sf object with LINESTRING geometry.
Keep only segments connected to the largest group in a network
Extract nodes from route network
Assign segments in a route network to groups
Join route networks
Merge route networks, keeping attributes with aggregating functions
Subset one route network based on overlaps with another
Return average gradient across a route
Get a route from the BikeCitizens web service
Route on local data using the dodgr package
Find shortest path using Google services
Find nearest route to a given point
Plan routes on the transport network using the OSRM server
Return smoothed averages of vector
Return smoothed differences between vector values
Calculate rolling average gradient from elevation data at segment leve...
Calculate the sequential distances between sequential coordinate pairs
Calculate the gradient of line segments from a matrix of coordinates
Calculate the gradient of line segments from distance and elevation ve...
Split route based on the id or coordinates of one of its vertices
Split route in two at point on or near network
Plan routes on the transport network
Deprecated functions in stplanr
stplanr: Sustainable Transport Planning with R
Clip the beginning and ends of sf
LINESTRING objects
Tools for transport planning with an emphasis on spatial transport data and non-motorized modes. The package was originally developed to support the 'Propensity to Cycle Tool', a publicly available strategic cycle network planning tool (Lovelace et al. 2017) <doi:10.5198/jtlu.2016.862>, but has since been extended to support public transport routing and accessibility analysis (Moreno-Monroy et al. 2017) <doi:10.1016/j.jtrangeo.2017.08.012> and routing with locally hosted routing engines such as 'OSRM' (Lowans et al. 2023) <doi:10.1016/j.enconman.2023.117337>. The main functions are for creating and manipulating geographic "desire lines" from origin-destination (OD) data (building on the 'od' package); calculating routes on the transport network locally and via interfaces to routing services such as <https://cyclestreets.net/> (Desjardins et al. 2021) <doi:10.1007/s11116-021-10197-1>; and calculating route segment attributes such as bearing. The package implements the 'travel flow aggregration' method described in Morgan and Lovelace (2020) <doi:10.1177/2399808320942779> and the 'OD jittering' method described in Lovelace et al. (2022) <doi:10.32866/001c.33873>. Further information on the package's aim and scope can be found in the vignettes and in a paper in the R Journal (Lovelace and Ellison 2018) <doi:10.32614/RJ-2018-053>, and in a paper outlining the landscape of open source software for geographic methods in transport planning (Lovelace, 2021) <doi:10.1007/s10109-020-00342-2>.
Useful links