Build Master Parcel Attribute Table (MPAT)
- Input: Prepared layers in
data/01_inputs/prepared/ - Output: MPAT GeoPackage and CSV in
data/03_processed/mpat/, plus parcel analysis points GeoPackage indata/03_processed/ - Helper:
src/build_mpat.py
Goal
The notebook joins the prepared geospatial layers into a single per-parcel attribute table for the pilot islands (Maui, Oahu, and Kauai). Each row is a parcel with at least one cesspool and carries cesspool counts, parcel and building-footprint geometry summaries, distances to regulatory and environmental features, and raster-sampled values, all measured at a single analysis point per parcel. The MPAT is the input that feeds the technology screening step.
Inputs
All prepared layers from the Prepare Input Data step.
- Prepared folder:
HiOSDS-TechSuitabilityAnalysis/data/01_inputs/prepared/ - CRS: EPSG:32604 (UTM Zone 4N)
- Rasters: rainfall, DEM, slope, watertable
- Vectors: building footprints, cesspool inventory, coastline, flood zones, parcels, SMA, soils, streams, domestic wells, municipal wells
- See also: Prepare Input Data — Outputs
Outputs
The notebook produces two GeoPackages and a tabular CSV.
- Project directory paths:
- MPAT:
HiOSDS-TechSuitabilityAnalysis/data/03_processed/mpat/20260428_mpat_32604.gpkgHiOSDS-TechSuitabilityAnalysis/data/03_processed/mpat/20260428_mpat.csvHiOSDS-TechSuitabilityAnalysis/data/03_processed/mpat/README.md
- Parcel analysis points:
HiOSDS-TechSuitabilityAnalysis/data/03_processed/20260428_parcel_analysis_points.gpkg
- MPAT:
- GitHub:
data/03_processed/mpat/ - Schema: column-by-column reference in the output README on GitHub. All distances in feet, areas in square feet, elevations in feet, rainfall in inches.
The MPAT and the analysis points share the same TMK key, so they can be joined back together for visualization or QA.
Processing Steps
The MPAT notebook (notebooks/02_built_mpat.ipynb) follows eight steps.
Set up. Import modules, define configurations (target CRS EPSG:32604, pilot islands, unit conversions for area and raster values), and resolve project paths and the prepared-input dictionary.
Load and filter cesspools. Load the cesspool inventory, normalize column names, retain class IV systems with at least one OSDS, drop duplicate TMKs, and filter to the configured pilot islands. The bedroom sentinel value
-9999is replaced with NA.Filter and dissolve parcels. Restrict the parcels layer to TMKs that appear in the filtered cesspool set, dissolve geometries on TMK so that split-polygon parcels collapse into a single row each, and compute parcel area in square metres and square feet.
Process building footprints. Spatially join footprints to parcels via representative points to assign a TMK to every footprint, calculate per-footprint area, and aggregate to per-parcel summary attributes (count of footprints and total footprint area).
Define parcel analysis points. Generate one analysis point per parcel. If the parcel has any building footprints, the point is the centroid of the largest footprint. Otherwise the point is the parcel centroid. The chosen logic is recorded in the
analysis_point_sourcecolumn. The analysis point is the single sampling location used for every per-parcel attribute below.
Figure 1: Parcel analysis point placement logic. The point is the centroid of the largest building footprint when one is present, otherwise the parcel centroid. Compute spatial attributes at analysis points. From each analysis point, compute:
- Distance to the nearest Special Management Area (SMA) polygon.
- Special Flood Hazard Area (SFHA) flag from the flood-zone layer.
- Soil saturated hydraulic conductivity (
ksat_h,ksat_l,ksat_r) sampled from the soils layer at the point. - Distance to the coastline, the nearest stream, the nearest domestic well, and the nearest municipal well.
- Raster-sampled values for mean annual rainfall (in), land surface elevation (m converted to ft), water table elevation (m converted to ft), and slope percent (derived from the DEM).
Assemble the MPAT. Merge all per-parcel attributes onto the parcel geometry on TMK, then compute the derived columns: depth to water table (land surface elevation minus water table elevation, clamped at a small positive value to avoid negatives) and net parcel area (parcel area minus total building-footprint area). Reorder columns into front (identifiers, counts, areas), distances, environmental, intersection flags, and metadata.
Export. Write the MPAT to a GeoPackage (with geometry) and a CSV (geometry dropped). The analysis-points GeoPackage is exported alongside.
Notes and Decisions
- Pilot filter. The current MPAT runs on Maui, Oahu, and Kauai only. This kept the pilot run focused on islands with the best data coverage. See Start Here for the remaining-island note.
- Cesspool filter. The MPAT keeps records where
class_iv != 0andosds_qty > 0, so the analysis stays aligned with cesspool-bearing parcels in scope. - Bedroom sentinel values. The cesspool inventory uses
-9999for unknown bedroom counts. The MPAT converts those values to NA so they are not treated as real bedrooms. - Parcel dissolve. The MPAT dissolves parcel polygons by TMK before calculating area, so split-polygon parcels become one row per parcel.
- Analysis point logic. Attributes are sampled at the centroid of the largest building footprint when available, otherwise the parcel centroid. The selected source is recorded in
analysis_point_source.
Resources
- Notebook:
notebooks/02_built_mpat.ipynb - Helper functions:
src/build_mpat.py - Validation utilities:
src/validate_mpat.py(expected ranges per column, used bynotebooks/02a_mpat_validation.ipynb) - Output folder:
HiOSDS-TechSuitabilityAnalysis/data/03_processed/mpat/