gtfs

Best way to store time above 24:00:00 in postgresql?

半世苍凉 提交于 2019-12-01 06:20:59
I'm storing GTFS feeds into a SQL database and some times are expected to be stored above the 24:00:00 cap on time values. For example, some trains run at 12:30AM, but are listed for the previous days service, and that running time is stored as 24:30 in the GTFS specifications. What would be the best way of getting around this? Should I just store it as a string? Suggest to use int for that... your value could be: Sec + Min * 60 + Hour * 3600 For the 24:30:00, you will get 88200. When loading your value from DB, you could reverse your value by simple math equation: Hour = int(value / 3600) Min

Best way to store time above 24:00:00 in postgresql?

﹥>﹥吖頭↗ 提交于 2019-12-01 04:20:26
问题 I'm storing GTFS feeds into a SQL database and some times are expected to be stored above the 24:00:00 cap on time values. For example, some trains run at 12:30AM, but are listed for the previous days service, and that running time is stored as 24:30 in the GTFS specifications. What would be the best way of getting around this? Should I just store it as a string? 回答1: Suggest to use int for that... your value could be: Sec + Min * 60 + Hour * 3600 For the 24:30:00, you will get 88200. When

How to generate coordinates in between two known points

时光怂恿深爱的人放手 提交于 2019-11-30 20:04:12
Background: I'm working with transport routes and Google provides Route points far apart enough to create 'shapes'. These are the bus/train routes you see in Google Maps. My Requirement: Google's points are far enough to create straight lines. However I want a point every, say, 5 metres. Problem: So, say I have two points [lat,long]: [-33.8824219918503,151.206686052582] and [-33.8815434600467,151.206556440037] Given those two points I can calculate the distance between them. Say it's 1km for the sake of argument. So we can imagine an imaginary straight line in between those two points. How do

GTFS Query to list all departure and arrival times between two stop names

风流意气都作罢 提交于 2019-11-30 16:48:09
I'm working with GTFS structure for the first time and am having trouble with the queries. I've got the transit data into mysql tables, and am free to query them, but I feel like I'm doing far too many queries and for loops to get the simplest info. What I'd like to get in a single query is all the departure times and arrival times between two known stops, possibly identified by name. Here is what I have so far, which involves a query, followed by looping through each trip_id to find the departure and arrival station info + times. Query 1 : Show all departure times from a particular origin

Reading GTFS-realtime files using R?

*爱你&永不变心* 提交于 2019-11-30 10:21:04
I want to analyze GTFS-realtime files using R, compared to the static GTFS, these files are compiled and reading them is trickier. Googling around, I have only found this package to deal with GTFS https://github.com/ropenscilabs/gtfsr But again, this is just for static GTFS. Are you aware of a cran/github R package that deals with GTFS-realtime? An alternative solution would be to convert the GTFS-RT into a more readable format like json streaming gtfs real time data into human readable format I notice you already found your way over to my development package, gtfsway . In particular, the

How can I list all the stops associated with a route using GTFS?

纵饮孤独 提交于 2019-11-29 21:53:38
I'm working with some GTFS data and would like to be able to create a list of all stops associated served by a route. I don't really understand how to do with with GTFS data. Trips.txt comes in a format like this: route_id,service_id,trip_id,trip_headsign,direction_id,block_id,shape_id 1,A20120610WKD,A20120610WKD_000800_1..S03R,SOUTH FERRY,1,,1..S03R 1,A20120610WKD,A20120610WKD_002700_1..S03R,SOUTH FERRY,1,,1..S03R 1,A20120610WKD,A20120610WKD_004700_1..S03R,SOUTH FERRY,1,,1..S03R 1,A20120610WKD,A20120610WKD_006700_1..S03R,SOUTH FERRY,1,,1..S03R 1,A20120610WKD,A20120610WKD_008700_1..S03R,SOUTH

How can I list all the stops associated with a route using GTFS?

一世执手 提交于 2019-11-28 17:43:07
问题 I'm working with some GTFS data and would like to be able to create a list of all stops associated served by a route. I don't really understand how to do with with GTFS data. Trips.txt comes in a format like this: route_id,service_id,trip_id,trip_headsign,direction_id,block_id,shape_id 1,A20120610WKD,A20120610WKD_000800_1..S03R,SOUTH FERRY,1,,1..S03R 1,A20120610WKD,A20120610WKD_002700_1..S03R,SOUTH FERRY,1,,1..S03R 1,A20120610WKD,A20120610WKD_004700_1..S03R,SOUTH FERRY,1,,1..S03R 1

Detect the nearest transit stop from the given location

会有一股神秘感。 提交于 2019-11-28 15:28:28
I need to get all the nearby public transit information within certain distance from a given location. The type of public transit can be either bus, train, etc.. Here is what I meant: If I use Google Map to query "Transit Stop near a Location (e.g. Bugis Street Singapore)" , then it will return us all the nearby Transit Stop that I want. Like the one shown in the picture. But I need its API to get those details out. (such as bus service No, bus stop ID, etc. as shown in the picture). But I couldn't found any. Here is what I've tried I have tried using the Google Map Nearby Place API to search

Pathfinding (routing, trip planning, …) algorithms on graphs with time restrictions

蓝咒 提交于 2019-11-27 17:15:45
I have a database of bus/train/... stops and the arrival/departure times on each date and so on. I'm looking for a way to do a search for the fastest(shortest/cheapest/least transitions) trip between two locations. I would like to have arbitrary locations in the future, using OpenStreetMap data to do walking between stops and from stops to start/end, however for the time being I just want to find path between two stops in the database. The problem is I can't seem to find much info about this subject, for example this Wikipedia page has a lot of text with absolutely no useful information in it.

Detect the nearest transit stop from the given location

穿精又带淫゛_ 提交于 2019-11-27 09:14:05
问题 I need to get all the nearby public transit information within certain distance from a given location. The type of public transit can be either bus, train, etc.. Here is what I meant: If I use Google Map to query "Transit Stop near a Location (e.g. Bugis Street Singapore)", then it will return us all the nearby Transit Stop that I want. Like the one shown in the picture. But I need its API to get those details out. (such as bus service No, bus stop ID, etc. as shown in the picture). But I