stplanr1.2.2 package

Sustainable Transport Planning

geo_length

Calculate line length of line with geographic or projected CRS

geo_projected

Perform GIS functions on a temporary, projected version of a spatial o...

rnet_add_node

Add a node to route network

angle_diff

Calculate the angular difference between lines and a predefined bearin...

bbox_scale

Scale a bounding box

bind_sf

Rapid row-binding of sf objects

geo_bb_matrix

Create matrix representing the spatial bounds of an object

geo_bb

Flexible function to generate bounding boxes

geo_buffer

Perform a buffer operation on a temporary projected CRS

geo_code

Convert text strings into points on the map

geo_select_aeq

Select a custom projected CRS for the area of interest

geo_toptail

Clip the first and last n metres of SpatialLines

gsection

Function to split overlapping SpatialLines into segments

is_linepoint

Identify lines that are points

islines

Do the intersections between two geometries create lines?

line_bearing

Find the bearing of straight lines

line_breakup

Break up line objects into shorter segments

line_cast

Convert multilinestring object into linestrings

line_midpoint

Find the mid-point of lines

line_segment

Divide an sf object with LINESTRING geometry into regular segments

line_segment1

Segment a single line, using lwgeom or rsgeo

line_via

Add geometry columns representing a route via intermediary points

line2df

Convert geographic line objects to a data.frame with from and to coord...

line2points

Convert a spatial (linestring) object to points

mats2line

Convert 2 matrices to lines

n_segments

Vectorised function to calculate number of segments given a max segmen...

n_vertices

Retrieve the number of vertices in sf objects

od_aggregate_from

Summary statistics of trips originating from zones in OD data

od_aggregate_to

Summary statistics of trips arriving at destination zones in OD data

od_coords

Create matrices representing origin-destination coordinates

od_coords2line

Convert origin-destination coordinates into desire lines

od_id_order

Generate ordered ids of OD pairs so lowest is always first This functi...

od_id

Combine two ID values to create a single ID number

od_oneway

Aggregate od pairs they become non-directional

od_to_odmatrix

Convert origin-destination data from long to wide format

od2line

Convert origin-destination data to spatial lines

od2odf

Extract coordinates from OD data

odmatrix_to_od

Convert origin-destination data from wide to long format

onewaygeo

Aggregate flows so they become non-directional (by geometry - the slow...

overline_intersection

Convert series of overlapping lines into a route network

overline

Convert series of overlapping lines into a route network

pipe

Pipe operator

points2flow

Convert a series of points into geographical flows

points2line

Convert a series of points, or a matrix of coordinates, into a line

points2odf

Convert a series of points into a dataframe of origins and destination...

quadrant

Split a spatial object into quadrants

read_table_builder

Import and format Australian Bureau of Statistics (ABS) TableBuilder f...

rnet_boundary_points

Get points at the beginner and end of linestrings

rnet_breakup_vertices

Break up an sf object with LINESTRING geometry.

rnet_connected

Keep only segments connected to the largest group in a network

rnet_get_nodes

Extract nodes from route network

rnet_group

Assign segments in a route network to groups

rnet_join

Join route networks

rnet_merge

Merge route networks, keeping attributes with aggregating functions

rnet_subset

Subset one route network based on overlaps with another

route_average_gradient

Return average gradient across a route

route_bikecitizens

Get a route from the BikeCitizens web service

route_dodgr

Route on local data using the dodgr package

route_google

Find shortest path using Google services

route_nearest_point

Find nearest route to a given point

route_osrm

Plan routes on the transport network using the OSRM server

route_rolling_average

Return smoothed averages of vector

route_rolling_diff

Return smoothed differences between vector values

route_rolling_gradient

Calculate rolling average gradient from elevation data at segment leve...

route_sequential_dist

Calculate the sequential distances between sequential coordinate pairs

route_slope_matrix

Calculate the gradient of line segments from a matrix of coordinates

route_slope_vector

Calculate the gradient of line segments from distance and elevation ve...

route_split_id

Split route based on the id or coordinates of one of its vertices

route_split

Split route in two at point on or near network

route

Plan routes on the transport network

stplanr-deprecated

Deprecated functions in stplanr

stplanr-package

stplanr: Sustainable Transport Planning with R

toptail_buff

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>.

  • Maintainer: Robin Lovelace
  • License: MIT + file LICENSE
  • Last published: 2024-08-22