supply-shed-change

unverified
v0.1.0

Facility -> plausible sourcing shed (capacity-weighted Huff allocation of H3 cells within a haul bound) -> from-class -> to-class land-use-change transition matrix per shed, plus the native-conversion summary. Commodity and region specifics are parameters, not code.

Map preview and live runs are available in the workbench.

The contract

governed folia/0.1

Read from this recipe's own declarations — parameters:, outputs:, requires:, and the ops its layers name. Not from its style blocks and not from any benchmark: a colour ramp is not a contract, and a measured run is evidence about one AOI rather than a domain.

Parameters

parametertypedomaindefaultwhat it does
facilities_uri string local://inputs/mills_cluster.geojson Facility points (GeoJSON) with an optional capacity column.
transitions_uri string local://inputs/transitions_h3.parquet Pre-binned per-pixel land-use transitions rolled to H3 (GeoParquet: h3 string, prior int, post int, area_ha float; [[adr:0075]]). Res may be finer than the allocation unit; the matrix op rolls up via H3 parent.
distances_uri string local://inputs/drivetime_h3.parquet Precomputed drive-time cost table (GeoParquet: facility int, h3 string at the unit res, minutes float), used when distance=drivetime. Generated offline by inputs/build_inputs.py via OSRM /table. For distance=straightline this layer loads but the allocate op ignores it.
bbox array of number, exactly 4 items [-49.6,-20.6,-48.1,-19.4] The allocation-universe bounding box [w, s, e, n] in WGS84 lon/lat (straightline only).
method string huff Allocation rule — huff (capacity-weighted gravity) or voronoi (nearest).
distance string straightline Distance metric — drivetime (road-network minutes from the distances table; the default, the metric road anisotropy makes matter) or straightline (in-engine haversine km over bbox).
unit string h3:7 Allocation unit (h3:N). Res-7 (~5 km2 cells) is the cloud-native default.
haul_km number >= 1 60 Haul bound (km) for distance=straightline — facilities beyond it do not compete.
haul_min number >= 1 90 Haul bound (drive-time MINUTES) for distance=drivetime.
beta number >= 0 2 Huff distance-decay exponent (assign to argmax capacity/dist^beta). NOTE the degeneracy: capacity-neutrality (method voronoi, or no capacity_field) gives nearest/Voronoi — NOT beta=0, at which distance drops out entirely.
capacity_field string capacity_tc Per-facility capacity column in the facilities table (tonnes cane/season here).
target_class number 20 The commodity class transitions are screened INTO (MapBiomas 20 = sugar cane).
native_forest array of number [1,3,5,6,49] Native-forest prior classes (MapBiomas Collection 10, mapbiomas_legend.py).
native_veg array of number [4,10,11,12,13,50] Native non-forest vegetation prior classes (savanna, wetland, grassland...).

Outputs

outputkindlayerwhat it is
shed table shed Per-cell facility assignment (h3, facility, score, distance_km, n_within_haul).
transitions_matrix table transitions_matrix From-class -> to-class area (ha) per shed.
shed_summary table shed_summary Per-shed target area, new conversion, native-forest / native-veg slices.

Capabilities it requires

Declares no requires: block, so it asks nothing of a host beyond the engine itself.

Where it runs

  • Browser preview does not run here distances: source cannot be resolved without a server; facilities: source cannot be resolved without a server; shed: op "supply_shed_allocate" has no browser kernel; and 3 more
  • Local CLI (folia run) runs here runs locally through the governed folia/0.1 parser
  • Operated fleet (POST /plan, /run) runs here binds to a canonical digest, so a lock is checked by digest equality
open in Workbench from registry/recipes/supply-shed-change/folia.yaml