How to get features by bounding box
To request data from an interactive layer by bounding box, you must send an HTTP GET request to a specific layer from an interactive API. The request is made to the endpoint /Base path for the interactive API from the API Lookup Service/layers/Layer ID/bbox, where Base path for the interactive API from the API Lookup Service and Layer ID are placeholders for the actual API base path and layer identifier, respectively.
- The query parameters
west={westLongitude},north={northLatitude},east={eastLongitude}, andsouth={southLatitude}specify the geographical boundaries for the request. - The
Hostheader indicates the hostname of the API. - The
Authorizationheader includes a Bearer token for authentication. - The
Cache-Control: no-cacheheader instructs the server to not use cached responses.
GET /<Base path for the interactive API from the API Lookup Service>/layers/<Layer ID>/bbox?west={westLongitude}&north={northLatitude}&east={eastLongitude}&south={southLatitude}
Host: <Hostname for the interactive API from the API Lookup Service>
Authorization: Bearer <Authorization Token>
Cache-Control: no-cacheSample request
GET /layer/<Layer ID>/bbox?west=-110&north=53&east=-130&south=50&tags=Note
If needed, you can use an API Key instead of an OAuth bearer token in an authorization header.
Sample response
{
"type": "FeatureCollection",
"features": [
{
"id": "{featureId}",
"bbox": [
-116.055555555,
51.170833333,
-116.055555555,
51.170833333
],
"type": "Feature",
"properties": {
"name": "Stanley Peak",
"@ns:com:here:xyz": {
"createdAt": 1529855977981,
"updatedAt": 1529855977981
}
},
"geometry": {
"type": "Point",
"coordinates": [
-116.055555555,
51.170833333
]
}
},
{
"id": "{featureId}",
"bbox": [
-123.291,
50.1203,
-123.291,
50.1203
],
"type": "Feature",
"properties": {
"name": "Mount Cayley",
"@ns:com:here:xyz": {
"createdAt": 1529855978027,
"updatedAt": 1529855978027
}
},
"geometry": {
"type": "Point",
"coordinates": [
-123.291,
50.1203
]
}
}
]
}Note
You can apply a bounding box on a specific version of a layer using the
"version"query parameter when using an interactive map layer.
Updated 25 days ago