Skip to content
GuidesPlaygroundDashboard

Fetch multiple features by type and ID

FeatureCollection Elements.Batch(ElementBatchParamsparameters, CancellationTokencancellationToken = default)
POST/api/v1/features/batch

Fetch multiple features by type and ID

ParametersExpand Collapse
ElementBatchParams parameters
required IReadOnlyList<Element> elements
required Long ID
required Type Type
One of the following:
"node"Node
"way"Way
"relation"Relation
ReturnsExpand Collapse
class FeatureCollection:

Bare GeoJSON FeatureCollection. Pagination metadata is returned in HTTP headers (X-Limit, X-Has-More, X-Next-Cursor, X-Next-Offset, Link).

required IReadOnlyList<GeoJsonFeature> Features
required GeoJsonGeometry Geometry
required Coordinates Coordinates

GeoJSON coordinates array (nesting depth varies by geometry type)

One of the following:
IReadOnlyList<Double>
IReadOnlyList<IReadOnlyList<Double>>
IReadOnlyList<IReadOnlyList<IReadOnlyList<Double>>>
IReadOnlyList<IReadOnlyList<IReadOnlyList<IReadOnlyList<Double>>>>
required Type Type
One of the following:
"Point"Point
"LineString"LineString
"Polygon"Polygon
"MultiPoint"MultiPoint
"MultiLineString"MultiLineString
"MultiPolygon"MultiPolygon
required IReadOnlyDictionary<string, JsonElement> Properties
required Type Type
string ID

Feature identifier (type/osm_id)

Long OsmID

OpenStreetMap ID

required Type Type

Fetch multiple features by type and ID

ElementBatchParams parameters = new()
{
    Elements =
    [
        new()
        {
            ID = 0,
            Type = Type.Node,
        },
    ],
};

var featureCollection = await client.Elements.Batch(parameters);

Console.WriteLine(featureCollection);
Returns Examples