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

Add SHAPE_DIST_RATIO field to gtfs_stop_times [easy] #33

Closed
daphshez opened this issue May 29, 2017 · 1 comment
Closed

Add SHAPE_DIST_RATIO field to gtfs_stop_times [easy] #33

daphshez opened this issue May 29, 2017 · 1 comment
Labels
Hackathon Preparation for the upcoming hackathon

Comments

@daphshez
Copy link
Collaborator

daphshez commented May 29, 2017

gtfs_stop_times has a SHAPE_DIST_TRAVELED which gives the distance travelled by the bus from the route origin to the current stop.

The task is to write a query that:

  • Adds a shape_dist_ratio field to gtfs_stop_times table
  • Populate the field with the ratio between SHAPE_DIST_TRAVELED and the length of the route (values in 0-1 range)

Keep the query as an .sql file under /postgres

You can get the length of the route by querying the SHAPE_DIST_TRAVELED of the last stop (highest STOP_SEQUENCE for the same TRIP_ID).

What you will need to know?

  • SQL
  • Understand the gtfs_stop_times table. Read about the GTFS tables here and play with them using the re:dash interface.
  • You can access the database and write the query using the re:dash database.
  • Clone the repository and submit the query using a pull request.
@daphshez daphshez added Hackathon Preparation for the upcoming hackathon what do i need to know labels May 29, 2017
@daphshez daphshez changed the title Add SHAPE_DIST_RATIO field to gtfs_stop_times [easy] Add SHAPE_DIST_RATIO field to gtfs_stop_times May 29, 2017
@daphshez daphshez changed the title [easy] Add SHAPE_DIST_RATIO field to gtfs_stop_times Add SHAPE_DIST_RATIO field to gtfs_stop_times [easy] May 29, 2017
@MYank0
Copy link
Collaborator

MYank0 commented Jun 9, 2017

Issue was solved by @orifolger. Current GTFS is updated with this column and the sql query is saved here under postgres. I added the query to the script insert_gtfs.sql
@daphshez can we close this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hackathon Preparation for the upcoming hackathon
Projects
No open projects
Development

No branches or pull requests

2 participants