Table of contents
Geospatial Features
Download API definition:
This API is a Technical Preview and is available for testing purposes only. Do not use in production.
GET https://api.bentley.com/geospatial-features/itwins/{iTwinId}/ogc/collections/{collectionId}/items[?limit][&bbox][&bbox-crs][&crs][&continuationToken]

Get features from a collection of geographic features from a specified dataset. This endpoint is part of the OGC API - Features (OAPIF) 3.0 standard, which provides a RESTful interface for accessing geospatial data.

Request parameters

Name
Required?
Description
iTwinId
Yes

iTwin id

collectionId
Yes

Collection id

limit
No

Limits the number of items returned.

bbox
No

Return only features in the supplied bounding box coordinates. The CRS of the values is WGS 84 longitude/latitude unless a different CRS is specifed in the parameter bbox-crs.

bbox-crs
No

Parameter may be used to assert the CRS used for the coordinate values of the bbox parameter.

crs
No

The coordinates of the geometries in the response document will be transformed into the requested CRS.

continuationToken
No

A token provided by the service to retrieve the next set of features in a paginated response.

Request headers

Name
Required?
Description
Authorization
Yes

OAuth access token with itwin-platform scope

Accept
Yes

Setting to application/vnd.bentley.itwin-platform.v1+json is recommended.

Response 200 OK

OK

json
{
    "type": "FeatureCollection",
    "features": [{
        "type": "Feature",
        "id": 1,
        "geometry": {
            "type": "LineString",
            "coordinates": [
                [
                    0,
                    0,
                    0
                ],
                [
                    0,
                    0,
                    0
                ]
            ]
        },
        "properties": {
            "prop1": 0,
            "prop2": ""
        }
    }],
    "links": [{
            "href": "https//example.com/items?limit=1&continuationToken=token",
            "rel": "next",
            "type": "application/geo+json"
        },
        {
            "href": "https//example.com/items",
            "rel": "self",
            "type": "application/geo+json"
        }
    ],
    "numberMatched": 10,
    "numberReturned": 1
}

Response 401 Unauthorized

This response indicates that request lacks valid authentication credentials. Access token might not been provided, issued by the wrong issuer, does not have required scopes or request headers were malformed.

json
{
    "error": {
        "code": "HeaderNotFound",
        "message": "Header Authorization was not found in the request. Access denied."
    }
}

Response 403 Forbidden

This response indicates that user does not have required permissions to get specified connection.

json
{
    "error": {
        "code": "InsufficientPermissions",
        "message": "The user has insufficient permissions for the requested operation."
    }
}

Response 422 Unprocessable Entity

UnprocessableEntity

json
{
    "error": {
        "code": "InvalidGeospatialFeaturesRequest",
        "message": "Invalid iTwinId."
    }
}

Response 429 Too many requests

This response indicates that the client sent more requests than allowed by this API for the current tier of the client.

json
{
    "error": {
        "code": "RateLimitExceeded",
        "message": "The client sent more requests than allowed by this API for the current tier of the client."
    }
}

Response headers

Name
Description
retry-after

Number of seconds to wait until client is allowed to make more requests.

Feature Collection type

Specifies the GeoJSON object type as a Feature Collection.

Name
Type
Description
FeatureCollection
String

Feature Collection

A valid GeoJSON Feature Collection containing multiple features.

Name
Type
Description
Feature Collection type

Specifies the GeoJSON object type as a Feature Collection.

features

An array of GeoJSON features contained in the collection.

links

A list of links related to the feature collection, provided by the server.

numberMatched
Integer

The total number of features found in the collection.

numberReturned
Integer

The number of features returned in the current request.

Feature type

Specifies the GeoJSON object type as a Feature.

Name
Type
Description
Feature
String

Feature

A valid GeoJSON Feature object.

Name
Type
Description
Feature type

Specifies the GeoJSON object type as a Feature.

geometry

The geometry of the feature in GeoJSON format.

properties
Object[]

A collection of properties associated with the feature.

id

A unique identifier for the feature, which can be either a string or an integer.

GeoJSON Geometry

A valid GeoJSON Geometry object, which can be one of several geometry types.

Link

A link object to express relationships between resources.

Name
Type
Description
href
String

The URL of the linked resource.

rel
String

The relationship type of the link.

type
String

The media type of the linked resource.

title
String

A human-readable title for the link.

DetailedError

Contains error information and an array of more specific errors.

Name
Type
Description
code
String

One of a server-defined set of error codes.

message
String

A human-readable representation of the error.

target
String, null

The target of the error.

details

Optional array of more specific errors.

Detailed Error Response

Gives details for an error that occurred while handling the request. Note that clients MUST NOT assume that every failed request will produce an object of this schema, or that all of the properties in the response will be non-null, as the error may have prevented this response from being constructed.

Name
Type
Description
error

Error Detailed information.

Error

Contains error information.

Name
Type
Description
code
String

One of a server-defined set of error codes.

message
String

A human-readable representation of the error.

target
String, null

The target of the error.

Error Response

Gives details for an error that occurred while handling the request. Note that clients MUST NOT assume that every failed request will produce an object of this schema, or that all of the properties in the response will be non-null, as the error may have prevented this response from being constructed.

Name
Type
Description
error

Error information.

Was this page helpful?