# Geocode ## Forward geocode an address `client.Geocode.Forward(ctx, query) (*GeocodeResult, error)` **get** `/api/v1/geocode` Forward geocode an address ### Parameters - `query GeocodeForwardParams` - `Q param.Field[string]` Address or place name - `Bbox param.Field[string]` Bounding box filter: south,west,north,east - `CountryCode param.Field[string]` ISO 3166-1 alpha-2 country code filter - `Lang param.Field[string]` Language code for localized names (e.g. en, de, fr) - `Lat param.Field[float64]` Focus latitude - `Layer param.Field[string]` Filter by layer: address, poi, or admin - `Limit param.Field[int64]` Maximum results (default 20, max 100) - `Lng param.Field[float64]` Focus longitude ### Returns - `type GeocodeResult struct{…}` GeoJSON FeatureCollection of forward geocoding results, ordered by relevance. Content-Type: `application/geo+json`. - `Features []GeocodingFeature` Geocoding results ordered by relevance score - `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 GeocodeResultType` - `const GeocodeResultTypeFeatureCollection GeocodeResultType = "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"), ) geocodeResult, err := client.Geocode.Forward(context.TODO(), githubcomplazafyiplazago.GeocodeForwardParams{ Q: githubcomplazafyiplazago.F("q"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", geocodeResult.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" } ``` ## Forward geocode an address `client.Geocode.ForwardPost(ctx, body) (*GeocodeResult, error)` **post** `/api/v1/geocode` Forward geocode an address ### Parameters - `body GeocodeForwardPostParams` - `Q param.Field[string]` Address or place name - `Bbox param.Field[string]` Bounding box filter: south,west,north,east - `CountryCode param.Field[string]` ISO 3166-1 alpha-2 country code filter - `Lang param.Field[string]` Language code for localized names (e.g. en, de, fr) - `Lat param.Field[float64]` Focus latitude - `Layer param.Field[string]` Filter by layer: address, poi, or admin - `Limit param.Field[int64]` Maximum results (default 20, max 100) - `Lng param.Field[float64]` Focus longitude ### Returns - `type GeocodeResult struct{…}` GeoJSON FeatureCollection of forward geocoding results, ordered by relevance. Content-Type: `application/geo+json`. - `Features []GeocodingFeature` Geocoding results ordered by relevance score - `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 GeocodeResultType` - `const GeocodeResultTypeFeatureCollection GeocodeResultType = "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"), ) geocodeResult, err := client.Geocode.ForwardPost(context.TODO(), githubcomplazafyiplazago.GeocodeForwardPostParams{ Q: githubcomplazafyiplazago.F("q"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", geocodeResult.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" } ``` ## Reverse geocode a coordinate `client.Geocode.Reverse(ctx, query) (*ReverseGeocodeResult, error)` **get** `/api/v1/geocode/reverse` Reverse geocode a coordinate ### Parameters - `query GeocodeReverseParams` - `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.Reverse(context.TODO(), githubcomplazafyiplazago.GeocodeReverseParams{ }) 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" } ``` ## Reverse geocode a coordinate `client.Geocode.ReversePost(ctx, body) (*ReverseGeocodeResult, error)` **post** `/api/v1/geocode/reverse` Reverse geocode a coordinate ### Parameters - `body GeocodeReversePostParams` - `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" } ``` ## Autocomplete a partial address `client.Geocode.Autocomplete(ctx, query) (*AutocompleteResult, error)` **get** `/api/v1/geocode/autocomplete` Autocomplete a partial address ### Parameters - `query GeocodeAutocompleteParams` - `Q param.Field[string]` Partial address query - `CountryCode param.Field[string]` ISO 3166-1 alpha-2 country code filter - `Lang param.Field[string]` Language code for localized names (e.g. en, de, fr) - `Lat param.Field[float64]` Focus latitude - `Layer param.Field[string]` Filter by layer: address, poi, or admin - `Limit param.Field[int64]` Maximum results (default 10, max 20) - `Lng param.Field[float64]` Focus longitude ### Returns - `type AutocompleteResult struct{…}` GeoJSON FeatureCollection of autocomplete suggestions for partial address input. Optimized for low-latency type-ahead UIs. Content-Type: `application/geo+json`. - `Features []GeocodingFeature` Autocomplete suggestions ordered by relevance - `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 AutocompleteResultType` - `const AutocompleteResultTypeFeatureCollection AutocompleteResultType = "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"), ) autocompleteResult, err := client.Geocode.Autocomplete(context.TODO(), githubcomplazafyiplazago.GeocodeAutocompleteParams{ Q: githubcomplazafyiplazago.F("q"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", autocompleteResult.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" } ``` ## Autocomplete a partial address `client.Geocode.AutocompletePost(ctx, body) (*AutocompleteResult, error)` **post** `/api/v1/geocode/autocomplete` Autocomplete a partial address ### Parameters - `body GeocodeAutocompletePostParams` - `Q param.Field[string]` Partial address query - `CountryCode param.Field[string]` ISO 3166-1 alpha-2 country code filter - `Lang param.Field[string]` Language code for localized names (e.g. en, de, fr) - `Lat param.Field[float64]` Focus latitude - `Layer param.Field[string]` Filter by layer: address, poi, or admin - `Limit param.Field[int64]` Maximum results (default 10, max 20) - `Lng param.Field[float64]` Focus longitude ### Returns - `type AutocompleteResult struct{…}` GeoJSON FeatureCollection of autocomplete suggestions for partial address input. Optimized for low-latency type-ahead UIs. Content-Type: `application/geo+json`. - `Features []GeocodingFeature` Autocomplete suggestions ordered by relevance - `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 AutocompleteResultType` - `const AutocompleteResultTypeFeatureCollection AutocompleteResultType = "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"), ) autocompleteResult, err := client.Geocode.AutocompletePost(context.TODO(), githubcomplazafyiplazago.GeocodeAutocompletePostParams{ Q: githubcomplazafyiplazago.F("q"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", autocompleteResult.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" } ``` ## Batch geocode multiple addresses `client.Geocode.Batch(ctx, body) (*GeocodeBatchResponse, error)` **post** `/api/v1/geocode/batch` Batch geocode multiple addresses ### Parameters - `body GeocodeBatchParams` - `Addresses param.Field[[]string]` ### Returns - `type GeocodeBatchResponse struct{…}` Batch geocoding result. Each entry in `results` is a FeatureCollection corresponding to the input address at the same index. Order is preserved. - `Count int64` Number of addresses processed (always equals length of results) - `Results []GeocodeResult` Array of FeatureCollections, one per input address. Empty FeatureCollections indicate no match. - `Features []GeocodingFeature` Geocoding results ordered by relevance score - `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 GeocodeResultType` - `const GeocodeResultTypeFeatureCollection GeocodeResultType = "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"), ) response, err := client.Geocode.Batch(context.TODO(), githubcomplazafyiplazago.GeocodeBatchParams{ Addresses: githubcomplazafyiplazago.F([]string{"string"}), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Count) } ``` #### Response ```json { "count": 0, "results": [ { "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" } ] } ``` ## Domain Types ### Autocomplete Result - `type AutocompleteResult struct{…}` GeoJSON FeatureCollection of autocomplete suggestions for partial address input. Optimized for low-latency type-ahead UIs. Content-Type: `application/geo+json`. - `Features []GeocodingFeature` Autocomplete suggestions ordered by relevance - `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 AutocompleteResultType` - `const AutocompleteResultTypeFeatureCollection AutocompleteResultType = "FeatureCollection"` ### Geocode Result - `type GeocodeResult struct{…}` GeoJSON FeatureCollection of forward geocoding results, ordered by relevance. Content-Type: `application/geo+json`. - `Features []GeocodingFeature` Geocoding results ordered by relevance score - `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 GeocodeResultType` - `const GeocodeResultTypeFeatureCollection GeocodeResultType = "FeatureCollection"` ### Geocoding Feature - `type GeocodingFeature struct{…}` GeoJSON Feature representing a geocoding result. The geometry is always a Point. Properties include the formatted display name, OSM metadata, confidence score, and source type. - `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"` ### Reverse Geocode Result - `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"`