# Christchurch Flood Hazard — Point or Extent (`spider355/nz-chc-flood-hazard`) Actor

Check whether a Christchurch point or a small box intersects the District Plan high flood-hazard layer. Hit or miss, plus a few attributes. US$0.003 per result. No polygon download. Not endorsed by Christchurch City Council, DHI, or Environment Canterbury. CC BY attribution is in the README.

- **URL**: https://apify.com/spider355/nz-chc-flood-hazard.md
- **Developed by:** [Mitchell](https://apify.com/spider355) (community)
- **Categories:** Lead generation, Real estate, Automation
- **Stats:** 2 total users, 1 monthly users, 80.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Christchurch high flood-hazard check (Apify Actor)

Point or small-extent intersect against the Christchurch City Council **DP Flood Hazard High** layer (`DPFloodHazardHigh`, OpenData DistrictPlanB id 25). It GETs that one ArcGIS query endpoint and writes an allowlisted hit or miss. It does not page the layer.

**This is a point or extent intersect, not a republish of the polygons.** Geometry, shape area, shape length, and popup text are not requested and not emitted. There is no citywide extract.

**Not endorsed by Christchurch City Council, DHI, or Environment Canterbury.** The attribution line is the credit. It does not add an endorsement claim.

**Data source called (default):** `https://gis.ccc.govt.nz/server/rest/services/OpenData/DistrictPlanB/MapServer/25`

Research names that MapServer URL. The hub item URL for the same layer is FeatureServer/25, which is the URL inside the attribution string. `source` on each row is the layer URL this run actually calls (MapServer/25 unless the env override below selects FeatureServer/25).

There is no URL input. `url`, `feedUrl`, `layerUrl`, and `outFields` are ignored. A user `where` is never sent. A process environment override `CCC_FLOOD_BASE_URL` is accepted only when it is `https://gis.ccc.govt.nz` and the path is DistrictPlanB **layer 25** (`MapServer/25` or `FeatureServer/25`, optional `/query`). Any other host or layer is rejected.

### Output fields

Each dataset item is an allowlist. `SHAPE`, `Shape__Area`, `Shape__Length`, `PopupText`, polygon rings, paths, and polygon coordinates are never emitted.

| Field | Description |
|-------|-------------|
| `drvDPFloodHazardHighID` | Layer object id, or null on a miss |
| `CreatedByPlanChangeIdentifier` | Plan-change create id, or null |
| `RemovedByPlanChangeIdentifier` | Plan-change remove id, or null |
| `LegalStatus` | Legal status, or null |
| `DataSource` | Organisation named on the feature, or null |
| `ScheduleReference` | Schedule reference, or null |
| `CreateDate` | Layer value as returned (ArcGIS epoch milliseconds, or null). Not reformatted. |
| `LastEditDate` | Layer value as returned (ArcGIS epoch milliseconds, or null). Not reformatted. |
| `intersects` | Hit/miss flag. **True** on every feature row when the point or extent intersects at least one polygon. A miss is a single row with `intersects: false` and null attributes. |
| `source` | The MapServer/25 or FeatureServer/25 URL actually called |
| `attribution` | Exact base line below. If `DataSource` is non-empty, a second sentence is appended: ` Data source: <DataSource>.` |

`truncated` is not a dataset field. It is true in the run log when the number of matching features is greater than `maxItems` (the extra match is requested so the cap can be detected, then dropped). One query is sent. The body cap is **8 MiB**.

### Inputs

Provide **one** of: a WGS84 point, an NZTM point, or a bounding box. A query with no spatial filter is rejected. `where=1=1` (including spaced or parenthesised forms) without a point or extent is rejected. With a point or extent, the Actor still sends its own `where=1=1` **together with** `geometry`, `geometryType`, `inSR`, and `spatialRel=esriSpatialRelIntersects`. That is an intersect, not a dump. `returnGeometry=false`. `outFields` is the eight attributes above, never `*`.

| Input | Notes |
|-------|--------|
| `latitude` / `longitude` | WGS84 point. `x` is longitude, `y` is latitude, `inSR` 4326, `geometryType=esriGeometryPoint`. Always allowed. |
| `easting` / `northing` | NZTM2000 point (EPSG:2193), metres. `inSR` 2193. Always allowed. Easting must sit between 800000 and 3200000, northing between 4000000 and 7200000. |
| `xmin` / `ymin` / `xmax` / `ymax` | Envelope. `geometryType=esriGeometryEnvelope`. |
| `inSR` | Extent only. `4326` (default) or `2193`. |
| `maxItems` | Default **10**. Hard cap **50**. Values above 50 fail the run. Research and compliance named no number. |

#### Bounding box rule

Research and compliance did not name a maximum area or span. This Actor rejects an extent whose **width or height is greater than 2000 metres**. A box of exactly 2000 m on a side is allowed. A point is not limited by this rule.

- **NZTM (2193):** width = `xmax - xmin`, height = `ymax - ymin`, already in metres.
- **WGS84 (4326):** height = `(ymax - ymin) * 111320` metres. Width = `(xmax - xmin) * 111320 * |cos(mid-latitude)|` metres, with mid-latitude in degrees. 111320 is the metres-per-degree constant used for this check, not a surveyed local grid.

`xmax` must be greater than `xmin`, and `ymax` greater than `ymin`.

A box inside that cap (not the default run):

```json
{
  "xmin": 1570000,
  "ymin": 5180000,
  "xmax": 1570500,
  "ymax": 5180400,
  "inSR": 2193,
  "maxItems": 1
}
```

#### Try this

One Christchurch point, cap 1. A point is a single query. A run with no point and no extent is rejected.

```json
{
  "latitude": -43.53,
  "longitude": 172.64,
  "maxItems": 1
}
```

#### Query shape

`returnGeometry=false&outFields=drvDPFloodHazardHighID,CreatedByPlanChangeIdentifier,RemovedByPlanChangeIdentifier,LegalStatus,DataSource,ScheduleReference,CreateDate,LastEditDate&geometryType=esriGeometryPoint|esriGeometryEnvelope&inSR=4326|2193&spatialRel=esriSpatialRelIntersects&f=json`

`resultRecordCount` is `maxItems + 1` (at most 51). Non-JSON, non-200, an ArcGIS `error` object, and an unexpected shape fail the run. The Actor does not follow offsets.

A field-name probe on 3 Oct 2026 (PT) used `returnGeometry=false`, `resultRecordCount=1`, and the outFields allowlist. The raw body was not saved. Returned attribute names matched the allowlist. `CreateDate` was null on that row. `LastEditDate` was epoch milliseconds. `DataSource` was a string.

### Attribution

Christchurch City Council — DP Flood Hazard High (OpenData), https://gis.ccc.govt.nz/server/rest/services/OpenData/DistrictPlanB/FeatureServer/25. Licensed under Creative Commons Attribution 4.0 International (CC BY 4.0): https://creativecommons.org/licenses/by/4.0/. This output is a point or extent intersect, not the original polygons; geometry, shape area, shape length, and popup text were not republished.

When a row has a non-empty `DataSource`, that same line is followed by one more sentence: `Data source: <DataSource>.` Empty or missing `DataSource` keeps the base line only.

### Notes where the research and compliance docs were silent

- Neither doc named `maxItems`, a maximum box span, or the ArcGIS `geometry` / `inSR` parameter shape. This Actor uses the task rules: default 10, hard cap 50, box width and height at most 2000 m, intersect via ArcGIS query geometry + `inSR`.
- Research wins on the endpoint: the default call is MapServer/25. The required attribution string cites FeatureServer/25 (the hub item URL for the same layer). `source` records whichever of those two layer-25 URLs was called.
- Compliance's emit list did not include `source`. The task allowlist does, so each row includes it.
- Dates are passed through. They are not converted to Auckland calendar dates.

### Known limits

- One layer only: DistrictPlanB id 25, `DPFloodHazardHigh`. No other DistrictPlanB family and no other host.
- A miss returns one `intersects: false` row so the hit/miss flag is always in the dataset.
- The 2000 m cap is a product limit, not a figure from the council service.
- NZTM range checks are a sanity bound for mainland NZTM2000, not a Christchurch clip.

# Actor input Schema

## `latitude` (type: `number`):

Point latitude in degrees. Pair with longitude. Do not combine with NZTM or an extent. A point is always allowed.

## `longitude` (type: `number`):

Point longitude in degrees. Pair with latitude. Sent as ArcGIS point geometry x, inSR 4326.

## `easting` (type: `number`):

Point easting in NZTM2000 metres (EPSG:2193). Pair with northing. Do not combine with lat/lon or an extent.

## `northing` (type: `number`):

Point northing in NZTM2000 metres (EPSG:2193). Pair with easting. Sent as ArcGIS point geometry y, inSR 2193.

## `xmin` (type: `number`):

West or minimum-easting edge of a small box. All four edges are required. Width and height must each be at most 2000 m.

## `ymin` (type: `number`):

South or minimum-northing edge. Pair with xmin, xmax, ymax.

## `xmax` (type: `number`):

East or maximum-easting edge. Must be greater than xmin.

## `ymax` (type: `number`):

North or maximum-northing edge. Must be greater than ymin.

## `inSR` (type: `integer`):

Extent only. 4326 = WGS84 degrees (x longitude, y latitude). 2193 = NZTM metres. Default 4326. Ignored for a lat/lon or easting/northing point.

## `maxItems` (type: `integer`):

Cap on hit rows. Default 10. Hard cap 50. Research and compliance named no number; this is the task cap. A miss still returns one intersects=false row.

## Actor input object example

```json
{
  "latitude": -43.53,
  "longitude": 172.64,
  "inSR": 4326,
  "maxItems": 10
}
```

# Actor output Schema

## `results` (type: `string`):

Point or extent intersect rows for DP Flood Hazard High. Geometry, shape area, shape length, and popup text are not included.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "latitude": -43.53,
    "longitude": 172.64,
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("spider355/nz-chc-flood-hazard").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "latitude": -43.53,
    "longitude": 172.64,
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("spider355/nz-chc-flood-hazard").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "latitude": -43.53,
  "longitude": 172.64,
  "maxItems": 10
}' |
apify call spider355/nz-chc-flood-hazard --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,spider355/nz-chc-flood-hazard"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/qFy2jGwVgRPW1KthN/builds/Acw4i9IcEZUKQ6dX1/openapi.json
