> For the complete documentation index, see [llms.txt](https://protectedseas.gitbook.io/navigator-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://protectedseas.gitbook.io/navigator-api-docs/api-reference/boundary.md).

# Boundary

The Boundary endpoints return **GeoJSON boundary geometries** for regions and sites. Use these when you need accurate geometries for mapping or spatial analysis.

{% hint style="info" %}
**Site boundaries may be simplified for display.** Boundaries above 10,000 vertices are simplified, with maximum deviation from the authoritative boundary bounded at 9.55 m or 2.39 m depending on the site's protection level. The `display_simplified` field tells you which sites this applies to. Polygon and ring counts are never changed, and area fields returned elsewhere in the API are always computed from the authoritative boundary. See [Site keys](/navigator-api-docs/field-reference/site-keys.md) for the method.
{% endhint %}

## Region boundary

```http
GET https://map.navigatormap.org/api/boundary/region/
```

### Request parameters

| Parameter   | Required? | Type    | Description                |
| ----------- | --------- | ------- | -------------------------- |
| `region_id` | Required  | integer | Numeric region identifier. |

### Response fields

| Field                                 | Type           | Description                                                                                                                   |
| ------------------------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `region_id`                           | integer        | Numeric region identifier, echoed back from the request.                                                                      |
| `is_multi_jurisdictional`             | boolean        | True if this region is itself a multi-jurisdictional area.                                                                    |
| `includes_multi_jurisdictional_areas` | boolean        | True if this region contains multi-jurisdictional areas.                                                                      |
| `boundary_source`                     | string         | Source information for the region's boundary data.                                                                            |
| `region_boundary`                     | GeoJSON object | Full boundary of the region.                                                                                                  |
| `boundary_multi_jurisdictional_areas` | GeoJSON object | Boundary of multi-jurisdictional areas within this region (only included when `includes_multi_jurisdictional_areas` is true). |

### Example

```http
GET /api/boundary/region/?region_id=435
```

Returns the boundary geometry for the region identified by its `region_id`.

## Site boundary

```http
GET https://map.navigatormap.org/api/boundary/site/
```

{% hint style="info" %}
**Some site boundaries are withheld.** Geometries sourced from MarViva, WDPA, or the Convention on Biological Diversity CHM are excluded for redistribution reasons. These sites still appear in the catalog and return their full attributes via Search and Site Details — only the boundary geometry is unavailable. A boundary request for one of these sites returns `null` for `site_boundary` while still returning `boundary_source`, so you can tell a withheld boundary apart from one that is simply absent.
{% endhint %}

### Request parameters

| Parameter            | Required? | Type                                | Description          |
| -------------------- | --------- | ----------------------------------- | -------------------- |
| `ogc_fid` or `ps_id` | Required  | `ogc_fid`: integer, `ps_id`: string | The site identifier. |

### Response fields

| Field                   | Type                   | Description                                                                                                                                                                                                                                                                                           |
| ----------------------- | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ogc_fid`               | integer                | Numerical unique site identifier.                                                                                                                                                                                                                                                                     |
| `ps_id`                 | string                 | ProtectedSeas site identifier (e.g. `AIBEL110`).                                                                                                                                                                                                                                                      |
| `boundary_source`       | string                 | Source information for the site's boundary data. Returned even when `site_boundary` is `null`.                                                                                                                                                                                                        |
| `boundary_modification` | integer                | What was done to the **source** boundary: `0` = Unmodified; `2` = Other modification (e.g. multiple source parts merged, clipped, or split); `3` = Digitized using best available data. `1` is retired and no longer assigned. Display simplification is reported separately in `display_simplified`. |
| `display_simplified`    | boolean (JSON literal) | `true` if the returned geometry has been simplified for display; `false` if it is the boundary as held. A true JSON boolean, not a `0`/`1` code. Independent of `boundary_modification` — a site can be both digitized and display-simplified.                                                        |
| `site_boundary`         | GeoJSON object         | Full boundary of the site.                                                                                                                                                                                                                                                                            |

{% hint style="warning" %}
**Large boundaries return large responses.** A handful of sites — chiefly national EEZs, high-seas areas, and boundaries extending beyond ±85° latitude, which are never simplified — return geometries of 10 MB or more and can take upwards of 10 seconds. Set client timeouts accordingly.
{% endhint %}

### Examples

```http
GET /api/boundary/site/?ogc_fid=54012
```

```http
GET /api/boundary/site/?ps_id=MNM10
```

Each returns the boundary geometry for the site identified by the given identifier.

## Error handling

### Region boundary — parameter validation (`400`)

| Condition                          | Example error                                              |
| ---------------------------------- | ---------------------------------------------------------- |
| `region_id` missing                | Specifies that the parameter is required.                  |
| `region_id` not a positive integer | Echoes the invalid value and specifies the correct format. |

### Region boundary — not found (`404`)

Returns `404` with the `region_id` echoed back when no active region matches.

### Site boundary — parameter validation (`400`)

| Condition                        | Example error                                              |
| -------------------------------- | ---------------------------------------------------------- |
| No `ogc_fid` or `ps_id` provided | Lists the accepted identifiers with format examples.       |
| `ogc_fid` not a positive integer | Echoes the invalid value and specifies the correct format. |

### Site boundary — not found (`404`)

Returns `404` with the identifier echoed back when no active site boundary matches.

### Server errors (`500`)

Database errors return a generic JSON error without exposing internal details.
