# Elevation ## Look up elevation at one or more points `client.Elevation.Lookup(ctx, query) (*ElevationLookupResult, error)` **get** `/api/v1/elevation` Look up elevation at one or more points ### Parameters - `query ElevationLookupParams` - `Lat param.Field[float64]` Latitude (single point) - `Lng param.Field[float64]` Longitude (single point) - `Locations param.Field[string]` Pipe-separated lng,lat pairs (batch) - `OutputFields param.Field[string]` Comma-separated property fields to include - `OutputInclude param.Field[string]` Extra computed fields: bbox, center - `OutputPrecision param.Field[int64]` Coordinate decimal precision (1-15, default 7) ### Returns - `type ElevationLookupResult struct{…}` GeoJSON Point Feature with a 3D coordinate [lng, lat, elevation] per RFC 7946 §3.1.1. The elevation is also available in `properties.elevation_m` for convenience. - `Geometry GeoJsonGeometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `Coordinates GeoJsonGeometryCoordinatesUnion` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `type GeoJsonGeometryCoordinatesPoint []float64` [longitude, latitude] or [longitude, latitude, elevation] - `type GeoJsonGeometryCoordinatesLineStringOrMultiPoint [][]float64` Array of [lng, lat] positions - `type GeoJsonGeometryCoordinatesPolygonOrMultiLineString [][][]float64` Array of linear rings / line strings - `type GeoJsonGeometryCoordinatesMultiPolygon [][][][]float64` Array of polygons - `Type GeoJsonGeometryType` Geometry type - `const GeoJsonGeometryTypePoint GeoJsonGeometryType = "Point"` - `const GeoJsonGeometryTypeLineString GeoJsonGeometryType = "LineString"` - `const GeoJsonGeometryTypePolygon GeoJsonGeometryType = "Polygon"` - `const GeoJsonGeometryTypeMultiPoint GeoJsonGeometryType = "MultiPoint"` - `const GeoJsonGeometryTypeMultiLineString GeoJsonGeometryType = "MultiLineString"` - `const GeoJsonGeometryTypeMultiPolygon GeoJsonGeometryType = "MultiPolygon"` - `Properties ElevationLookupResultProperties` - `ElevationM float64` Elevation in meters above mean sea level (WGS84 EGM96 geoid) - `Type ElevationLookupResultType` - `const ElevationLookupResultTypeFeature ElevationLookupResultType = "Feature"` ### Example ```go package main import ( "context" "fmt" "github.com/plazafyi/plaza-go" "github.com/plazafyi/plaza-go/option" ) func main() { client := githubcomplazafyiplazago.NewClient( option.WithAPIKey("My API Key"), ) elevationLookupResult, err := client.Elevation.Lookup(context.TODO(), githubcomplazafyiplazago.ElevationLookupParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", elevationLookupResult.Geometry) } ``` #### 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(ctx, body) (*ElevationLookupResult, error)` **post** `/api/v1/elevation` Look up elevation at one or more points ### Parameters - `body ElevationLookupPostParams` - `Lat param.Field[float64]` Latitude (single point) - `Lng param.Field[float64]` Longitude (single point) - `Locations param.Field[string]` Pipe-separated lng,lat pairs (batch) - `OutputFields param.Field[string]` Comma-separated property fields to include - `OutputInclude param.Field[string]` Extra computed fields: bbox, center - `OutputPrecision param.Field[int64]` Coordinate decimal precision (1-15, default 7) ### Returns - `type ElevationLookupResult struct{…}` GeoJSON Point Feature with a 3D coordinate [lng, lat, elevation] per RFC 7946 §3.1.1. The elevation is also available in `properties.elevation_m` for convenience. - `Geometry GeoJsonGeometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `Coordinates GeoJsonGeometryCoordinatesUnion` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `type GeoJsonGeometryCoordinatesPoint []float64` [longitude, latitude] or [longitude, latitude, elevation] - `type GeoJsonGeometryCoordinatesLineStringOrMultiPoint [][]float64` Array of [lng, lat] positions - `type GeoJsonGeometryCoordinatesPolygonOrMultiLineString [][][]float64` Array of linear rings / line strings - `type GeoJsonGeometryCoordinatesMultiPolygon [][][][]float64` Array of polygons - `Type GeoJsonGeometryType` Geometry type - `const GeoJsonGeometryTypePoint GeoJsonGeometryType = "Point"` - `const GeoJsonGeometryTypeLineString GeoJsonGeometryType = "LineString"` - `const GeoJsonGeometryTypePolygon GeoJsonGeometryType = "Polygon"` - `const GeoJsonGeometryTypeMultiPoint GeoJsonGeometryType = "MultiPoint"` - `const GeoJsonGeometryTypeMultiLineString GeoJsonGeometryType = "MultiLineString"` - `const GeoJsonGeometryTypeMultiPolygon GeoJsonGeometryType = "MultiPolygon"` - `Properties ElevationLookupResultProperties` - `ElevationM float64` Elevation in meters above mean sea level (WGS84 EGM96 geoid) - `Type ElevationLookupResultType` - `const ElevationLookupResultTypeFeature ElevationLookupResultType = "Feature"` ### Example ```go package main import ( "context" "fmt" "github.com/plazafyi/plaza-go" "github.com/plazafyi/plaza-go/option" ) func main() { client := githubcomplazafyiplazago.NewClient( option.WithAPIKey("My API Key"), ) elevationLookupResult, err := client.Elevation.LookupPost(context.TODO(), githubcomplazafyiplazago.ElevationLookupPostParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", elevationLookupResult.Geometry) } ``` #### 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(ctx, body) (*ElevationBatchResult, error)` **post** `/api/v1/elevation/batch` Look up elevation for multiple coordinates ### Parameters - `body ElevationBatchParams` - `Coordinates param.Field[[]ElevationBatchParamsCoordinate]` Coordinates to look up elevations for (max 50) - `Lat float64` Latitude in decimal degrees (-90 to 90) - `Lng float64` Longitude in decimal degrees (-180 to 180) ### Returns - `type ElevationBatchResult struct{…}` GeoJSON FeatureCollection of elevation Point Features with 3D coordinates. Order matches the input coordinates array. - `Features []ElevationLookupResult` Elevation results in the same order as input coordinates - `Geometry GeoJsonGeometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `Coordinates GeoJsonGeometryCoordinatesUnion` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `type GeoJsonGeometryCoordinatesPoint []float64` [longitude, latitude] or [longitude, latitude, elevation] - `type GeoJsonGeometryCoordinatesLineStringOrMultiPoint [][]float64` Array of [lng, lat] positions - `type GeoJsonGeometryCoordinatesPolygonOrMultiLineString [][][]float64` Array of linear rings / line strings - `type GeoJsonGeometryCoordinatesMultiPolygon [][][][]float64` Array of polygons - `Type GeoJsonGeometryType` Geometry type - `const GeoJsonGeometryTypePoint GeoJsonGeometryType = "Point"` - `const GeoJsonGeometryTypeLineString GeoJsonGeometryType = "LineString"` - `const GeoJsonGeometryTypePolygon GeoJsonGeometryType = "Polygon"` - `const GeoJsonGeometryTypeMultiPoint GeoJsonGeometryType = "MultiPoint"` - `const GeoJsonGeometryTypeMultiLineString GeoJsonGeometryType = "MultiLineString"` - `const GeoJsonGeometryTypeMultiPolygon GeoJsonGeometryType = "MultiPolygon"` - `Properties ElevationLookupResultProperties` - `ElevationM float64` Elevation in meters above mean sea level (WGS84 EGM96 geoid) - `Type ElevationLookupResultType` - `const ElevationLookupResultTypeFeature ElevationLookupResultType = "Feature"` - `Type ElevationBatchResultType` - `const ElevationBatchResultTypeFeatureCollection ElevationBatchResultType = "FeatureCollection"` ### Example ```go package main import ( "context" "fmt" "github.com/plazafyi/plaza-go" "github.com/plazafyi/plaza-go/option" ) func main() { client := githubcomplazafyiplazago.NewClient( option.WithAPIKey("My API Key"), ) elevationBatchResult, err := client.Elevation.Batch(context.TODO(), githubcomplazafyiplazago.ElevationBatchParams{ Coordinates: githubcomplazafyiplazago.F([]githubcomplazafyiplazago.ElevationBatchParamsCoordinate{githubcomplazafyiplazago.ElevationBatchParamsCoordinate{ Lat: githubcomplazafyiplazago.F(48.856600), Lng: githubcomplazafyiplazago.F(2.352200), }, githubcomplazafyiplazago.ElevationBatchParamsCoordinate{ Lat: githubcomplazafyiplazago.F(45.764000), Lng: githubcomplazafyiplazago.F(4.835700), }}), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", elevationBatchResult.Features) } ``` #### 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(ctx, body) (*ElevationProfileResult, error)` **post** `/api/v1/elevation/profile` Elevation profile along coordinates ### Parameters - `body ElevationProfileParams` - `ElevationProfileRequest param.Field[ElevationProfileRequest]` Request body for elevation profile along a path. Provide at least 2 coordinates defining the path. Maximum 50 coordinates per request. ### Returns - `type ElevationProfileResult struct{…}` GeoJSON LineString Feature with 3D coordinates [lng, lat, elevation] representing the elevation profile along the input path. Summary statistics are in properties. - `Geometry GeoJsonGeometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `Coordinates GeoJsonGeometryCoordinatesUnion` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `type GeoJsonGeometryCoordinatesPoint []float64` [longitude, latitude] or [longitude, latitude, elevation] - `type GeoJsonGeometryCoordinatesLineStringOrMultiPoint [][]float64` Array of [lng, lat] positions - `type GeoJsonGeometryCoordinatesPolygonOrMultiLineString [][][]float64` Array of linear rings / line strings - `type GeoJsonGeometryCoordinatesMultiPolygon [][][][]float64` Array of polygons - `Type GeoJsonGeometryType` Geometry type - `const GeoJsonGeometryTypePoint GeoJsonGeometryType = "Point"` - `const GeoJsonGeometryTypeLineString GeoJsonGeometryType = "LineString"` - `const GeoJsonGeometryTypePolygon GeoJsonGeometryType = "Polygon"` - `const GeoJsonGeometryTypeMultiPoint GeoJsonGeometryType = "MultiPoint"` - `const GeoJsonGeometryTypeMultiLineString GeoJsonGeometryType = "MultiLineString"` - `const GeoJsonGeometryTypeMultiPolygon GeoJsonGeometryType = "MultiPolygon"` - `Properties ElevationProfileResultProperties` Elevation profile summary statistics - `AvgElevationM float64` Average elevation along the profile in meters - `MaxElevationM float64` Maximum elevation along the profile in meters - `MinElevationM float64` Minimum elevation along the profile in meters - `TotalAscentM float64` Total cumulative elevation gain in meters - `TotalDescentM float64` Total cumulative elevation loss in meters - `Type ElevationProfileResultType` - `const ElevationProfileResultTypeFeature ElevationProfileResultType = "Feature"` ### Example ```go package main import ( "context" "fmt" "github.com/plazafyi/plaza-go" "github.com/plazafyi/plaza-go/option" ) func main() { client := githubcomplazafyiplazago.NewClient( option.WithAPIKey("My API Key"), ) elevationProfileResult, err := client.Elevation.Profile(context.TODO(), githubcomplazafyiplazago.ElevationProfileParams{ ElevationProfileRequest: githubcomplazafyiplazago.ElevationProfileRequestParam{ Coordinates: githubcomplazafyiplazago.F([]githubcomplazafyiplazago.ElevationProfileRequestCoordinateParam{githubcomplazafyiplazago.ElevationProfileRequestCoordinateParam{ Lat: githubcomplazafyiplazago.F(48.856600), Lng: githubcomplazafyiplazago.F(2.352200), }, githubcomplazafyiplazago.ElevationProfileRequestCoordinateParam{ Lat: githubcomplazafyiplazago.F(48.858000), Lng: githubcomplazafyiplazago.F(2.340000), }, githubcomplazafyiplazago.ElevationProfileRequestCoordinateParam{ Lat: githubcomplazafyiplazago.F(48.858400), Lng: githubcomplazafyiplazago.F(2.294500), }}), }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", elevationProfileResult.Geometry) } ``` #### 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 - `type ElevationBatchResult struct{…}` GeoJSON FeatureCollection of elevation Point Features with 3D coordinates. Order matches the input coordinates array. - `Features []ElevationLookupResult` Elevation results in the same order as input coordinates - `Geometry GeoJsonGeometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `Coordinates GeoJsonGeometryCoordinatesUnion` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `type GeoJsonGeometryCoordinatesPoint []float64` [longitude, latitude] or [longitude, latitude, elevation] - `type GeoJsonGeometryCoordinatesLineStringOrMultiPoint [][]float64` Array of [lng, lat] positions - `type GeoJsonGeometryCoordinatesPolygonOrMultiLineString [][][]float64` Array of linear rings / line strings - `type GeoJsonGeometryCoordinatesMultiPolygon [][][][]float64` Array of polygons - `Type GeoJsonGeometryType` Geometry type - `const GeoJsonGeometryTypePoint GeoJsonGeometryType = "Point"` - `const GeoJsonGeometryTypeLineString GeoJsonGeometryType = "LineString"` - `const GeoJsonGeometryTypePolygon GeoJsonGeometryType = "Polygon"` - `const GeoJsonGeometryTypeMultiPoint GeoJsonGeometryType = "MultiPoint"` - `const GeoJsonGeometryTypeMultiLineString GeoJsonGeometryType = "MultiLineString"` - `const GeoJsonGeometryTypeMultiPolygon GeoJsonGeometryType = "MultiPolygon"` - `Properties ElevationLookupResultProperties` - `ElevationM float64` Elevation in meters above mean sea level (WGS84 EGM96 geoid) - `Type ElevationLookupResultType` - `const ElevationLookupResultTypeFeature ElevationLookupResultType = "Feature"` - `Type ElevationBatchResultType` - `const ElevationBatchResultTypeFeatureCollection ElevationBatchResultType = "FeatureCollection"` ### Elevation Lookup Result - `type ElevationLookupResult struct{…}` GeoJSON Point Feature with a 3D coordinate [lng, lat, elevation] per RFC 7946 §3.1.1. The elevation is also available in `properties.elevation_m` for convenience. - `Geometry GeoJsonGeometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `Coordinates GeoJsonGeometryCoordinatesUnion` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `type GeoJsonGeometryCoordinatesPoint []float64` [longitude, latitude] or [longitude, latitude, elevation] - `type GeoJsonGeometryCoordinatesLineStringOrMultiPoint [][]float64` Array of [lng, lat] positions - `type GeoJsonGeometryCoordinatesPolygonOrMultiLineString [][][]float64` Array of linear rings / line strings - `type GeoJsonGeometryCoordinatesMultiPolygon [][][][]float64` Array of polygons - `Type GeoJsonGeometryType` Geometry type - `const GeoJsonGeometryTypePoint GeoJsonGeometryType = "Point"` - `const GeoJsonGeometryTypeLineString GeoJsonGeometryType = "LineString"` - `const GeoJsonGeometryTypePolygon GeoJsonGeometryType = "Polygon"` - `const GeoJsonGeometryTypeMultiPoint GeoJsonGeometryType = "MultiPoint"` - `const GeoJsonGeometryTypeMultiLineString GeoJsonGeometryType = "MultiLineString"` - `const GeoJsonGeometryTypeMultiPolygon GeoJsonGeometryType = "MultiPolygon"` - `Properties ElevationLookupResultProperties` - `ElevationM float64` Elevation in meters above mean sea level (WGS84 EGM96 geoid) - `Type ElevationLookupResultType` - `const ElevationLookupResultTypeFeature ElevationLookupResultType = "Feature"` ### Elevation Profile Request - `type ElevationProfileRequest struct{…}` Request body for elevation profile along a path. Provide at least 2 coordinates defining the path. Maximum 50 coordinates per request. - `Coordinates []ElevationProfileRequestCoordinate` Path coordinates in order of travel (min 2, max 50) - `Lat float64` Latitude in decimal degrees (-90 to 90) - `Lng float64` Longitude in decimal degrees (-180 to 180) ### Elevation Profile Result - `type ElevationProfileResult struct{…}` GeoJSON LineString Feature with 3D coordinates [lng, lat, elevation] representing the elevation profile along the input path. Summary statistics are in properties. - `Geometry GeoJsonGeometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `Coordinates GeoJsonGeometryCoordinatesUnion` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `type GeoJsonGeometryCoordinatesPoint []float64` [longitude, latitude] or [longitude, latitude, elevation] - `type GeoJsonGeometryCoordinatesLineStringOrMultiPoint [][]float64` Array of [lng, lat] positions - `type GeoJsonGeometryCoordinatesPolygonOrMultiLineString [][][]float64` Array of linear rings / line strings - `type GeoJsonGeometryCoordinatesMultiPolygon [][][][]float64` Array of polygons - `Type GeoJsonGeometryType` Geometry type - `const GeoJsonGeometryTypePoint GeoJsonGeometryType = "Point"` - `const GeoJsonGeometryTypeLineString GeoJsonGeometryType = "LineString"` - `const GeoJsonGeometryTypePolygon GeoJsonGeometryType = "Polygon"` - `const GeoJsonGeometryTypeMultiPoint GeoJsonGeometryType = "MultiPoint"` - `const GeoJsonGeometryTypeMultiLineString GeoJsonGeometryType = "MultiLineString"` - `const GeoJsonGeometryTypeMultiPolygon GeoJsonGeometryType = "MultiPolygon"` - `Properties ElevationProfileResultProperties` Elevation profile summary statistics - `AvgElevationM float64` Average elevation along the profile in meters - `MaxElevationM float64` Maximum elevation along the profile in meters - `MinElevationM float64` Minimum elevation along the profile in meters - `TotalAscentM float64` Total cumulative elevation gain in meters - `TotalDescentM float64` Total cumulative elevation loss in meters - `Type ElevationProfileResultType` - `const ElevationProfileResultTypeFeature ElevationProfileResultType = "Feature"`