Analysis
analyzeGeometry classifies an existing line: it segments the geometry by surface (paved, gravel, dirt, and so on), by way type (path, track, footway, and so on), and by slope angle. Every routing result already carries this analysis under route.analysis; call analyzeGeometry directly when you have a geometry from elsewhere, for example a GPX track or a user-drawn line, and want the same breakdown.
All coordinates are [longitude, latitude] in WGS 84.
Each activity routes on a profile tuned to its terrain and movement style. The GraphQL ActivitySlug enum uses the uppercase value; the Tile and REST APIs use the lowercase, underscore-free wire form.
analyzeGeometry
Input
analyzeGeometry(input: AnalyzeGeometryInput!)
activityActivitySlug!
Activity to analyze for. Selects the profile used to interpret way and surface suitability.
coordinates[[Float!]!]!
Ordered list of [longitude, latitude] pairs forming the geometry.
Example
Response
GeometryAnalysis returns three lists of segments. Each segment references a range of the input coordinates by index, so you can map a classification back onto the exact part of the line it covers.
surfaceInfo[SurfaceInfo!]!
Surface-type segments. Each entry has fromIndex, toIndex, and a value of SurfaceType (for example ASPHALT, GRAVEL, DIRT).
waytypeInfo[WaytypeInfo!]!
Way-type segments. Each entry has fromIndex, toIndex, and a value of WaytypeType (for example PATH, TRACK, FOOTWAY).
slopeInfo[SlopeInfo!]!
Slope segments. Each entry has fromIndex, toIndex, and a value slope angle in degrees. Positive is uphill, negative is downhill.
The fromIndex and toIndex of each segment are inclusive indices into the coordinates array you sent. See routing for the same analysis attached to computed routes, and the playground for the full SurfaceType and WaytypeType value lists.