Skip to content
GuidesPlaygroundDashboard

Reverse geocode a coordinate

client.Geocode.Reverse(ctx, query) (*ReverseGeocodeResult, error)
GET/api/v1/geocode/reverse

Reverse geocode a coordinate

ParametersExpand Collapse
query GeocodeReverseParams
Lat param.Field[float64]

Latitude

Lng param.Field[float64]

Longitude

Lang param.Field[string]optional

Language code for localized names (e.g. en, de, fr)

Layer param.Field[string]optional

Filter by layer: house or poi

Limit param.Field[int64]optional

Maximum results (default 1, max 20)

Radius param.Field[int64]optional

Search radius in meters (default 200, max 5000)

ReturnsExpand Collapse
type ReverseGeocodeResult struct{…}

GeoJSON FeatureCollection of reverse geocoding results

Features []GeocodingFeature
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 GeocodingFeatureProperties
CountryCode stringoptional

ISO 3166-1 alpha-2 country code

DisplayName stringoptional

Formatted address or place name

DistanceM float64optional

Distance in meters

OsmID int64optional

OpenStreetMap ID

OsmType stringoptional

OSM element type

Score float64optional

Match confidence score

Source stringoptional

Result source (address, place, interpolation)

Type GeocodingFeatureType
Type ReverseGeocodeResultType

Reverse geocode a coordinate

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"),
  )
  reverseGeocodeResult, err := client.Geocode.Reverse(context.TODO(), githubcomplazafyiplazago.GeocodeReverseParams{
    Lat: githubcomplazafyiplazago.F(0.000000),
    Lng: githubcomplazafyiplazago.F(0.000000),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", reverseGeocodeResult.Features)
}
Returns Examples