# Elevation ## Look up elevation at one or more points `$client->elevation->lookup(?float lat, ?float lng, ?string locations, ?string outputFields, ?string outputInclude, ?int outputPrecision): ElevationLookupResult` **get** `/api/v1/elevation` Look up elevation at one or more points ### Parameters - `lat?:optional float` Latitude (single point) - `lng?:optional float` Longitude (single point) - `locations?:optional string` Pipe-separated lng,lat pairs (batch) - `outputFields?:optional string` Comma-separated property fields to include - `outputInclude?:optional string` Extra computed fields: bbox, center - `outputPrecision?:optional int` Coordinate decimal precision (1-15, default 7) ### Returns - `ElevationLookupResult` - `GeoJsonGeometry geometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `Properties properties` - `Type type` ### Example ```php elevation->lookup( lat: 0, lng: 0, locations: 'locations', outputFields: 'output[fields]', outputInclude: 'output[include]', outputPrecision: 0, ); var_dump($elevationLookupResult); ``` #### Response ```json { "geometry": { "coordinates": [ 2.3522, 48.8566 ], "type": "Point" }, "properties": { "elevation_m": 35.2 }, "type": "Feature" } ``` ## Look up elevation at one or more points `$client->elevation->lookupPost(?float lat, ?float lng, ?string locations, ?string outputFields, ?string outputInclude, ?int outputPrecision): ElevationLookupResult` **post** `/api/v1/elevation` Look up elevation at one or more points ### Parameters - `lat?:optional float` Latitude (single point) - `lng?:optional float` Longitude (single point) - `locations?:optional string` Pipe-separated lng,lat pairs (batch) - `outputFields?:optional string` Comma-separated property fields to include - `outputInclude?:optional string` Extra computed fields: bbox, center - `outputPrecision?:optional int` Coordinate decimal precision (1-15, default 7) ### Returns - `ElevationLookupResult` - `GeoJsonGeometry geometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `Properties properties` - `Type type` ### Example ```php elevation->lookupPost( lat: 0, lng: 0, locations: 'locations', outputFields: 'output[fields]', outputInclude: 'output[include]', outputPrecision: 0, ); var_dump($elevationLookupResult); ``` #### Response ```json { "geometry": { "coordinates": [ 2.3522, 48.8566 ], "type": "Point" }, "properties": { "elevation_m": 35.2 }, "type": "Feature" } ``` ## Look up elevation for multiple coordinates `$client->elevation->batch(list coordinates): ElevationBatchResult` **post** `/api/v1/elevation/batch` Look up elevation for multiple coordinates ### Parameters - `coordinates: list` Coordinates to look up elevations for (max 50) ### Returns - `ElevationBatchResult` - `list features` Elevation results in the same order as input coordinates - `Type type` ### Example ```php elevation->batch( coordinates: [ ['lat' => 48.8566, 'lng' => 2.3522], ['lat' => 45.764, 'lng' => 4.8357] ], ); var_dump($elevationBatchResult); ``` #### Response ```json { "features": [ { "geometry": { "coordinates": [ 2.3522, 48.8566 ], "type": "Point" }, "properties": { "elevation_m": 35.2 }, "type": "Feature" } ], "type": "FeatureCollection" } ``` ## Elevation profile along coordinates `$client->elevation->profile(list coordinates): ElevationProfileResult` **post** `/api/v1/elevation/profile` Elevation profile along coordinates ### Parameters - `coordinates: list` Path coordinates in order of travel (min 2, max 50) ### Returns - `ElevationProfileResult` - `GeoJsonGeometry geometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `Properties properties` Elevation profile summary statistics - `Type type` ### Example ```php elevation->profile( coordinates: [ ['lat' => 48.8566, 'lng' => 2.3522], ['lat' => 48.858, 'lng' => 2.34], ['lat' => 48.8584, 'lng' => 2.2945], ], ); var_dump($elevationProfileResult); ``` #### Response ```json { "geometry": { "coordinates": [ 2.3522, 48.8566 ], "type": "Point" }, "properties": { "avg_elevation_m": 67.8, "max_elevation_m": 155.3, "min_elevation_m": 28.1, "total_ascent_m": 127.4, "total_descent_m": 89.2 }, "type": "Feature" } ``` ## Domain Types ### Elevation Batch Result - `ElevationBatchResult` - `list features` Elevation results in the same order as input coordinates - `Type type` ### Elevation Lookup Result - `ElevationLookupResult` - `GeoJsonGeometry geometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `Properties properties` - `Type type` ### Elevation Profile Request - `ElevationProfileRequest` - `list coordinates` Path coordinates in order of travel (min 2, max 50) ### Elevation Profile Result - `ElevationProfileResult` - `GeoJsonGeometry geometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `Properties properties` Elevation profile summary statistics - `Type type`