Skip to content
GuidesBlogPlaygroundDashboard

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

ParametersExpand Collapse
body ElevationLookupPostParams
Format param.Field[string]optional

Response format: json (default), geojson, csv, ndjson

Lat param.Field[float64]optional

Latitude (single point)

Lng param.Field[float64]optional

Longitude (single point)

Locations param.Field[string]optional

Pipe-separated lng,lat pairs (batch)

OutputFields param.Field[string]optional

Comma-separated property fields to include

OutputInclude param.Field[string]optional

Extra computed fields: bbox, center

OutputPrecision param.Field[int64]optional

Coordinate decimal precision (1-15, default 7)

ReturnsExpand Collapse
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.

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.

One of the following:
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

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 float64

Elevation in meters above mean sea level (WGS84 EGM96 geoid)

Type ElevationLookupResultType

Look up elevation at one or more points

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)
}
{
  "geometry": {
    "coordinates": [
      2.3522,
      48.8566
    ],
    "type": "Point"
  },
  "properties": {
    "elevation_m": 35.2
  },
  "type": "Feature"
}
Returns Examples
{
  "geometry": {
    "coordinates": [
      2.3522,
      48.8566
    ],
    "type": "Point"
  },
  "properties": {
    "elevation_m": 35.2
  },
  "type": "Feature"
}