Pairs a zone of a with a zone of b only when the two polygons are the SAME
polygon — intersection over union at least iou_min — so two releases scored on
differently named units (v1's 36 Planning Areas, v2+'s 20 Program Areas) can be
compared where, and only where, they measured the same place. Measured on the
2025 Planning Areas vs the 2026 Program Areas: 18 of 20 Program Areas are
identical to a Planning Area (IoU 1.0000); the two Gulf of America Program
Areas are subsets (IoU 0.59, 0.15) and must NOT be compared, and 15 Planning
Areas (Atlantic, Hawai'i, Pacific islands) have no Program Area at all.
Usage
zone_crosswalk(a, b, key_a, key_b, iou_min = 0.999, hint = NULL)
Arguments
- a, b
sf polygon layers
- key_a, key_b
name of the zone-key column in each
- iou_min
minimum intersection/union to call two zones identical (default
0.999)
- hint
optional column of b listing (comma-separated) key_a values to
test against; a hint with more than one key is tested as their union
Value
a data frame of every candidate pair: key_a, key_b, iou,
identical (logical); the compared set is identical == TRUE
Details
Candidate pairs come from hint when given (a column of b naming zones of
a, e.g. programarea rows carry planarea_key = "CGA,EGA"), else every pair
that intersects; either way the geometry decides. Planar areas in the layer's
CRS (sf::sf_use_s2(FALSE) while computing).