nz-solar-potential

Local setup

Set up a computer to fetch data and build regions locally. District builds run on the build VM (see Dataset operations).

1. Install system tools

You need GDAL (gdalbuildvrt, gdal_translate) with working LERC decoding, and Tippecanoe. The pipeline checks both before it fetches. Python packages do not add codecs to system GDAL; see LERC dependency check.

Leave plenty of disk space: imagery alone can be several GB per region.

Create the project Python environment

From the project folder:

python3 -m venv .venv
. .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -c "import geopandas, rasterio, shapely, laspy, pvlib; print('ready')"

The last line should print ready. Run . .venv/bin/activate in each new terminal; the prompt then starts with (.venv).

LINZ credentials

The pipeline downloads building outlines, elevation and imagery from the LINZ Data Service, which needs an API key.

  1. Sign in or create an account at LINZ Data Service.
  2. Go to API Keys.
  3. Choose API Key > Manual scope.
  4. Set every service from “No Access” to “Create, edit, and …”.
  5. Create .env from the example and add the key:
cp .env.example .env
LINZ_API_KEY=your-key

.env sits beside config.py and Git ignores it. Never commit the key or paste it into issues or chat. The web pipeline’s optional locality grid uses the LINZ boundary and needs no additional API key or dataset.

VS Code may say terminal environment injection is disabled. Ignore it: the fetch scripts read .env themselves.