Table of contents
iModel Query
Download API definition:
This operation is a Technical Preview and is available for testing purposes only. Do not use in production.
POST https://dev-api.bentley.com/imodel-query/itwins/{itwin}/imodels/{imodel}/changesets/{changeset}/coordinates/geographic

Convert points in iModel's spatial coordinate system to geometric coordinates.

Geographic coordinates in response array will be ordered in the same order as they were requested.

Response coordinate may contain warning property which identifies an issue with converted coordinate:

  • Out of useful range - indicates that the conversion was performed outside of the normal use of application of either Geographic Coordinate Reference Systems.
  • Vertical datum convert error - indicates that a problem occurred during vertical datum conversion. The horizontal coordinates returned are valid but the returned elevation ordinate is unchanged or partially changed.

Instead of coordinate, response may contain an error:

  • Out of mathematical domain - conversions were requested outside of the area of the mathematical capacity of the conversion process for either Geographic Coordinate Reference Systems involved.

For more information on how iModels are geolocated see GeoLocation of iModels.

Authentication

Requires Authorization header with valid Bearer token for scope itwin-platform.

For more documentation on authorization and how to get access token visit OAUTH2 Authorization page.

Request parameters

Name
Required?
Description
itwin
Yes
imodel
Yes
changeset
Yes

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.

Request body

GeoCoordinatesRequest

Name
Type
Required?
Description
target
String
Yes

Datum (e.g. WGS84, NAD83)

iModelCoordinates
Yes

Array of iModel's spatial coordinates

Example

json
{
    "target": "WGS84",
    "iModelCoordinates": [{
            "x": 1,
            "y": 2,
            "z": 3
        },
        {
            "x": 28001.642,
            "y": 9889591.836564282,
            "z": 0
        },
        {
            "x": 6257025,
            "y": 6257025,
            "z": 0
        }
    ]
}

Response 200 OK

json
{
    "geoCoordinates": [{
            "point": {
                "longitude": 103.58176079102425,
                "latitude": 1.0162823426821597,
                "elevation": 3
            }
        },
        {
            "point": {
                "longitude": 103.83333333333333,
                "latitude": 90,
                "elevation": 0
            },
            "warning": "Out of useful range"
        },
        {
            "error": "Out of mathematical domain"
        }
    ]
}

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 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.

Coordinate

Name
Type
Description
x
Number
y
Number
z
Number

GeoCoordinate

Name
Type
Description
latitude
Number
longitude
Number
elevation
Number

CoordinateConversionWarning

Name
Type
Description
Out of useful range
String
Vertical datum convert error
String
CSMap error
String

CoordinateConversionError

Name
Type
Description
Out of mathematical domain
String

CoordinateConversionResponseError

Name
Type
Description

GeoCoordinatesRequest

Name
Type
Description
target
String

Datum (e.g. WGS84, NAD83)

iModelCoordinates

Array of iModel's spatial coordinates

GeoCoordinatesResponsePoint

Name
Type
Description

GeoCoordinatesResponse

Name
Type
Description

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?