Skip to content
GuidesPlaygroundDashboard

Forward geocode an address

GeocodeResult geocode().forward(GeocodeForwardParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
GET/api/v1/geocode

Forward geocode an address

ParametersExpand Collapse
GeocodeForwardParams params
String q

Address or place name

Optional<String> bbox

Bounding box filter: south,west,north,east

Optional<String> countryCode

ISO 3166-1 alpha-2 country code filter

Optional<String> lang

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

Optional<Double> lat

Focus latitude

Optional<String> layer

Filter by layer: address, poi, or admin

Optional<Long> limit

Maximum results (default 20, max 100)

Optional<Double> lng

Focus longitude

ReturnsExpand Collapse
class GeocodeResult:

GeoJSON FeatureCollection of geocoding results

List<GeocodingFeature> features
Coordinates coordinates

GeoJSON coordinates array (nesting depth varies by geometry type)

One of the following:
List<double>
List<List<double>>
List<List<List<double>>>
List<List<List<List<double>>>>
Type type
One of the following:
POINT("Point")
LINE_STRING("LineString")
POLYGON("Polygon")
MULTI_POINT("MultiPoint")
MULTI_LINE_STRING("MultiLineString")
MULTI_POLYGON("MultiPolygon")
Properties properties
Optional<String> countryCode

ISO 3166-1 alpha-2 country code

Optional<String> displayName

Formatted address or place name

Optional<Double> distanceM

Distance in meters

Optional<Long> osmId

OpenStreetMap ID

Optional<String> osmType

OSM element type

Optional<Double> score

Match confidence score

Optional<String> source

Result source (address, place, interpolation)

Type type
Type type

Forward geocode an address

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);
    }
}
Returns Examples