Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_trip_speed: Consider distance between first and last stop #7

Open
rafapereirabr opened this issue Feb 23, 2021 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@rafapereirabr
Copy link
Member

In the get_trip_speed() function, the code currently considers the lenght of the entire trip (see below). However, it's quite common that the trip geometry stretches longer the the 1st and last stops. To get more accurate results, we would need to tweak the code to consider only the distance AND duration between the1st and last stops.

  # generate desired geometries - checking for required files/fields is done
  # pretty early into get_trip_geometry code

  trips_geometries <- get_trip_geometry(gtfs, trip_id, file)

  # calculate the length of each geometry

  trips_length <- sf::st_length(trips_geometries)
  if (unit == "km/h") trips_length <- units::set_units(trips_length, "km")
  trips_length <- as.numeric(trips_length)

@dhersz dhersz added the enhancement New feature or request label Oct 19, 2021
@dhersz
Copy link
Member

dhersz commented Oct 28, 2021

Related to #32.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants