## Reverse geocode a coordinate `client.Geocode.ReversePost(ctx, body) (*ReverseGeocodeResult, error)` **post** `/api/v1/geocode/reverse` Reverse geocode a coordinate ### Parameters - `body GeocodeReversePostParams` - `Format param.Field[string]` Response format: json (default), geojson, csv, ndjson - `Lang param.Field[string]` Language code for localized names (e.g. en, de, fr) - `Lat param.Field[float64]` Legacy shorthand. Latitude. Use near param instead. - `Layer param.Field[string]` Filter by layer: house or poi - `Limit param.Field[int64]` Maximum results (default 1, max 20) - `Lng param.Field[float64]` Legacy shorthand. Longitude. Use near param instead. - `Near param.Field[string]` Point geometry for reverse geocode (lat,lng or GeoJSON). Alternative to lat/lng params. - `Radius param.Field[int64]` Search radius in meters (default 200, max 5000) ### Returns - `type ReverseGeocodeResult struct{…}` GeoJSON FeatureCollection of reverse geocoding results, ordered by distance from the query point. Content-Type: `application/geo+json`. - `Features []GeocodingFeature` Reverse geocoding results ordered by distance - `Geometry GeoJsonGeometry` 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. - `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 - `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` Geocoding result properties - `DisplayName string` Formatted address or place name - `Category string` POI category (e.g. restaurant, cafe, park). Present for place results. - `City string` City or town name. Present for address results. - `Confidence float64` Interpolation confidence (0-1). Present only for interpolated results. - `Country string` Country name. Present for reverse geocode address results. - `CountryCode string` ISO 3166-1 alpha-2 country code - `DistanceM float64` Distance from the query point in meters (reverse geocode / nearby only) - `FullAddress string` Complete formatted address from the database. Present for reverse geocode address results. - `HouseNumber string` House or building number. Present for address and interpolated results. - `Interpolated bool` Whether this result was estimated by address interpolation rather than an exact database match. - `Name string` Place name (raw). Present for reverse geocode place results. - `OsmID int64` OpenStreetMap element ID (null for interpolated results) - `OsmType GeocodingFeaturePropertiesOsmType` OSM element type (node, way, relation) - `const GeocodingFeaturePropertiesOsmTypeNode GeocodingFeaturePropertiesOsmType = "node"` - `const GeocodingFeaturePropertiesOsmTypeWay GeocodingFeaturePropertiesOsmType = "way"` - `const GeocodingFeaturePropertiesOsmTypeRelation GeocodingFeaturePropertiesOsmType = "relation"` - `Postcode string` Postal code. Present for reverse geocode address results. - `Score float64` Relevance score (higher is better). Incorporates text match quality, spatial proximity boost, and popularity signals. Not bounded to 0-1. - `Source GeocodingFeaturePropertiesSource` Result source indicating how the result was found: structured (exact field match), bm25 (full-text search), fuzzy (trigram similarity), address (reverse geocode address), place (reverse geocode POI), interpolation (estimated from neighboring addresses) - `const GeocodingFeaturePropertiesSourceStructured GeocodingFeaturePropertiesSource = "structured"` - `const GeocodingFeaturePropertiesSourceBm25 GeocodingFeaturePropertiesSource = "bm25"` - `const GeocodingFeaturePropertiesSourceFuzzy GeocodingFeaturePropertiesSource = "fuzzy"` - `const GeocodingFeaturePropertiesSourceAddress GeocodingFeaturePropertiesSource = "address"` - `const GeocodingFeaturePropertiesSourcePlace GeocodingFeaturePropertiesSource = "place"` - `const GeocodingFeaturePropertiesSourceInterpolation GeocodingFeaturePropertiesSource = "interpolation"` - `State string` State or province name. Present for reverse geocode address results. - `Street string` Street name. Present for address and interpolated results. - `Subcategory string` POI subcategory. Present for place results. - `Tags map[string, string]` Raw OSM tags. Present for place results. - `Wikipedia string` Wikipedia article reference (e.g. en:Eiffel Tower). Present for notable places. - `Type GeocodingFeatureType` - `const GeocodingFeatureTypeFeature GeocodingFeatureType = "Feature"` - `Type ReverseGeocodeResultType` - `const ReverseGeocodeResultTypeFeatureCollection ReverseGeocodeResultType = "FeatureCollection"` ### Example ```go 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.ReversePost(context.TODO(), githubcomplazafyiplazago.GeocodeReversePostParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", reverseGeocodeResult.Features) } ``` #### Response ```json { "features": [ { "geometry": { "coordinates": [ 2.3522, 48.8566 ], "type": "Point" }, "properties": { "display_name": "221B Baker Street, London, NW1 6XE, United Kingdom", "category": "restaurant", "city": "London", "confidence": 0, "country": "United Kingdom", "country_code": "GB", "distance_m": 0, "full_address": "221B Baker Street, London, NW1 6XE, United Kingdom", "house_number": "221B", "interpolated": true, "name": "Eiffel Tower", "osm_id": 21154906, "osm_type": "node", "postcode": "NW1 6XE", "score": 0, "source": "structured", "state": "England", "street": "Baker Street", "subcategory": "italian", "tags": { "foo": "string" }, "wikipedia": "en:Eiffel Tower" }, "type": "Feature" } ], "type": "FeatureCollection" } ```