-
Notifications
You must be signed in to change notification settings - Fork 2
How to query itineraries from the API
Found a solution. The key is to query the exact lat/long that the geocode service returns, and (obviously) use a date/time that actually exists ;-)
e.g. GET /otp/routers/default/geocode?query=Mannheim => lat/long GET /otp/routers/default/plan?fromPlace=49.478219,8.472465&toPlace=48.584483,7.734591&time=12:00pm&date=12-18-2014&mode=BUS
This returns the itineraries as expected. Alternatively, the plan API accepts a stop as "stop+<stop_id>::lat,long"
Am Mittwoch, 17. Dezember 2014 22:43:44 UTC+1 schrieb miraculixx: I am want to use OTP to query a GTFS schedule for long-distance journeys (coaches), without using street data. Here are the options I'm using:
a) to build: java -Xmx8G -jar /var/otp/otp.jar --build /var/otp/pdx --noStreets --longDistance b) for the server: java -Xmx6G -Xverify:none -jar /var/otp/otp.jar --noStreets --longDistance --graphs /var/otp/graphs -s -p 80
As an example, I am using this GTFS feed: http://www.gtfs-data-exchange.com/agency/flixbus-gmbh/latest.zip As per the stop_times there should be a route between stop 53 (Munich) and 11 (Dortmund).
I tries to use the planner API using the stop_names or stop_lat/stop_long values, to no avail, e.g.
-
GET /otp/routers/default/plan?fromPlace=M%C3%BCnchen&toPlace=Dortmund&mode=BUS returns error 400, Trip is not possible. You might be trying to plan a trip outside the map data boundary.
-
GET /otp/routers/default/plan?fromPlace=48.142451,11.549807&toPlace=51.519506,7.458947&mode=BUS returns error 404, Trip is not possible. Your start or end point might not be safely accessible (for instance, you might be starting on a residential street connected only to a highway).