Skip to content
GuidesPlaygroundDashboard

Look up elevation for multiple coordinates

client.Elevation.Batch(ctx, body) (*ElevationBatchResult, error)
POST/api/v1/elevation/batch

Look up elevation for multiple coordinates

ParametersExpand Collapse
body ElevationBatchParams
ElevationProfileRequest param.Field[ElevationProfileRequest]

Request body for elevation profile

ReturnsExpand Collapse
type ElevationBatchResult struct{…}

GeoJSON FeatureCollection of elevation Point Features with 3D coordinates

Elevation Point Features for each queried point

Coordinates GeoJsonGeometryCoordinatesUnion

GeoJSON coordinates array (nesting depth varies by geometry type)

One of the following:
type GeoJsonGeometryCoordinatesArray []float64
type GeoJsonGeometryCoordinatesArray [][]float64
type GeoJsonGeometryCoordinatesArray [][][]float64
type GeoJsonGeometryCoordinatesArray [][][][]float64
Type GeoJsonGeometryType
One of the following:
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 float64optional

Elevation in meters above mean sea level

Type ElevationLookupResultType
Type ElevationBatchResultType

Look up elevation for multiple coordinates

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{
    ElevationProfileRequest: githubcomplazafyiplazago.ElevationProfileRequestParam{
      Geometry: githubcomplazafyiplazago.F(githubcomplazafyiplazago.GeoJsonGeometryParam{
        Coordinates: githubcomplazafyiplazago.F[githubcomplazafyiplazago.GeoJsonGeometryCoordinatesUnionParam](githubcomplazafyiplazago.GeoJsonGeometryCoordinatesArrayParam([]float64{0.000000})),
        Type: githubcomplazafyiplazago.F(githubcomplazafyiplazago.GeoJsonGeometryTypePoint),
      }),
    },
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", elevationBatchResult.Features)
}
Returns Examples