Skip to content
GuidesPlaygroundDashboard

Get feature by type and ID

client.Elements.Get(ctx, type_, id) (*GeoJsonFeature, error)
GET/api/v1/features/{type}/{id}

Get feature by type and ID

ParametersExpand Collapse
type_ string
id int64
ReturnsExpand Collapse
type GeoJsonFeature struct{…}
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 map[string, unknown]
Type GeoJsonFeatureType
ID stringoptional

Feature identifier (type/osm_id)

OsmID int64optional

OpenStreetMap ID

Get feature by type and ID

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"),
  )
  geoJsonFeature, err := client.Elements.Get(
    context.TODO(),
    "type",
    int64(0),
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", geoJsonFeature.ID)
}
Returns Examples