Isochrones
The isochrones query of the Data API. Every request is a POST to https://data.mountaya.com/graphql with a publishable key and a session token: see Authentication.
/graphqlCompute isochrones (reachability polygons) from one or more locations for a given activity. Returns polygons representing areas reachable within the specified range.
Arguments
inputIsochronesInput!
The origin, the activity, and the time or distance ranges to compute reachability for.
activityActivitySlug!
One of: HIKING_AND_TRAIL, PROFESSIONAL_TRAIL, RUNNING, ROAD_CYCLING, GRAVEL_BIKE, MOUNTAIN_BIKE, BACKCOUNTRY_SKIING, SKI_TOURING, CROSS_COUNTRY_SKIING, SNOWSHOE_WALKING
Activity to use for routing. BACKCOUNTRY_SKIING has no routing, and GRAVEL_BIKE and MOUNTAIN_BIKE are unavailable: all three are VALIDATION_FAILED at ["input", "activity"].
See ActivitySlug.
locations[[Float!]!]!
Starting locations as [longitude, latitude] coordinate pairs (WGS 84), one or two (none, or more than two, is VALIDATION_FAILED at ["input", "locations"]). Each is exactly two numbers, a longitude between -180 and 180 and a latitude between -90 and 90, and one that is not is VALIDATION_FAILED at ["input", "locations", i]. Each location is placed on the activity's network as a directions waypoint is, within the same radius (400 meters for most activities) and on the ways the activity routes on, so a way it avoids, a ferry line for one, never places it. A location no such way lies near is VALIDATION_FAILED at ["input", "locations", i], one entry per such location: a point in a lake or out at sea, for example. Example: [[6.8712, 45.9231]] (single origin at Chamonix).
range[Float!]!
Range values in seconds (TIME) or meters (DISTANCE), one to six (none, or more than six, is VALIDATION_FAILED at ["input", "range"]). Each is greater than zero and at most 7,200 seconds or 25,000 meters, and one that is not is VALIDATION_FAILED at ["input", "range", i]. Multiple values produce concentric isochrones. Example: [600, 1200, 1800] for 10, 20, 30 minute isochrones (TIME). Example: [5000, 10000] for 5 km and 10 km isochrones (DISTANCE).
rangeTypeRangeType!
One of: TIME, DISTANCE
Whether the range is expressed in time or distance.
See RangeType.
speedFloat
Travel speed in km/h, a finite number greater than 0 (anything else, NaN and Infinity included, is VALIDATION_FAILED at ["input", "speed"]). When provided, the time budget is stretched by the ratio of this pace to the routing engine's own pace for the activity, 5 km/h for the activities on foot and on skis and 20 km/h for ROAD_CYCLING, so the polygon covers the ground this pace reaches within the requested range. The stretched budget is held to the same 7,200 seconds as a range: a speed that takes any range value past it, once multiplied by that ratio, is VALIDATION_FAILED at ["input", "speed"]. At 10 km/h on foot, for example, every range value must be at most 3,600 seconds. Only meaningful when rangeType is TIME: a distance range is speed-independent, and pairing the two is VALIDATION_FAILED at ["input", "speed"].
Returns
isochronesIsochronesResult!
Result of an isochrones computation.
isochrones[Isochrone!]!
List of computed isochrones: one per location and range value, in the order the routing engine returns them. Read each one's value rather than relying on its position.
valueFloat!
The requested range value this polygon was computed for, in seconds or meters as the input range type says.
areaFloat
Area of the isochrone polygon in square meters. Null when the routing provider did not report it for this polygon.
reachFactorFloat
How much of the theoretically reachable ground the isochrone actually covers, from 0 to 1. The theoretical area is the circle the same travel budget would cover with no network and no terrain in the way, so a value near 1 means the network radiates freely from the origin and a low value means it is constrained: a valley floor, a coastline, a single road out. Null when the routing provider did not report it for this polygon.
center[Float!]
Center point of the isochrone as [longitude, latitude] (WGS 84). Null when the routing provider reports no center for this isochrone: the value is forwarded verbatim from the provider's response and is not reconstructed from the input location, so its absence is reported as null rather than as an empty array.
geometryGeoJSON!
Polygon geometry of the isochrone.
Errors A field the API refuses is answered 200, its entry in errors beside the data that resolved. See Errors.
curl https://data.mountaya.com/graphql \
-H "X-API-Key: pk_your_publishable_key" \
-H "X-Session-Token: sess_your_session_token" \
-H "Content-Type: application/json" \
-d '{
"query": "query Isochrones($input: IsochronesInput!) { isochrones(input: $input) { isochrones { geometry value } } }",
"variables": {
"input": {
"activity": "HIKING_AND_TRAIL",
"locations": [[6.8712, 45.9231]],
"range": [1800, 3600],
"rangeType": "TIME"
}
}
}'