Fetch multiple features by type and ID
FeatureCollection elements().batch(ElementBatchParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/api/v1/features/batch
Fetch multiple features by type and ID
package com.plazafyi.example;
import com.plazafyi.client.PlazaClient;
import com.plazafyi.client.okhttp.PlazaOkHttpClient;
import com.plazafyi.models.FeatureCollection;
import com.plazafyi.models.elements.BatchRequest;
import com.plazafyi.models.elements.ElementBatchParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
PlazaClient client = PlazaOkHttpClient.fromEnv();
BatchRequest params = BatchRequest.builder()
.addElement(BatchRequest.Element.builder()
.id(21154906L)
.type(BatchRequest.Element.Type.NODE)
.build())
.addElement(BatchRequest.Element.builder()
.id(4589123L)
.type(BatchRequest.Element.Type.WAY)
.build())
.build();
FeatureCollection featureCollection = client.elements().batch(params);
}
}{
"features": [
{
"geometry": {
"coordinates": [
2.3522,
48.8566
],
"type": "Point"
},
"properties": {
"@id": "bar",
"@type": "bar",
"amenity": "bar",
"cuisine": "bar",
"name": "bar"
},
"type": "Feature",
"id": "node/21154906"
}
],
"type": "FeatureCollection"
}Returns Examples
{
"features": [
{
"geometry": {
"coordinates": [
2.3522,
48.8566
],
"type": "Point"
},
"properties": {
"@id": "bar",
"@type": "bar",
"amenity": "bar",
"cuisine": "bar",
"name": "bar"
},
"type": "Feature",
"id": "node/21154906"
}
],
"type": "FeatureCollection"
}