# BC Regional Districts — per-district offline data (#34)

This documents how the app's map data was downloaded province-wide and split into
the **28 BC regional districts**, with the size of each district's dataset.

## What's in a district bundle

Each regional district gets **all 11 of the app's map layers** plus the
**placer grid**, spatially assigned by which district polygon contains each
feature's centroid:

| Layer | Source | Notes |
|-------|--------|-------|
| claims-placer | WFS `MTA_ACQUIRED_TENURE_SVW` (P/C) | current placer claims |
| leases-mineral | WFS `MTA_ACQUIRED_TENURE_SVW` (M/L) | current mineral leases |
| lapsed-claims | WFS `MTA_ACQUIRED_TENURE_HISTORY_SP` | historical/lapsed tenures |
| reserves | WFS `MTA_SITE_SP` | mineral reserves (excl. panning) |
| mineral-occurrences | WFS `MINFIL_MINERAL_FILE` | MINFILE occurrences |
| mineral-production | ArcGIS layer 39 | |
| crown-granted | WFS `MTA_CROWN_GRANT_MIN_CLAIM_SVW` | |
| active-mines | WFS `HSP_NOTICE_OF_WORK_PA_POLY_SV` | |
| major-mines | WFS `HSP_MJR_MINES_PERMTTD_AREAS_SP` | |
| mineral-potential | WFS `MINPOT_MINERAL_POTENTIAL` | |
| tantalis-parcels / tenures | ArcGIS TANTALIS service | |
| **placer-grid** | BC catalogue FGDB (`MTA_MINERAL_PLACER_GRID_POLY`) | **11,024,226 cells** |

## The placer grid: the big one

The placer grid is **11,024,226 cells** — by far the largest component. BC
publishes the full province as a single **File Geodatabase zip (1.5 GB)** in the
[BC Data Catalogue](https://catalogue.data.gov.bc.ca/dataset/7dd6cf0d-b980-4a20-9db8-3a84e0b2ecaa)
(`MTA_MINERAL_PLACER_GRID_POLY.gdb.zip`), in the **NAD83 / BC Albers (EPSG:4269)**
projected CRS.

To split it we:
1. Downloaded the 1.5 GB FGDB zip from the catalogue.
2. Reprojected it to **EPSG:4326** with `ogr2ogr` (→ a 3.9 GB GeoPackage).
3. Ran one `ogr2ogr -spat <district-bbox>` per district to clip the grid to each
   district.

This avoids the 5,500-request bulk ArcGIS download (the grid is not
bulk-downloadable via the map service) and the FGDB's native projected CRS.

## Per-district sizes

See [`district_size_table.json`](district_size_table.json) for the machine-readable
table, or the rendered table below.

| District | layers (MB) | layers (.gz) | grid (MB) | grid (.gz) | **total (.gz)** |
|----------|------------:|-------------:|----------:|-----------:|-----------------:|
| Kitimat-Stikine (RDKS) | 299.0 | 52.1 | 2000.1 | 206.4 | **258.4** |
| Stikine Region | 155.0 | 23.9 | 2000.1 | 206.4 | **230.3** |
| Peace River (PRRD) | 101.5 | 24.0 | 1390.8 | 144.6 | **168.6** |
| Cariboo (CRD) | 277.5 | 39.0 | 737.1 | 76.5 | **115.4** |
| Fraser-Fort George (RDFFG) | 44.2 | 7.2 | 947.7 | 97.6 | **104.8** |
| Bulkley-Nechako (RDBN) | 153.9 | 21.6 | 666.5 | 69.8 | **91.4** |
| Thompson-Nicola (TNRD) | 166.0 | 21.3 | 541.6 | 56.3 | **77.6** |
| North Coast (NCRD) | 26.4 | 3.6 | 665.8 | 68.7 | **72.2** |
| East Kootenay (RDEK) | 177.4 | 24.6 | 273.4 | 28.1 | **52.7** |
| Central Kootenay (RDCK) | 192.7 | 25.9 | 217.6 | 22.2 | **48.1** |
| Mount Waddington (RDMW) | 38.1 | 6.4 | 386.8 | 40.4 | **46.8** |
| Central Coast (CCRD) | 7.7 | 0.9 | 401.9 | 42.0 | **42.9** |
| Columbia Shuswap (CSRD) | 73.1 | 10.4 | 308.7 | 32.0 | **42.4** |
| Strathcona (STRD) | 37.6 | 5.2 | 338.9 | 35.9 | **41.1** |
| Squamish-Lillooet (SLRD) | 69.1 | 9.8 | 175.7 | 18.0 | **27.8** |
| Okanagan-Similkameen (RDOS) | 95.6 | 12.4 | 75.5 | 7.7 | **20.1** |
| Fraser Valley (FVRD) | 67.6 | 9.0 | 108.2 | 11.0 | **20.0** |
| Kootenay Boundary (RDKB) | 88.5 | 11.8 | 67.9 | 6.9 | **18.7** |
| Alberni-Clayoquot (RDAC) | 39.9 | 6.2 | 91.1 | 9.7 | **15.9** |
| qathet (qRD) | 23.8 | 3.8 | 80.8 | 8.4 | **12.2** |
| North Okanagan (RDNO) | 25.8 | 2.9 | 77.3 | 8.2 | **11.1** |
| Capital (CAPRD) | 27.1 | 3.7 | 50.7 | 5.2 | **8.9** |
| Cowichan Valley (CVRD) | 23.0 | 3.2 | 47.7 | 4.9 | **8.2** |
| Sunshine Coast (SCRD) | 9.2 | 0.7 | 47.6 | 4.9 | **5.6** |
| Nanaimo (RDN) | 11.2 | 1.0 | 32.8 | 3.4 | **4.5** |
| Metro Vancouver (MVRD) | 8.3 | 1.1 | 31.8 | 3.3 | **4.4** |
| Central Okanagan (RDCO) | 9.1 | 0.5 | 30.8 | 3.2 | **3.7** |
| Comox Valley (CMXRD) | 3.3 | 0.4 | 23.8 | 2.5 | **2.8** |
| **TOTAL (28 + outside)** | **2266.2** | **335.4** | **11818.9** | **1224.0** | **1559.4** |

### Headline numbers
- **Raw GeoJSON:** ~14.1 GB (layers 2.3 GB + grid 11.8 GB)
- **Gzipped:** ~1.6 GB (layers 0.3 GB + grid 1.2 GB)
- **Largest district:** Kitimat-Stikine (258 MB gz)
- **Smallest district:** Comox Valley (2.8 MB gz)
- **Average district:** ~54 MB gz

The **northern districts dominate** (Kitimat-Stikine, Stikine, Peace River,
Cariboo, Fraser-Fort George) because the placer grid is dense there and the
southern interior/coastal districts have far fewer cells.

## Distribution

Each district is two files (both also available gzipped):
- `<ABBR>.geojson` — the 11 map layers for that district
- `<ABBR>_grid.geojson` — that district's placer-grid cells

For webspace distribution, upload the **`.gz`** versions (the table's
"total (.gz)" column is what each district costs to host). A user downloading
one district gets a self-contained offline bundle for that region.

## Scripts

The reusable scripts live in `.tools/regional/` (gitignored — they're build
tooling, not app code):
- `download_wfs.py` — pull the WFS-served layers province-wide
- `download_layers.py` — pull the ArcGIS-served layers
- `split_by_district.py` — point-in-polygon split of the layer GeoJSONs
- `split_grid_ogr.sh` — per-district `ogr2ogr -spat` clip of the 4326 grid
- `district_size_table.json` — the machine-readable size table above
