fix: fill internal complex junction pavement holes
This commit is contained in:
1 parent
a2bce9f465
commit
fda733ce72
2 files changed
+7
-2
No files matched your search
@@ -12,9 +12,13 @@ function solveComplexPavementRegion(parts, crossingRegions = []) {
|
||||
(ring) => Array.isArray(ring) && ring.length >= 4 && ring.every((point) => point?.every(Number.isFinite)),
|
||||
);
|
||||
const regions = union(...inputs.map((ring) => [ring]));
|
||||
// Construction polygons can enclose unpaved pockets where approach,
|
||||
// core and corner edges meet. Those pockets are the visible "holes" in a
|
||||
// complex junction; they are not exclusion regions and must be paved.
|
||||
const filledRegions = regions.map((polygon) => [polygon[0]]);
|
||||
return {
|
||||
status: regions.length === 1 ? 'supported' : 'disconnected',
|
||||
regions,
|
||||
status: filledRegions.length === 1 ? 'supported' : 'disconnected',
|
||||
regions: filledRegions,
|
||||
inputCount: inputs.length,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ for (const [name, nodeIds] of Object.entries({
|
||||
);
|
||||
assert.ok(pavement, `${name} must publish an authoritative pavement region`);
|
||||
assert.equal(pavement.geometry.coordinates.length, 1, `${name} pavement must be one connected region`);
|
||||
assert.equal(pavement.geometry.coordinates[0].length, 1, `${name} pavement must not expose internal holes`);
|
||||
assert.equal(
|
||||
geometry.diagnostics.some((item) => item.rule === 'complex-junction-pavement-region-disconnected'),
|
||||
false,
|
||||
|
||||
Reference in new issue
Block a user