voxcity.geoprocessor.raster.buildings_precise¶
Precise (geometry-intersection) building rasterization.
Split out of buildings.py so this path has no Earth Engine import and can
be unit-tested directly. Output-equivalent to the legacy implementation
except for one documented change: when several buildings overlap the same
cell and their relative order was ill-defined under the legacy code, the
new code processes them in a deterministic order (height descending, then
building index ascending). This affects the last-wins building_id_grid
value and the building_min_height_grid list order only when heights
tie or are None/NaN (the legacy order there depended on rtree iteration
order and, for NaN, was corrupted by NaN sort-key comparisons). A
differential test against the legacy implementation confirms byte-identical
output on all cells whose overlapping buildings have distinct, non-NaN
heights.