Questions tagged [stplanr]

stplanr is an R package focusing on sustainable transport planning, which contains tools for origin-destination analysis, route allocation and modelling travel patterns.

11 questions
2
votes
2 answers

How to calculate trajectory length in R

I am trying to find the length between start and finish locations. So, which packages and function I should apply. This is what the sample looks like: # A tibble: 10 x 5 trip_id start_location end_location start_time end_time …
Yasumin
  • 443
  • 2
  • 8
2
votes
2 answers

Add new node to SpatialLinesNetwork in stplanr

How can one add a new node to a SpatialLinesNetwork? context of my problem: I have a shapefile of a bus route and another shapefile of bus stops. I want to calculate the distance between stops along the bus route. Ideally, each stop would be a node…
rafa.pereira
  • 13,251
  • 6
  • 71
  • 109
1
vote
1 answer

Filling road network data gaps

I have a motorway network with count points that can be matched to road links. However, they only match around half the osm links. The network is uni directional and it should be possible to assign data from joining links to the missing links. I…
Blaiso
  • 165
  • 9
1
vote
1 answer

Creating a route from a list of points and Overlaying the route (list of points) on the road segment/ road network in R

I have a road network shapefile and list of points. I have to create a route from the list of points and then overlay/ spatially join (integrate the attributes of points that are overlaying the road segments) The sample road network shape file can…
Betel
  • 151
  • 7
1
vote
1 answer

Questions regarding the stplanr package in R

I would like your help with the route_local function of the stplanr package (https://cran.r-project.org/web/packages/stplanr/stplanr.pdf), which is on page 89. You may realize that a map is generated from the example function, showing the path…
Antonio
  • 1,091
  • 7
  • 24
1
vote
0 answers

How to add a legend to a plot using qtm in R

I am using tmap package and am using its functionality to get a map of area I'm interested in library(tmap) qtm("London") Then I have SpatialLinesDataFrame containing data on number of trips so I want to display those using number ot trips as…
0
votes
1 answer

R: sfnetworks: How to find routes between multiple A and B locations in a same dataset

This is my dataset df<-tribble( ~"shop.x",~"shop.y", ~"cust.x", ~"cust.y", 78.100378, 9.944226, 78.096318, 9.954789, 78.101155, 9.932190, 78.089824, 9.929975, 78.141887, 9.928319, 78.110863, 9.952235, 78.100381, …
Betel
  • 151
  • 7
0
votes
1 answer

Origin destination plot

I am looking for a way to add more information to this Origin-Destinatio plot. First i would like to add a label to each of the zones (origin/ destination). Secondly, I would also like to plot a map as a background and possibly add a color gradient…
0
votes
0 answers

Is it possible to create a route with intermediate stops points (apart from A to B) in R?

The code below was shared in the stplanr documentation : stplanr documentation library(stplanr) library(osrm) trip <- route( from = c(-0.11, 51.514), to = c(-0.10, 51.506), route_fun = osrmRoute, returnclass = "sf" …
Betel
  • 151
  • 7
0
votes
0 answers

Local routing on a road network using stplanr in R

I would like to calculate the shortest route on a road network between both an origin point and multiple points and between all points. I am using osmdata to get the road network for my area and I would then like to use stplanr to calculate the…
Chris
  • 1,197
  • 9
  • 28
0
votes
1 answer

Function by row pairs instead all-to-all (dist_google of stplanr in R)

I'm working with OD data with stplanr package. My interest in this package is to compute route distances and times specially for walking and public transport modes. I have some OD points coordinates resulted from the od2odf() used on a desire lines…
Bruno Pinheiro
  • 964
  • 8
  • 20