Skip to content
GuidesPlaygroundDashboard

Get feature by type and ID

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

Get feature by type and ID

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

Feature identifier (type/osm_id)

osmId: Optional<Long>

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

fun main() {
    val client: PlazaClient = PlazaOkHttpClient.fromEnv()

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