Skip to content
GuidesPlaygroundDashboard

Query features by bounding box or H3 cell

client.Elements.Query(ctx, query) (*FeatureCollection, error)
GET/api/v1/features

Query features by bounding box or H3 cell

ParametersExpand Collapse
query ElementQueryParams
Bbox param.Field[string]optional

Bounding box: south,west,north,east. At least one of bbox or h3 is required.

Cursor param.Field[string]optional

Cursor for pagination

H3 param.Field[string]optional

H3 cell index. At least one of bbox or h3 is required.

Limit param.Field[int64]optional

Maximum results (default 100, max 10000)

Type param.Field[string]optional

Element types (comma-separated: node,way,relation)

ReturnsExpand Collapse
type FeatureCollection struct{…}

Bare GeoJSON FeatureCollection. Pagination metadata is returned in HTTP headers (X-Limit, X-Has-More, X-Next-Cursor, X-Next-Offset, Link).

Features []GeoJsonFeature
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

Type FeatureCollectionType

Query features by bounding box or H3 cell

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"),
  )
  featureCollection, err := client.Elements.Query(context.TODO(), githubcomplazafyiplazago.ElementQueryParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", featureCollection.Features)
}
Returns Examples