Skip to content
GuidesPlaygroundDashboard

Get feature by type and ID

GeoJsonFeature Elements.Retrieve(ElementRetrieveParamsparameters, CancellationTokencancellationToken = default)
GET/api/v1/features/{type}/{id}

Get feature by type and ID

ParametersExpand Collapse
ElementRetrieveParams parameters
required string type

Element type (node, way, relation)

required Long id

OSM ID

ReturnsExpand Collapse
class GeoJsonFeature:
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

Get feature by type and ID

ElementRetrieveParams parameters = new()
{
    Type = "type",
    ID = 0,
};

var geoJsonFeature = await client.Elements.Retrieve(parameters);

Console.WriteLine(geoJsonFeature);
Returns Examples