AI-based damage assessment and conflation endpoints.
Introduction
Retrieves the latest damage assessment for a specific event ID, filtered by Area of Interest (AOI) or address.
Endpoint
POST https://api.nearmap.com/ai/damage/v2/events/{eventId}/latest.geojson
Operation ID: getLatestForEvent. Tag: Damage Conflation. Version 2.0.0.
Path parameter
| Name | Type | Required (Y/N)? | Description |
|---|---|---|---|
eventId | string (uuid) | Y | Unique identifier for the event. This is the postCatEventId tag value from the Coverage API. Example: 9c4e2b7a-3d51-5f86-a0e2-7b1c8d4f6a35. |
Request body
Content type application/json. Send either aoi or address, not both. If you send neither or both, the API returns 400 with code BAD_AOI_ADDRESS.
| Field | Type | Description |
|---|---|---|
aoi | GeoJSON Polygon or MultiPolygon | Area of interest. Rings must be closed and must not intersect themselves. Holes and 3D coordinates are accepted. Send a polygon in longitude, latitude order. |
address | object | Physical address for parcel-based damage assessment. All five fields are required: streetAddress (for example "123 Main Street"), city, state (state or province code), zip (ZIP or postal code) and country (country code, for example US). A missing field returns 400 with code BAD_ADDRESS. The response includes geomatchedAddress. |
limit | integer | Maximum number of features per page. Default 1000, minimum 1. Values below 1 return 400. No maximum is enforced. |
cursor | string | Pagination cursor. Omit this parameter to retrieve the first page of results. To retrieve the next page, set cursor to the nextCursor value from the previous response, and keep all other request parameters unchanged. A cursor is valid only with the parameters of the original request, so do not use it with a different AOI or other changed parameters. |
Example request body
{
"aoi": {
"type": "Polygon",
"coordinates": [[[-100.0003, 39.9998], [-99.9996, 39.9998], [-99.9996, 40.0004],
[-100.0003, 40.0004], [-100.0003, 39.9998]]]
},
"limit": 1000
}Address object
If you send an address, it must contain all of the following fields:
| Field | Type | Required (Y/N)? | Description |
|---|---|---|---|
streetAddress | string | Y | The street address, for example "123 Main Street". |
city | string | Y | The city or locality. |
state | string | Y | The state or province code. |
zip | string | Y | The ZIP or postal code. |
country | string | Y | The country code. Only addresses in US or AU are supported. |
A missing field returns 400 with code BAD_ADDRESS. The response includes geomatchedAddress.
{
"address": {
"streetAddress": "123 Main Street",
"city": "Springfield",
"state": "TX",
"zip": "75001",
"country": "US"
}
}AOI object
If you send an aoi, it is a GeoJSON Polygon or MultiPolygon, with type and coordinates directly under aoi. Coordinates are longitude, latitude. Each ring must be closed, and not intersect itself. Holes and 3D coordinates are accepted. An invalid geometry returns 400 with code BAD_AOI.
{
"aoi": {
"type": "Polygon",
"coordinates": [[[-100.0003, 39.9998], [-99.9996, 39.9998], [-99.9996, 40.0004], [-100.0003, 40.0004], [-100.0003, 39.9998]]]
}
}Pagination
Results are paged, with up to 1000 buildings per page by default. If more results are available, the response includes nextCursor. To retrieve the next page, send the same request again with that value as cursor. Continue until the response no longer includes nextCursor. Use the same area for every page of a query. Pages of one query are read in order, because each page needs the cursor from the one before.
Response
| Field | Type | Description |
|---|---|---|
type | string | Always FeatureCollection. |
resourceId | string (uuid) | Unique identifier for the resource. |
eventId | string (uuid) | Unique identifier for the event. |
eventName | string | Human-readable event name. |
geomatchedAddress | string | Matched address from geocoding. Present only for address queries. |
modelVersion, presentationVersion | string | Versions of the damage model and the presentation layer. |
nextCursor | string | Cursor for the next page. Absent on the last page. |
features[] | array | One GeoJSON Feature per building. |
features[].id | string (uuid) | Unique feature identifier. |
features[].geometry | Polygon or MultiPolygon | Building outline. Polygon or MultiPolygon only. |
properties.damage.event | object | Post-event damage assessment. |
properties.damage.preEvent | object | Pre-event assessment of the same building. Present only where Nearmap has a pre-event observation of the building. |
rating | string | Damage class: NoDamage, Affected, Minor, Major or Destroyed. The class with the highest probability in rawRatings. |
confidence | number, 0 to 1 | Confidence in the rating. Equals the probability of the chosen class. |
rawRatings | object | Probability for each damage class. The five probabilities add up to 1. |
classRatios[] | array | Evidence classes behind the rating. Each item has classId (uuid), description, ratio (0 to 1) and confidence (0 to 1). Examples: Building lifecycle, Junk and Wreckage. |
latestCaptureDate | string (date) | Latest imagery capture date, YYYY-MM-DD. Supplied only inside preEvent. |
properties.hilbertId | string | Identifier of the building within this dataset. Buildings with close hilbertId values are close together on the ground, so sorting by it helps spatial analysis. It can change when conflation re-runs, so use the building outline, not hilbertId, to match buildings between results. |
properties.confidence | number | A score from 0 to 1 that shows the confidence for the building outline. For example, 0.62 means 62% confidence in the outline. Note that this is different from the damage rating confidence score. |
properties.areaSqm | number | Building area in square meters, potentially including decimal places, for example 51.7. |
properties.areaSqft | number | Building area in square feet, rounded to the nearest integer. |
Example response
The event name, IDs, coordinates and ratings below do not describe a real event.
{
"type": "FeatureCollection",
"resourceId": "7d2b9e64-1c3a-5f08-b6d4-2a9e8c1f5037",
"eventId": "ac504814-a897-5f32-84dc-928f4ff0ac2f",
"eventName": "Sample event",
"modelVersion": "1.0.0",
"presentationVersion": "1.0.0",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-100.00008971405619,
40.00000461033479
],
[
-99.99998896584611,
40.00002172018569
],
[
-100.00001028594382,
40.00009538966521
],
[
-100.00011103415389,
40.00007827981431
],
[
-100.00008971405619,
40.00000461033479
]
]
]
},
"id": "3f6c2a10-8d47-5b21-9a3e-0c5d7e1b4f92",
"properties": {
"areaSqft": 796,
"areaSqm": 73.92,
"confidence": 0.9257812,
"damage": {
"event": {
"rating": "Destroyed",
"confidence": 0.97835683,
"rawRatings": {
"Affected": 0.0012413142,
"Destroyed": 0.97835683,
"Major": 0.012051237,
"Minor": 0.0049820816,
"NoDamage": 0.0033685421
},
"classRatios": [
{
"classId": "f8abc8e3-6af3-5a1d-9a8e-1793419455bb",
"description": "Junk and Wreckage",
"ratio": 0.55210361,
"confidence": 0.6210938
},
{
"classId": "584188c4-4f77-5724-a782-f13865ab0dbc",
"description": "Building Structural Loss",
"ratio": 0.94100347,
"confidence": 0.9257812
},
{
"classId": "91987430-6739-5e16-b92f-b830dd7d52a6",
"description": "Building lifecycle",
"ratio": 0.95330148,
"confidence": 0.9257812
}
]
},
"preEvent": {
"rating": "NoDamage",
"confidence": 0.97298833,
"rawRatings": {
"Affected": 0.016204737,
"Destroyed": 0.00041386574,
"Major": 0.0019217365,
"Minor": 0.0084713306,
"NoDamage": 0.97298833
},
"classRatios": [
{
"classId": "30fc0c55-2b61-569f-b424-44082987ecb9",
"description": "Medium and High Vegetation with Woody Vegetation",
"ratio": 0.041203761,
"confidence": 0.5908203
},
{
"classId": "91987430-6739-5e16-b92f-b830dd7d52a6",
"description": "Building lifecycle",
"ratio": 0.99010215,
"confidence": 0.9404297
}
],
"latestCaptureDate": "2025-01-15"
}
},
"hilbertId": "13650079281234567890"
}
}
],
"nextCursor": "eyJwYWdlIjoyfQ"
}