FAILURE MAP
← Case archive

FA-70637 / GIS polygon topology / Member archive

Area-weighted centroid of a multipolygon with holes: hole weight · case 02

Centroids of polygons with holes move toward the hole.

Member previewVariant 2 · 3 implementations · 8 checks per implementation

Case contract

Input: a multipolygon as a list of polygons, each a list of closed rings (exterior first). Ring orientation is arbitrary: every ring contributes its absolute area and matching first moments, exteriors positively and holes negatively. Moments use the shoelace terms (xi + xi+1)*cross/6. If the total area is 0 return None, else the centroid [cx, cy] rounded to 6 decimals.

Why this case matters

Label placement, zonal summaries and map joins use polygon centroids; courtyards and multi-part parcels must pull the centroid correctly.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
regression #2[5.206422, 5.206422][4.752747, 4.752747]Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

Member access is invitation-based. Sign in with your invited account to inspect the sources.

Sign in to the archive ↗