Spatial reconstruction

Spatial reconstruction aligns vector and raster label sources to the reference grid and can fuse several sources into a hard-label raster plus optional support and QA layers.

Either-or rule: use either a main/reference vector or a main/reference raster. If both should be combined, put one in the main slot and the other under additional sources.

Minimum inputs

InputRequired?Notes
Reference/grid rasterYesDefines output geometry.
Main/reference vectorRequired for vector workflowNeeds an explicit reference class field.
Main/reference rasterRequired for raster workflowCan be remapped through a class schema.
Additional vector/raster sourcesOptionalFused after alignment to the same grid.
Class schema CSV/JSONOptionalMaps source values to target IDs and names.

Important controls

ControlEffect
Vector pixel assignmentPixel centre, all touched, area majority or minimum-overlap assignment.
Fusion ruleFirst valid, last valid, majority, weighted support, consensus only or primary-if-valid-else-majority.
Minimum source coverageRequired fraction of selected sources that must provide a valid label.
Treat 0 as classUse for binary or zero-based class rasters where 0 is a real class.

Core calculations

coverage(x) = nvalid(x) / nsources

Source coverage: fraction of selected label sources that provide a valid class at pixel x. It is used to reject pixels with too little support.

pc(x) = #{i : yi(x) = c} / nvalid(x)

Class support: empirical support for class c among valid sources. For weighted support, counts are replaced by source weights.

c*(x) = arg maxc #{i : yi(x) = c}

Majority class: selected class with maximum source support; ties are resolved by the selected fusion rule and source order.

agreement(x) = ∑i wi ยท 1[yi(x) = c*(x)] / ∑i wi

Agreement: weighted strength behind the selected class. It is high when most reliable sources select the same class.

overlapg,p = area(gp) / area(p)

Vector overlap: fraction of target pixel p covered by geometry g. Area-majority assignment picks the class with largest overlap; the minimum-overlap option rejects weak intersections.

purityR=1(x) = |{zN1(x) : y(z) = y(x)}| / |{zN1(x) : y(z) valid}|

Immediate purity: checks whether the 1-pixel neighbourhood is homogeneous. Low purity indicates edges or mixed areas.

Main outputs

OutputMeaning
Hard label rasterSingle-band target class ID raster.
One-hot stackOne band per class: 1 for membership, 0 for valid absence.
Class probability/support stackPer-class source support p_c(x) in 0..1.
Coverage and agreementQA layers describing source availability and source agreement.
Class schema and reportReusable mapping and reproducibility metadata.