gtfs

How can I make my GTFS queries run faster?

六眼飞鱼酱① 提交于 2020-01-13 05:10:28
问题 I'm trying to play with a GTFS database, namely the one provided by the RATP for Paris and its suburbs. The set of data is huge . The stop_times table has 14 million rows. Here's the tables schemas: https://github.com/mauryquijada/gtfs-mysql/blob/master/gtfs-sql.sql I'm trying to get the most efficient way to get the available routes at a specific location. As far as I understand the GTFS spec, here are the tables and their links from my data (lat/lon) to the routes: stops | stop_times |

Associating nearby points with a path

心不动则不痛 提交于 2020-01-01 14:35:11
问题 Given a set of ordered points, and a path made up of ordered lat,lon points that goes near those points (in lat/lon coordinates), I want to associate the points with the path, ideally with good algorithmic complexity (n*log(n)) or better, but maybe that might not be realistic. The below diagram illustrates my question better. The blue line is the ordered path that is provided, and the red points are in the same order as the blue line. The green path is my desired result, which merges the red

gtfs-realtime-bindings in angularjs

六月ゝ 毕业季﹏ 提交于 2019-12-25 05:19:13
问题 Reading through the GTFS-Realtime, I came across these code samples, with Javascript in the list. The gtfs-realtime-bindings module happens to read gtfs.zip files properly and interpret them appropriately. I want to use the package in my angular project. How can I? 回答1: gtfs-realtime-bindings is available as node module and you can use nodejs and angularjs in the same project, see i.e. https://scotch.io/tutorials/creating-a-single-page-todo-app-with-node-and-angular <- nice In this thread is

How to generate coordinates in between two known points

女生的网名这么多〃 提交于 2019-12-19 02:27:56
问题 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

Reading GTFS-realtime files using R?

半腔热情 提交于 2019-12-18 13:38:16
问题 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

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

ⅰ亾dé卋堺 提交于 2019-12-13 11:34:46
问题 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

Find nearest transit station / stopover (bus, train etc) in Google Maps

谁说我不能喝 提交于 2019-12-12 01:35:08
问题 Is it possible to find the nearest bus, train, or other public transit? The 'nearest' is a separate case, but is it just possible to find them? They are tagged, but I want to know how to access/find them. 回答1: I don't think that this is supported in Google Maps yet, finding the nearby public transport locations of a spot. The only workaround I could think of is to use the location you want to get the nearest public transportation as a starting point of a directions calculation. As the

Geo SQL to find points near location

允我心安 提交于 2019-12-11 10:59:54
问题 I using the below sql: based on http://www.scribd.com/doc/2569355/Geo-Distance-Search-with-MySQL SELECT * , 3956 *2 * ASIN( SQRT( POWER( SIN( ( - 36.8812573 - abs( stop_lat ) ) * pi( ) /180 /2 ) , 2 ) + COS( - 36.8812573 * pi( ) /180 ) * COS( abs( stop_lat ) * pi( ) /180 ) * POWER( SIN( ( 174.63832160000004 - stop_lon ) * pi( ) /180 /2 ) , 2 ) ) ) AS distance FROM stops HAVING distance <100 LIMIT 0 , 30 To find stops that are within a radius of my current lat and lon. I am using GTFS data and

Geolocation and Haversine formula

╄→гoц情女王★ 提交于 2019-12-11 03:19:06
问题 I am trying to create a basic web application that detects the users geolocation, queries a mySQL database, and returns all bus stops within say 5 kilometers. The GTFS feed including the Longitude and Latitude have been inserted into a mySQL database, and I found a example HTML page that provides the Longitude and Latitude of the browser accessing the web application. I am seeking some help writing the mySQL query that takes this information and returns the results. 回答1: Although the great

streaming gtfs real time data into human readable format

谁说胖子不能爱 提交于 2019-12-11 02:52:10
问题 I'm trying to download readable gtfs real time data (protocol buffer format) using Java so I can view it in a text file. I tried a couple of approaches: Approach #1: URL url = new URL(uri); byte[] buffer = new byte[4096]; InputStream is = url.openStream(); byte[] buffer = new byte[4096]; InputStream is = url.openStream(); File file = new File("c:/protobuf_data.txt"); OutputStream output = new FileOutputStream(file); int numOfBytesReadIntoBuffer = -1; while((numOfBytesReadIntoBuffer = is.read