Routing
Four queries route on the trail network: directions between waypoints, suggestions shaped to a distance, isochrones for the ground in reach, and matrix for travel times between places.
Every sample on this page reuses this setup. It mints a session token with your secret key, so run it on your server.
A session token lasts five minutes, so mint a new one when it expires. Authentication covers tokens in a browser.
Route a hike from Chamonix to Argentière. Coordinates are [longitude, latitude].
distance is in meters and duration in seconds. The duration follows the terrain: a climb is slower than a descent. Select geometry for the route as a GeoJSON line, and elevation for its ascent and descent.
Some ways carry a toll or an access restriction, such as private or permit-only land. directions may cross one, so read analysis.advisories before you show the route. Pass avoid to route around them, then read avoidance.
Ask for routes shaped to a distance and an ascent. This one looks for a longer way to Argentière: about 12 km with 600 m of climbing.
Candidates come back closest to your targets first. Send a seed back in seeds.include to get the same route again.
Leave out end for a loop back to start. A suggestion never crosses a tollway or an access-restricted way.
Map the ground you can reach from a point within a time or a distance. This asks for 30 and 60 minutes on foot from Chamonix.
Each range value returns one polygon: select geometry to draw it. area is in square meters. A low reachFactor means the trails are hemmed in, as in a valley.
Compare travel times and distances between many places at once. This grid links Chamonix, Argentière, and Les Houches.
Row i, column j is the trip from location i to location j. A null cell has no route.
Every query takes an activity, which picks the ways it routes on and its default pace.
Each routed activity uses a profile tuned to its terrain and movement style. Most activities support turn-by-turn routing, road cycling among them. Backcountry skiing is freehand-line only: no query routes it. Gravel biking and mountain biking are unavailable: the activity catalog does not list them, and every query refuses them, analyzeGeometry included. The GraphQL ActivitySlug enum uses the uppercase value; the Map Studio and Tile APIs use the kebab-case wire form, the same value lowercased with each underscore turned into a hyphen.