Public transportation extra parameters

Applies to the following transportation modes: "public_transport", "walking+coach", "walking_bus" or "walking_train"

{
# Maximum time (in seconds) of walking from source to a station/stop or from
# a station/stop to target. default: 40% of travel time, but in range [900, 2100]
time-to-station-limit: null|Int,
# Time needed to board public transportation vehicle (in seconds).
# default: 0
"pt-change-penalty": null|Int
}

Specifies which data properties you want to know about the points. Valid values are:

"time" - returns time taken to travel from source to destination in seconds.

"distance" - returns distance from source to destination in meters. This is only valid for following modes: "cycling", "cycling_ferry", "driving", "driving_ferry", "walking" or "walking_ferry". Other transportation modes will have a constant distance of -1.

"distance_breakdown" - returns distance from source to destination broken down by EdgeType.

Specifies which data properties you want to know about the points. Valid values are:

"time" - returns time taken to travel from source to destination in seconds.

"distance" - returns distance from source to destination in meters. This is only valid for following modes: "cycling", "cycling_ferry", "driving", "driving_ferry", "walking" or "walking_ferry". Other transportation modes will have a constant distance of -1.

"distance_breakdown" - returns distance from source to destination broken down by EdgeType.

"fares" - returns fares and fares total. This is only valid for the following modes: "driving+train", "public_transport", "walking+coach", "walking_bus" or "walking_train".

{
"mode": EdgeType,
# Array of coordinates for this route part. Can be used to draw a polyline
# on a map.
"coords": [CoordsV2, CoordsV2, CoordsV2, ...],
"directions: String, # textual description in English of this route part
"distance": Int, # distance covered in metres for this route part
"time": Int, # time taken to travel through this route part in seconds
"id": Int
}

{
"mode": EdgeType,
# Array of coordinates for this route part. Can be used to draw a polyline
# on a map.
"coords": [CoordsV2, CoordsV2, CoordsV2, ...],
"directions: String, # textual description in English of this route part
"distance": Int, # distance covered in metres for this route part
"time": Int, # time taken to travel through this route part in seconds
"direction": String, # Cardinal direction in English ("north", "northeast", "east", "southeast", ...)
"id": Int
}

Structure describing routing on public roads, i.e. walking or driving.

{
"mode": EdgeType,
# Array of coordinates for this route part. Can be used to draw a polyline
# on a map.
"coords": [CoordsV2, CoordsV2, CoordsV2, ...],
"directions: String, # textual description in English of this route part
"distance": Int, # distance covered in metres for this route part
"time": Int, # time taken to travel through this route part in seconds
"road": null|String, # name of the road
"turn": null|String, # turn direction in English ("straight", "slight_left", "slight_right", "left" or "right")
"id": Int
}

Structure describing routing using public transport, i.e. bus or train.

{
"mode": EdgeType,
# Array of coordinates for this route part. Can be used to draw a polyline
# on a map.
"coords": [CoordsV2, CoordsV2, CoordsV2, ...],
"directions: String, # textual description in English of this route part
"distance": Int, # distance covered in metres for this route part
"time": Int, # time taken to travel through this route part in seconds
"line": String, # Name of the public transport line (e.g. bus number)
"departure_station": String, # name of the departure station
"arrival_station": String, # name of the arrival station
"depart_time": String, # local time of departure in 'HH:mm' format
"arrive_time": String, # local time of arrival in 'HH:mm' format
"num_stops": Int, # number of stops to go on this route part
"id": Int
}

code: "no-auth", HTTP status: Unauthorized (401) - returned when auth params are in correct format but are unknown to us.

code: "limit-reached", HTTP status: Too Many Requests (429) - returned when request limit for a time frame is reached.

code: "out-of-reach", HTTP status: OK (200) - returned when we have the data set, but there are no useful data around a given location.

code: "no-data", HTTP status: OK (200) - returned when we do not have any data in given location, also returned when requesting additional data (e.g. fares or postcodes) on location that does not support it.

code: "timed-out", HTTP status: Service Unavailable (503) - returned when one of our servers which might hold the requested data is down.

code: "metadata-missing", HTTP status: Internal Server Error (500) - returned when The metadata needed to finish the request is missing.

code: "internal-server-error", HTTP status: Internal Server Error (500) - returned when one of our servers which might hold the requested data has encountered an error and was unable to fulfill the request.

Actions

Input

Output

Accessible as

Input

{
# Limits max. travel time from your origin to each of the given points.
# If travel time to a certain point exceeds this value such point will be
# omitted in the result set.
#
# In seconds.
"travel_time": Int,
"origin": CoordsV1,
# Points that wou need travel time calculated for.
"points": [PointWithId, PointWithId, ...],
"mode": TransportationMode
}

Output

{
# ids are taken from PointWithId.
# Int represents time from our origin to that point in seconds.
"id1": Int, "id2": Int, ...
}

Output

Accessible as

Given origin point, max travel time and start time find areas to which you can arrive in that travel time using given transportation mode.

Input

{
"start_time": DateTime,
# Maximum number of seconds needed to reach each point in result area.
"travel_time": Int,
"origin": CoordsV2,
"mode": TransportationMode,
# Should the shape be smoothed?
"smooth": Boolean,
# Optional parameter that switches shape simplification on (true, not specified - old behaviour) and
# off (false). In case this is true and max_points is not specified, shape is simplified so that
# it remains similar to the original shape.
"simplify": null|Boolean
# Optional parameter that allows you to specify maximum number of points in
# returned cluster. If more than one cluster is returned, points are divised
# proportionally between clusters.
"max_points": null|Int
}

Accessible as

Given X origins find shapes of zones reachable within each corresponding travel time and intersections of those zones.

Use cases

Single origin with start_time

You are in your job and want to watch a sports game in a pub after work. Given that you have 30 minutes between your shift end and when match starts you need to find a suitable sports pub using public transport.

Multi origin with start_time

John, Tom and Bob want to meet for a chat in a pub. They all live in different places but want to meet in 30 minutes by using public transport.

You can use this method to obtain all zones in which they could meet.

Single origin with arrival_time

You get a new job in London and are searching for a place to rent. You want to arrive to work at 9 AM in 15 minutes either by walking or by public transport.

Using this request you can set your new job as the destination and receive a time map of potential places for your new home.

Multi origin with arrival_time

You and your partner both get a new job in London. However this time you have two different destinations. One of you (A) has to be at work at 8:30 AM and can spare 30 minutes of driving, whilst another one (B) must be at work at 7 AM and wants to walk for 10 minutes max.

Using this request you can find time maps for persons A and B and intersection between them where your new home could be.

Accessible as

Given origin point, max travel time and start time return routing information using transportation mode for set of destination points.

Input

{
# Limits max. travel time from your origin to each of the given points. If
# travel time to a certain point exceeds this value such point will be
# omitted in the result set.
#
# In seconds.
"travel_time": Int,
"origin": CoordsV2,
# Points that you need travel time calculated for.
"points": {"id1": CoordsV2, "id2": CoordsV2, ...},
"mode": TransportationMode,
# When do we start our search?
"start_time": DateTime
}

Accessible as

Given origin point and start time or destination point and arrival time, max travel time returns routing information using transportation mode for set of destination points.

Input

{
"target": {
"coords": CoordsV2,
# Specifies when do we want to either:
# - Start our journey from this point at given time.
# - Arrive at this point at given time.
"start_time" | "arrival_time": DateTime,
# Maximum number of seconds between target and edge of the zone.
"travel_time": Int,
"mode": TransportationMode,
# Include fares in the response, default is false.
"include_fares": null|Boolean
}
# Points that you need route for.
"points": {"id1": CoordsV2, "id2": CoordsV2, ...},
}

Output

Accessible as

Given X origins find bounding boxes of shapes of zones reachable within each corresponding travel time.

Input

{
"targets": {
"id1": {
"coords": CoordsV2,
# Specifies when do we want to either:
# - Start our journey from this point at given time.
# - Arrive at this point at given time.
"start_time" | "arrival_time": DateTime,
# Maximum number of seconds between target and edge of the zone.
"travel_time": Int,
"mode": TransportationMode
},
...
},
}

Accessible as

POST at /bounding_box

OPTIONS at /bounding_box (CORS support)

Content compression

We support (and recommend to use) lz4 compression. Compression results in significantly reduced request size. lz4 is available for most of the popular programming languages. Get it at: https://code.google.com/p/lz4