Skip to content
GuidesPlaygroundDashboard

Get feature by type and ID

GeoJsonFeature elements().retrieve(ElementRetrieveParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
GET/api/v1/features/{type}/{id}

Get feature by type and ID

ParametersExpand Collapse
ElementRetrieveParams params
String type
Optional<Long> id
ReturnsExpand Collapse
class GeoJsonFeature:
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
Type type
Optional<String> id

Feature identifier (type/osm_id)

Optional<Long> osmId

OpenStreetMap ID

Get feature by type and ID

package com.plazafyi.example;

import com.plazafyi.client.PlazaClient;
import com.plazafyi.client.okhttp.PlazaOkHttpClient;
import com.plazafyi.models.GeoJsonFeature;
import com.plazafyi.models.elements.ElementRetrieveParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        PlazaClient client = PlazaOkHttpClient.fromEnv();

        ElementRetrieveParams params = ElementRetrieveParams.builder()
            .type("type")
            .id(0L)
            .build();
        GeoJsonFeature geoJsonFeature = client.elements().retrieve(params);
    }
}
Returns Examples