Was this helpful?
You can request routes for various supported modes of transport.
In order to search for a route between two positions, you must supply at least 2 positions and up to 50 positions overall. You will also need to supply the mode of transport.
1# Queries routes that exist through the supplied positions. Supports a wide
2# range of different travel modes and waypoints
3
4query findRoutesBetweenPositions {
5 # Use the routes() query to query routes between supplied positions
6 routes(
7 # Supports profiles like: Car, Bike, Foot, Hike, etc
8 mode: Car
9 # Supply waypoints (min: 2, max 50)
10 positions: [
11 { lon: 144.96876776218414, lat: -37.8180097638788 }
12 { lon: 144.99648571014401, lat: -37.79815352540803 }
13 ]
14 # Provide 1 route
15 first: 1
16 ) {
17 nodes {
18 segments {
19 # Represent the response (options include: polyline, or simplify etc)
20 geoJson
21
22 # Access some information about the distance/duration/elevation
23 # Control the units that are use
24 distance(unit: Kilometers)
25 duration(unit: Minutes)
26 elevation {
27 min(unit: Meters)
28 max(unit: Meters)
29 }
30 }
31 }
32 }
33}
Sandbox: Configure | Try Operation
Copyright © 2024 - Made with love ❤️ in Australia.