# Geocode ## Forward geocode an address `GeocodeResult geocode().forward(GeocodeForwardParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **get** `/api/v1/geocode` Forward geocode an address ### Parameters - `GeocodeForwardParams params` - `String q` Address or place name - `Optional bbox` Bounding box filter: south,west,north,east - `Optional countryCode` ISO 3166-1 alpha-2 country code filter - `Optional lang` Language code for localized names (e.g. en, de, fr) - `Optional lat` Focus latitude - `Optional layer` Filter by layer: address, poi, or admin - `Optional limit` Maximum results (default 20, max 100) - `Optional lng` Focus longitude ### Returns - `class GeocodeResult:` GeoJSON FeatureCollection of forward geocoding results, ordered by relevance. Content-Type: `application/geo+json`. - `List features` Geocoding results ordered by relevance score - `GeoJsonGeometry geometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `Coordinates coordinates` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `List` - `List>` - `List>>` - `List>>>` - `Type type` Geometry type - `POINT("Point")` - `LINE_STRING("LineString")` - `POLYGON("Polygon")` - `MULTI_POINT("MultiPoint")` - `MULTI_LINE_STRING("MultiLineString")` - `MULTI_POLYGON("MultiPolygon")` - `Properties properties` Geocoding result properties - `String displayName` Formatted address or place name - `Optional category` POI category (e.g. restaurant, cafe, park). Present for place results. - `Optional city` City or town name. Present for address results. - `Optional confidence` Interpolation confidence (0-1). Present only for interpolated results. - `Optional country` Country name. Present for reverse geocode address results. - `Optional countryCode` ISO 3166-1 alpha-2 country code - `Optional distanceM` Distance from the query point in meters (reverse geocode / nearby only) - `Optional fullAddress` Complete formatted address from the database. Present for reverse geocode address results. - `Optional houseNumber` House or building number. Present for address and interpolated results. - `Optional interpolated` Whether this result was estimated by address interpolation rather than an exact database match. - `Optional name` Place name (raw). Present for reverse geocode place results. - `Optional osmId` OpenStreetMap element ID (null for interpolated results) - `Optional osmType` OSM element type (node, way, relation) - `NODE("node")` - `WAY("way")` - `RELATION("relation")` - `Optional postcode` Postal code. Present for reverse geocode address results. - `Optional score` Relevance score (higher is better). Incorporates text match quality, spatial proximity boost, and popularity signals. Not bounded to 0-1. - `Optional source` 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) - `STRUCTURED("structured")` - `BM25("bm25")` - `FUZZY("fuzzy")` - `ADDRESS("address")` - `PLACE("place")` - `INTERPOLATION("interpolation")` - `Optional state` State or province name. Present for reverse geocode address results. - `Optional street` Street name. Present for address and interpolated results. - `Optional subcategory` POI subcategory. Present for place results. - `Optional tags` Raw OSM tags. Present for place results. - `Optional wikipedia` Wikipedia article reference (e.g. en:Eiffel Tower). Present for notable places. - `Type type` - `FEATURE("Feature")` - `Type type` - `FEATURE_COLLECTION("FeatureCollection")` ### Example ```java package com.plazafyi.example; import com.plazafyi.client.PlazaClient; import com.plazafyi.client.okhttp.PlazaOkHttpClient; import com.plazafyi.models.geocode.GeocodeForwardParams; import com.plazafyi.models.geocode.GeocodeResult; public final class Main { private Main() {} public static void main(String[] args) { PlazaClient client = PlazaOkHttpClient.fromEnv(); GeocodeForwardParams params = GeocodeForwardParams.builder() .q("q") .build(); GeocodeResult geocodeResult = client.geocode().forward(params); } } ``` #### 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 `GeocodeResult geocode().forwardPost(GeocodeForwardPostParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **post** `/api/v1/geocode` Forward geocode an address ### Parameters - `GeocodeForwardPostParams params` - `String q` Address or place name - `Optional bbox` Bounding box filter: south,west,north,east - `Optional countryCode` ISO 3166-1 alpha-2 country code filter - `Optional lang` Language code for localized names (e.g. en, de, fr) - `Optional lat` Focus latitude - `Optional layer` Filter by layer: address, poi, or admin - `Optional limit` Maximum results (default 20, max 100) - `Optional lng` Focus longitude ### Returns - `class GeocodeResult:` GeoJSON FeatureCollection of forward geocoding results, ordered by relevance. Content-Type: `application/geo+json`. - `List features` Geocoding results ordered by relevance score - `GeoJsonGeometry geometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `Coordinates coordinates` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `List` - `List>` - `List>>` - `List>>>` - `Type type` Geometry type - `POINT("Point")` - `LINE_STRING("LineString")` - `POLYGON("Polygon")` - `MULTI_POINT("MultiPoint")` - `MULTI_LINE_STRING("MultiLineString")` - `MULTI_POLYGON("MultiPolygon")` - `Properties properties` Geocoding result properties - `String displayName` Formatted address or place name - `Optional category` POI category (e.g. restaurant, cafe, park). Present for place results. - `Optional city` City or town name. Present for address results. - `Optional confidence` Interpolation confidence (0-1). Present only for interpolated results. - `Optional country` Country name. Present for reverse geocode address results. - `Optional countryCode` ISO 3166-1 alpha-2 country code - `Optional distanceM` Distance from the query point in meters (reverse geocode / nearby only) - `Optional fullAddress` Complete formatted address from the database. Present for reverse geocode address results. - `Optional houseNumber` House or building number. Present for address and interpolated results. - `Optional interpolated` Whether this result was estimated by address interpolation rather than an exact database match. - `Optional name` Place name (raw). Present for reverse geocode place results. - `Optional osmId` OpenStreetMap element ID (null for interpolated results) - `Optional osmType` OSM element type (node, way, relation) - `NODE("node")` - `WAY("way")` - `RELATION("relation")` - `Optional postcode` Postal code. Present for reverse geocode address results. - `Optional score` Relevance score (higher is better). Incorporates text match quality, spatial proximity boost, and popularity signals. Not bounded to 0-1. - `Optional source` 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) - `STRUCTURED("structured")` - `BM25("bm25")` - `FUZZY("fuzzy")` - `ADDRESS("address")` - `PLACE("place")` - `INTERPOLATION("interpolation")` - `Optional state` State or province name. Present for reverse geocode address results. - `Optional street` Street name. Present for address and interpolated results. - `Optional subcategory` POI subcategory. Present for place results. - `Optional tags` Raw OSM tags. Present for place results. - `Optional wikipedia` Wikipedia article reference (e.g. en:Eiffel Tower). Present for notable places. - `Type type` - `FEATURE("Feature")` - `Type type` - `FEATURE_COLLECTION("FeatureCollection")` ### Example ```java package com.plazafyi.example; import com.plazafyi.client.PlazaClient; import com.plazafyi.client.okhttp.PlazaOkHttpClient; import com.plazafyi.models.geocode.GeocodeForwardPostParams; import com.plazafyi.models.geocode.GeocodeResult; public final class Main { private Main() {} public static void main(String[] args) { PlazaClient client = PlazaOkHttpClient.fromEnv(); GeocodeForwardPostParams params = GeocodeForwardPostParams.builder() .q("q") .build(); GeocodeResult geocodeResult = client.geocode().forwardPost(params); } } ``` #### 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 `ReverseGeocodeResult geocode().reverse(GeocodeReverseParamsparams = GeocodeReverseParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` **get** `/api/v1/geocode/reverse` Reverse geocode a coordinate ### Parameters - `GeocodeReverseParams params` - `Optional lang` Language code for localized names (e.g. en, de, fr) - `Optional lat` Legacy shorthand. Latitude. Use near param instead. - `Optional layer` Filter by layer: house or poi - `Optional limit` Maximum results (default 1, max 20) - `Optional lng` Legacy shorthand. Longitude. Use near param instead. - `Optional near` Point geometry for reverse geocode (lat,lng or GeoJSON). Alternative to lat/lng params. - `Optional radius` Search radius in meters (default 200, max 5000) ### Returns - `class ReverseGeocodeResult:` GeoJSON FeatureCollection of reverse geocoding results, ordered by distance from the query point. Content-Type: `application/geo+json`. - `List features` Reverse geocoding results ordered by distance - `GeoJsonGeometry geometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `Coordinates coordinates` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `List` - `List>` - `List>>` - `List>>>` - `Type type` Geometry type - `POINT("Point")` - `LINE_STRING("LineString")` - `POLYGON("Polygon")` - `MULTI_POINT("MultiPoint")` - `MULTI_LINE_STRING("MultiLineString")` - `MULTI_POLYGON("MultiPolygon")` - `Properties properties` Geocoding result properties - `String displayName` Formatted address or place name - `Optional category` POI category (e.g. restaurant, cafe, park). Present for place results. - `Optional city` City or town name. Present for address results. - `Optional confidence` Interpolation confidence (0-1). Present only for interpolated results. - `Optional country` Country name. Present for reverse geocode address results. - `Optional countryCode` ISO 3166-1 alpha-2 country code - `Optional distanceM` Distance from the query point in meters (reverse geocode / nearby only) - `Optional fullAddress` Complete formatted address from the database. Present for reverse geocode address results. - `Optional houseNumber` House or building number. Present for address and interpolated results. - `Optional interpolated` Whether this result was estimated by address interpolation rather than an exact database match. - `Optional name` Place name (raw). Present for reverse geocode place results. - `Optional osmId` OpenStreetMap element ID (null for interpolated results) - `Optional osmType` OSM element type (node, way, relation) - `NODE("node")` - `WAY("way")` - `RELATION("relation")` - `Optional postcode` Postal code. Present for reverse geocode address results. - `Optional score` Relevance score (higher is better). Incorporates text match quality, spatial proximity boost, and popularity signals. Not bounded to 0-1. - `Optional source` 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) - `STRUCTURED("structured")` - `BM25("bm25")` - `FUZZY("fuzzy")` - `ADDRESS("address")` - `PLACE("place")` - `INTERPOLATION("interpolation")` - `Optional state` State or province name. Present for reverse geocode address results. - `Optional street` Street name. Present for address and interpolated results. - `Optional subcategory` POI subcategory. Present for place results. - `Optional tags` Raw OSM tags. Present for place results. - `Optional wikipedia` Wikipedia article reference (e.g. en:Eiffel Tower). Present for notable places. - `Type type` - `FEATURE("Feature")` - `Type type` - `FEATURE_COLLECTION("FeatureCollection")` ### Example ```java package com.plazafyi.example; import com.plazafyi.client.PlazaClient; import com.plazafyi.client.okhttp.PlazaOkHttpClient; import com.plazafyi.models.geocode.GeocodeReverseParams; import com.plazafyi.models.geocode.ReverseGeocodeResult; public final class Main { private Main() {} public static void main(String[] args) { PlazaClient client = PlazaOkHttpClient.fromEnv(); ReverseGeocodeResult reverseGeocodeResult = client.geocode().reverse(); } } ``` #### 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 `ReverseGeocodeResult geocode().reversePost(GeocodeReversePostParamsparams = GeocodeReversePostParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` **post** `/api/v1/geocode/reverse` Reverse geocode a coordinate ### Parameters - `GeocodeReversePostParams params` - `Optional lang` Language code for localized names (e.g. en, de, fr) - `Optional lat` Legacy shorthand. Latitude. Use near param instead. - `Optional layer` Filter by layer: house or poi - `Optional limit` Maximum results (default 1, max 20) - `Optional lng` Legacy shorthand. Longitude. Use near param instead. - `Optional near` Point geometry for reverse geocode (lat,lng or GeoJSON). Alternative to lat/lng params. - `Optional radius` Search radius in meters (default 200, max 5000) ### Returns - `class ReverseGeocodeResult:` GeoJSON FeatureCollection of reverse geocoding results, ordered by distance from the query point. Content-Type: `application/geo+json`. - `List features` Reverse geocoding results ordered by distance - `GeoJsonGeometry geometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `Coordinates coordinates` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `List` - `List>` - `List>>` - `List>>>` - `Type type` Geometry type - `POINT("Point")` - `LINE_STRING("LineString")` - `POLYGON("Polygon")` - `MULTI_POINT("MultiPoint")` - `MULTI_LINE_STRING("MultiLineString")` - `MULTI_POLYGON("MultiPolygon")` - `Properties properties` Geocoding result properties - `String displayName` Formatted address or place name - `Optional category` POI category (e.g. restaurant, cafe, park). Present for place results. - `Optional city` City or town name. Present for address results. - `Optional confidence` Interpolation confidence (0-1). Present only for interpolated results. - `Optional country` Country name. Present for reverse geocode address results. - `Optional countryCode` ISO 3166-1 alpha-2 country code - `Optional distanceM` Distance from the query point in meters (reverse geocode / nearby only) - `Optional fullAddress` Complete formatted address from the database. Present for reverse geocode address results. - `Optional houseNumber` House or building number. Present for address and interpolated results. - `Optional interpolated` Whether this result was estimated by address interpolation rather than an exact database match. - `Optional name` Place name (raw). Present for reverse geocode place results. - `Optional osmId` OpenStreetMap element ID (null for interpolated results) - `Optional osmType` OSM element type (node, way, relation) - `NODE("node")` - `WAY("way")` - `RELATION("relation")` - `Optional postcode` Postal code. Present for reverse geocode address results. - `Optional score` Relevance score (higher is better). Incorporates text match quality, spatial proximity boost, and popularity signals. Not bounded to 0-1. - `Optional source` 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) - `STRUCTURED("structured")` - `BM25("bm25")` - `FUZZY("fuzzy")` - `ADDRESS("address")` - `PLACE("place")` - `INTERPOLATION("interpolation")` - `Optional state` State or province name. Present for reverse geocode address results. - `Optional street` Street name. Present for address and interpolated results. - `Optional subcategory` POI subcategory. Present for place results. - `Optional tags` Raw OSM tags. Present for place results. - `Optional wikipedia` Wikipedia article reference (e.g. en:Eiffel Tower). Present for notable places. - `Type type` - `FEATURE("Feature")` - `Type type` - `FEATURE_COLLECTION("FeatureCollection")` ### Example ```java package com.plazafyi.example; import com.plazafyi.client.PlazaClient; import com.plazafyi.client.okhttp.PlazaOkHttpClient; import com.plazafyi.models.geocode.GeocodeReversePostParams; import com.plazafyi.models.geocode.ReverseGeocodeResult; public final class Main { private Main() {} public static void main(String[] args) { PlazaClient client = PlazaOkHttpClient.fromEnv(); ReverseGeocodeResult reverseGeocodeResult = client.geocode().reversePost(); } } ``` #### 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 `AutocompleteResult geocode().autocomplete(GeocodeAutocompleteParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **get** `/api/v1/geocode/autocomplete` Autocomplete a partial address ### Parameters - `GeocodeAutocompleteParams params` - `String q` Partial address query - `Optional countryCode` ISO 3166-1 alpha-2 country code filter - `Optional lang` Language code for localized names (e.g. en, de, fr) - `Optional lat` Focus latitude - `Optional layer` Filter by layer: address, poi, or admin - `Optional limit` Maximum results (default 10, max 20) - `Optional lng` Focus longitude ### Returns - `class AutocompleteResult:` GeoJSON FeatureCollection of autocomplete suggestions for partial address input. Optimized for low-latency type-ahead UIs. Content-Type: `application/geo+json`. - `List features` Autocomplete suggestions ordered by relevance - `GeoJsonGeometry geometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `Coordinates coordinates` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `List` - `List>` - `List>>` - `List>>>` - `Type type` Geometry type - `POINT("Point")` - `LINE_STRING("LineString")` - `POLYGON("Polygon")` - `MULTI_POINT("MultiPoint")` - `MULTI_LINE_STRING("MultiLineString")` - `MULTI_POLYGON("MultiPolygon")` - `Properties properties` Geocoding result properties - `String displayName` Formatted address or place name - `Optional category` POI category (e.g. restaurant, cafe, park). Present for place results. - `Optional city` City or town name. Present for address results. - `Optional confidence` Interpolation confidence (0-1). Present only for interpolated results. - `Optional country` Country name. Present for reverse geocode address results. - `Optional countryCode` ISO 3166-1 alpha-2 country code - `Optional distanceM` Distance from the query point in meters (reverse geocode / nearby only) - `Optional fullAddress` Complete formatted address from the database. Present for reverse geocode address results. - `Optional houseNumber` House or building number. Present for address and interpolated results. - `Optional interpolated` Whether this result was estimated by address interpolation rather than an exact database match. - `Optional name` Place name (raw). Present for reverse geocode place results. - `Optional osmId` OpenStreetMap element ID (null for interpolated results) - `Optional osmType` OSM element type (node, way, relation) - `NODE("node")` - `WAY("way")` - `RELATION("relation")` - `Optional postcode` Postal code. Present for reverse geocode address results. - `Optional score` Relevance score (higher is better). Incorporates text match quality, spatial proximity boost, and popularity signals. Not bounded to 0-1. - `Optional source` 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) - `STRUCTURED("structured")` - `BM25("bm25")` - `FUZZY("fuzzy")` - `ADDRESS("address")` - `PLACE("place")` - `INTERPOLATION("interpolation")` - `Optional state` State or province name. Present for reverse geocode address results. - `Optional street` Street name. Present for address and interpolated results. - `Optional subcategory` POI subcategory. Present for place results. - `Optional tags` Raw OSM tags. Present for place results. - `Optional wikipedia` Wikipedia article reference (e.g. en:Eiffel Tower). Present for notable places. - `Type type` - `FEATURE("Feature")` - `Type type` - `FEATURE_COLLECTION("FeatureCollection")` ### Example ```java package com.plazafyi.example; import com.plazafyi.client.PlazaClient; import com.plazafyi.client.okhttp.PlazaOkHttpClient; import com.plazafyi.models.geocode.AutocompleteResult; import com.plazafyi.models.geocode.GeocodeAutocompleteParams; public final class Main { private Main() {} public static void main(String[] args) { PlazaClient client = PlazaOkHttpClient.fromEnv(); GeocodeAutocompleteParams params = GeocodeAutocompleteParams.builder() .q("q") .build(); AutocompleteResult autocompleteResult = client.geocode().autocomplete(params); } } ``` #### 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 `AutocompleteResult geocode().autocompletePost(GeocodeAutocompletePostParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **post** `/api/v1/geocode/autocomplete` Autocomplete a partial address ### Parameters - `GeocodeAutocompletePostParams params` - `String q` Partial address query - `Optional countryCode` ISO 3166-1 alpha-2 country code filter - `Optional lang` Language code for localized names (e.g. en, de, fr) - `Optional lat` Focus latitude - `Optional layer` Filter by layer: address, poi, or admin - `Optional limit` Maximum results (default 10, max 20) - `Optional lng` Focus longitude ### Returns - `class AutocompleteResult:` GeoJSON FeatureCollection of autocomplete suggestions for partial address input. Optimized for low-latency type-ahead UIs. Content-Type: `application/geo+json`. - `List features` Autocomplete suggestions ordered by relevance - `GeoJsonGeometry geometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `Coordinates coordinates` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `List` - `List>` - `List>>` - `List>>>` - `Type type` Geometry type - `POINT("Point")` - `LINE_STRING("LineString")` - `POLYGON("Polygon")` - `MULTI_POINT("MultiPoint")` - `MULTI_LINE_STRING("MultiLineString")` - `MULTI_POLYGON("MultiPolygon")` - `Properties properties` Geocoding result properties - `String displayName` Formatted address or place name - `Optional category` POI category (e.g. restaurant, cafe, park). Present for place results. - `Optional city` City or town name. Present for address results. - `Optional confidence` Interpolation confidence (0-1). Present only for interpolated results. - `Optional country` Country name. Present for reverse geocode address results. - `Optional countryCode` ISO 3166-1 alpha-2 country code - `Optional distanceM` Distance from the query point in meters (reverse geocode / nearby only) - `Optional fullAddress` Complete formatted address from the database. Present for reverse geocode address results. - `Optional houseNumber` House or building number. Present for address and interpolated results. - `Optional interpolated` Whether this result was estimated by address interpolation rather than an exact database match. - `Optional name` Place name (raw). Present for reverse geocode place results. - `Optional osmId` OpenStreetMap element ID (null for interpolated results) - `Optional osmType` OSM element type (node, way, relation) - `NODE("node")` - `WAY("way")` - `RELATION("relation")` - `Optional postcode` Postal code. Present for reverse geocode address results. - `Optional score` Relevance score (higher is better). Incorporates text match quality, spatial proximity boost, and popularity signals. Not bounded to 0-1. - `Optional source` 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) - `STRUCTURED("structured")` - `BM25("bm25")` - `FUZZY("fuzzy")` - `ADDRESS("address")` - `PLACE("place")` - `INTERPOLATION("interpolation")` - `Optional state` State or province name. Present for reverse geocode address results. - `Optional street` Street name. Present for address and interpolated results. - `Optional subcategory` POI subcategory. Present for place results. - `Optional tags` Raw OSM tags. Present for place results. - `Optional wikipedia` Wikipedia article reference (e.g. en:Eiffel Tower). Present for notable places. - `Type type` - `FEATURE("Feature")` - `Type type` - `FEATURE_COLLECTION("FeatureCollection")` ### Example ```java package com.plazafyi.example; import com.plazafyi.client.PlazaClient; import com.plazafyi.client.okhttp.PlazaOkHttpClient; import com.plazafyi.models.geocode.AutocompleteResult; import com.plazafyi.models.geocode.GeocodeAutocompletePostParams; public final class Main { private Main() {} public static void main(String[] args) { PlazaClient client = PlazaOkHttpClient.fromEnv(); GeocodeAutocompletePostParams params = GeocodeAutocompletePostParams.builder() .q("q") .build(); AutocompleteResult autocompleteResult = client.geocode().autocompletePost(params); } } ``` #### 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 `GeocodeBatchResponse geocode().batch(GeocodeBatchParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **post** `/api/v1/geocode/batch` Batch geocode multiple addresses ### Parameters - `GeocodeBatchParams params` - `List addresses` ### Returns - `class GeocodeBatchResponse:` Batch geocoding result. Each entry in `results` is a FeatureCollection corresponding to the input address at the same index. Order is preserved. - `long count` Number of addresses processed (always equals length of results) - `List results` Array of FeatureCollections, one per input address. Empty FeatureCollections indicate no match. - `List features` Geocoding results ordered by relevance score - `GeoJsonGeometry geometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `Coordinates coordinates` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `List` - `List>` - `List>>` - `List>>>` - `Type type` Geometry type - `POINT("Point")` - `LINE_STRING("LineString")` - `POLYGON("Polygon")` - `MULTI_POINT("MultiPoint")` - `MULTI_LINE_STRING("MultiLineString")` - `MULTI_POLYGON("MultiPolygon")` - `Properties properties` Geocoding result properties - `String displayName` Formatted address or place name - `Optional category` POI category (e.g. restaurant, cafe, park). Present for place results. - `Optional city` City or town name. Present for address results. - `Optional confidence` Interpolation confidence (0-1). Present only for interpolated results. - `Optional country` Country name. Present for reverse geocode address results. - `Optional countryCode` ISO 3166-1 alpha-2 country code - `Optional distanceM` Distance from the query point in meters (reverse geocode / nearby only) - `Optional fullAddress` Complete formatted address from the database. Present for reverse geocode address results. - `Optional houseNumber` House or building number. Present for address and interpolated results. - `Optional interpolated` Whether this result was estimated by address interpolation rather than an exact database match. - `Optional name` Place name (raw). Present for reverse geocode place results. - `Optional osmId` OpenStreetMap element ID (null for interpolated results) - `Optional osmType` OSM element type (node, way, relation) - `NODE("node")` - `WAY("way")` - `RELATION("relation")` - `Optional postcode` Postal code. Present for reverse geocode address results. - `Optional score` Relevance score (higher is better). Incorporates text match quality, spatial proximity boost, and popularity signals. Not bounded to 0-1. - `Optional source` 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) - `STRUCTURED("structured")` - `BM25("bm25")` - `FUZZY("fuzzy")` - `ADDRESS("address")` - `PLACE("place")` - `INTERPOLATION("interpolation")` - `Optional state` State or province name. Present for reverse geocode address results. - `Optional street` Street name. Present for address and interpolated results. - `Optional subcategory` POI subcategory. Present for place results. - `Optional tags` Raw OSM tags. Present for place results. - `Optional wikipedia` Wikipedia article reference (e.g. en:Eiffel Tower). Present for notable places. - `Type type` - `FEATURE("Feature")` - `Type type` - `FEATURE_COLLECTION("FeatureCollection")` ### Example ```java package com.plazafyi.example; import com.plazafyi.client.PlazaClient; import com.plazafyi.client.okhttp.PlazaOkHttpClient; import com.plazafyi.models.geocode.GeocodeBatchParams; import com.plazafyi.models.geocode.GeocodeBatchResponse; public final class Main { private Main() {} public static void main(String[] args) { PlazaClient client = PlazaOkHttpClient.fromEnv(); GeocodeBatchParams params = GeocodeBatchParams.builder() .addAddress("string") .build(); GeocodeBatchResponse response = client.geocode().batch(params); } } ``` #### 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 - `class AutocompleteResult:` GeoJSON FeatureCollection of autocomplete suggestions for partial address input. Optimized for low-latency type-ahead UIs. Content-Type: `application/geo+json`. - `List features` Autocomplete suggestions ordered by relevance - `GeoJsonGeometry geometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `Coordinates coordinates` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `List` - `List>` - `List>>` - `List>>>` - `Type type` Geometry type - `POINT("Point")` - `LINE_STRING("LineString")` - `POLYGON("Polygon")` - `MULTI_POINT("MultiPoint")` - `MULTI_LINE_STRING("MultiLineString")` - `MULTI_POLYGON("MultiPolygon")` - `Properties properties` Geocoding result properties - `String displayName` Formatted address or place name - `Optional category` POI category (e.g. restaurant, cafe, park). Present for place results. - `Optional city` City or town name. Present for address results. - `Optional confidence` Interpolation confidence (0-1). Present only for interpolated results. - `Optional country` Country name. Present for reverse geocode address results. - `Optional countryCode` ISO 3166-1 alpha-2 country code - `Optional distanceM` Distance from the query point in meters (reverse geocode / nearby only) - `Optional fullAddress` Complete formatted address from the database. Present for reverse geocode address results. - `Optional houseNumber` House or building number. Present for address and interpolated results. - `Optional interpolated` Whether this result was estimated by address interpolation rather than an exact database match. - `Optional name` Place name (raw). Present for reverse geocode place results. - `Optional osmId` OpenStreetMap element ID (null for interpolated results) - `Optional osmType` OSM element type (node, way, relation) - `NODE("node")` - `WAY("way")` - `RELATION("relation")` - `Optional postcode` Postal code. Present for reverse geocode address results. - `Optional score` Relevance score (higher is better). Incorporates text match quality, spatial proximity boost, and popularity signals. Not bounded to 0-1. - `Optional source` 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) - `STRUCTURED("structured")` - `BM25("bm25")` - `FUZZY("fuzzy")` - `ADDRESS("address")` - `PLACE("place")` - `INTERPOLATION("interpolation")` - `Optional state` State or province name. Present for reverse geocode address results. - `Optional street` Street name. Present for address and interpolated results. - `Optional subcategory` POI subcategory. Present for place results. - `Optional tags` Raw OSM tags. Present for place results. - `Optional wikipedia` Wikipedia article reference (e.g. en:Eiffel Tower). Present for notable places. - `Type type` - `FEATURE("Feature")` - `Type type` - `FEATURE_COLLECTION("FeatureCollection")` ### Geocode Result - `class GeocodeResult:` GeoJSON FeatureCollection of forward geocoding results, ordered by relevance. Content-Type: `application/geo+json`. - `List features` Geocoding results ordered by relevance score - `GeoJsonGeometry geometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `Coordinates coordinates` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `List` - `List>` - `List>>` - `List>>>` - `Type type` Geometry type - `POINT("Point")` - `LINE_STRING("LineString")` - `POLYGON("Polygon")` - `MULTI_POINT("MultiPoint")` - `MULTI_LINE_STRING("MultiLineString")` - `MULTI_POLYGON("MultiPolygon")` - `Properties properties` Geocoding result properties - `String displayName` Formatted address or place name - `Optional category` POI category (e.g. restaurant, cafe, park). Present for place results. - `Optional city` City or town name. Present for address results. - `Optional confidence` Interpolation confidence (0-1). Present only for interpolated results. - `Optional country` Country name. Present for reverse geocode address results. - `Optional countryCode` ISO 3166-1 alpha-2 country code - `Optional distanceM` Distance from the query point in meters (reverse geocode / nearby only) - `Optional fullAddress` Complete formatted address from the database. Present for reverse geocode address results. - `Optional houseNumber` House or building number. Present for address and interpolated results. - `Optional interpolated` Whether this result was estimated by address interpolation rather than an exact database match. - `Optional name` Place name (raw). Present for reverse geocode place results. - `Optional osmId` OpenStreetMap element ID (null for interpolated results) - `Optional osmType` OSM element type (node, way, relation) - `NODE("node")` - `WAY("way")` - `RELATION("relation")` - `Optional postcode` Postal code. Present for reverse geocode address results. - `Optional score` Relevance score (higher is better). Incorporates text match quality, spatial proximity boost, and popularity signals. Not bounded to 0-1. - `Optional source` 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) - `STRUCTURED("structured")` - `BM25("bm25")` - `FUZZY("fuzzy")` - `ADDRESS("address")` - `PLACE("place")` - `INTERPOLATION("interpolation")` - `Optional state` State or province name. Present for reverse geocode address results. - `Optional street` Street name. Present for address and interpolated results. - `Optional subcategory` POI subcategory. Present for place results. - `Optional tags` Raw OSM tags. Present for place results. - `Optional wikipedia` Wikipedia article reference (e.g. en:Eiffel Tower). Present for notable places. - `Type type` - `FEATURE("Feature")` - `Type type` - `FEATURE_COLLECTION("FeatureCollection")` ### Geocoding Feature - `class GeocodingFeature:` 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. - `GeoJsonGeometry geometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `Coordinates coordinates` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `List` - `List>` - `List>>` - `List>>>` - `Type type` Geometry type - `POINT("Point")` - `LINE_STRING("LineString")` - `POLYGON("Polygon")` - `MULTI_POINT("MultiPoint")` - `MULTI_LINE_STRING("MultiLineString")` - `MULTI_POLYGON("MultiPolygon")` - `Properties properties` Geocoding result properties - `String displayName` Formatted address or place name - `Optional category` POI category (e.g. restaurant, cafe, park). Present for place results. - `Optional city` City or town name. Present for address results. - `Optional confidence` Interpolation confidence (0-1). Present only for interpolated results. - `Optional country` Country name. Present for reverse geocode address results. - `Optional countryCode` ISO 3166-1 alpha-2 country code - `Optional distanceM` Distance from the query point in meters (reverse geocode / nearby only) - `Optional fullAddress` Complete formatted address from the database. Present for reverse geocode address results. - `Optional houseNumber` House or building number. Present for address and interpolated results. - `Optional interpolated` Whether this result was estimated by address interpolation rather than an exact database match. - `Optional name` Place name (raw). Present for reverse geocode place results. - `Optional osmId` OpenStreetMap element ID (null for interpolated results) - `Optional osmType` OSM element type (node, way, relation) - `NODE("node")` - `WAY("way")` - `RELATION("relation")` - `Optional postcode` Postal code. Present for reverse geocode address results. - `Optional score` Relevance score (higher is better). Incorporates text match quality, spatial proximity boost, and popularity signals. Not bounded to 0-1. - `Optional source` 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) - `STRUCTURED("structured")` - `BM25("bm25")` - `FUZZY("fuzzy")` - `ADDRESS("address")` - `PLACE("place")` - `INTERPOLATION("interpolation")` - `Optional state` State or province name. Present for reverse geocode address results. - `Optional street` Street name. Present for address and interpolated results. - `Optional subcategory` POI subcategory. Present for place results. - `Optional tags` Raw OSM tags. Present for place results. - `Optional wikipedia` Wikipedia article reference (e.g. en:Eiffel Tower). Present for notable places. - `Type type` - `FEATURE("Feature")` ### Reverse Geocode Result - `class ReverseGeocodeResult:` GeoJSON FeatureCollection of reverse geocoding results, ordered by distance from the query point. Content-Type: `application/geo+json`. - `List features` Reverse geocoding results ordered by distance - `GeoJsonGeometry geometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `Coordinates coordinates` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `List` - `List>` - `List>>` - `List>>>` - `Type type` Geometry type - `POINT("Point")` - `LINE_STRING("LineString")` - `POLYGON("Polygon")` - `MULTI_POINT("MultiPoint")` - `MULTI_LINE_STRING("MultiLineString")` - `MULTI_POLYGON("MultiPolygon")` - `Properties properties` Geocoding result properties - `String displayName` Formatted address or place name - `Optional category` POI category (e.g. restaurant, cafe, park). Present for place results. - `Optional city` City or town name. Present for address results. - `Optional confidence` Interpolation confidence (0-1). Present only for interpolated results. - `Optional country` Country name. Present for reverse geocode address results. - `Optional countryCode` ISO 3166-1 alpha-2 country code - `Optional distanceM` Distance from the query point in meters (reverse geocode / nearby only) - `Optional fullAddress` Complete formatted address from the database. Present for reverse geocode address results. - `Optional houseNumber` House or building number. Present for address and interpolated results. - `Optional interpolated` Whether this result was estimated by address interpolation rather than an exact database match. - `Optional name` Place name (raw). Present for reverse geocode place results. - `Optional osmId` OpenStreetMap element ID (null for interpolated results) - `Optional osmType` OSM element type (node, way, relation) - `NODE("node")` - `WAY("way")` - `RELATION("relation")` - `Optional postcode` Postal code. Present for reverse geocode address results. - `Optional score` Relevance score (higher is better). Incorporates text match quality, spatial proximity boost, and popularity signals. Not bounded to 0-1. - `Optional source` 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) - `STRUCTURED("structured")` - `BM25("bm25")` - `FUZZY("fuzzy")` - `ADDRESS("address")` - `PLACE("place")` - `INTERPOLATION("interpolation")` - `Optional state` State or province name. Present for reverse geocode address results. - `Optional street` Street name. Present for address and interpolated results. - `Optional subcategory` POI subcategory. Present for place results. - `Optional tags` Raw OSM tags. Present for place results. - `Optional wikipedia` Wikipedia article reference (e.g. en:Eiffel Tower). Present for notable places. - `Type type` - `FEATURE("Feature")` - `Type type` - `FEATURE_COLLECTION("FeatureCollection")`