Skip to content

Commit

Permalink
Merge pull request #37 from orifolger/master - issue 33
Browse files Browse the repository at this point in the history
Create add_gtfs_shape_distro_ratio.sql
  • Loading branch information
MYank0 committed Jun 9, 2017
2 parents f24d414 + 39b9e4c commit bb9cfc7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions postgres/add_gtfs_shape_dist_ratio.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ALTER TABLE gtfs_stop_times ADD COLUMN shape_dist_ratio REAL;

UPDATE gtfs_stop_times
SET shape_dist_ratio = (1.0*shape_dist_traveled) /
(SELECT MAX(shape_dist_traveled)
FROM gtfs_stop_times a
WHERE a.trip_id = gtfs_stop_times.trip_id);

0 comments on commit bb9cfc7

Please sign in to comment.