feat(junction): mark complex crossing evidence
This commit is contained in:
1 parent
c14b8b09f2
commit
d49cdab40a
4 files changed
+112
-2
No files matched your search
@@ -135,4 +135,53 @@ assert.equal(
|
||||
false,
|
||||
);
|
||||
assert.ok(complexGeometry.diagnostics.some((item) => item.rule === 'complex-junction-corner-facilities-omitted'));
|
||||
const inferredComplexCrosswalk = complexGeometry.crosswalks.features.find(
|
||||
(feature) => feature.properties?.kind === 'complex-crosswalk',
|
||||
);
|
||||
assert.equal(inferredComplexCrosswalk.properties.facility_evidence, 'inferred-road-envelope');
|
||||
assert.ok(complexGeometry.diagnostics.some((item) => item.rule === 'complex-junction-crossing-inferred'));
|
||||
const sourceCrossingModel = structuredClone(complexModel);
|
||||
const sourceRoad = sourceCrossingModel.roads.find((road) => road.id === inferredComplexCrosswalk.properties.road_id);
|
||||
sourceCrossingModel.crossings = [
|
||||
{
|
||||
id: 'known-complex-crossing',
|
||||
coordinate: inferredComplexCrosswalk.properties.frame_center,
|
||||
osmWayIds: sourceRoad.osmWayIds,
|
||||
},
|
||||
];
|
||||
const sourceCrossingGeometry = compiler.nativeRoad.compileGeometry(
|
||||
sourceCrossingModel,
|
||||
{ schema: 'native-road-overrides/v1', overrides: [] },
|
||||
{
|
||||
edgeLines: false,
|
||||
junctionTemplates: {
|
||||
enabled: true,
|
||||
clusters: [
|
||||
{
|
||||
id: 'fixture-five-arm',
|
||||
template: 'complex-junction-v1',
|
||||
nodeIds: ['8005332807', '8024512135', '8024512145', '8024512147', '8613058676'],
|
||||
coreRadiusMeters: 24,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
);
|
||||
const sourcedComplexCrosswalk = sourceCrossingGeometry.crosswalks.features.find(
|
||||
(feature) => feature.properties?.crossing_key === inferredComplexCrosswalk.properties.crossing_key,
|
||||
);
|
||||
assert.equal(sourcedComplexCrosswalk.properties.facility_evidence, 'source-crossing-node');
|
||||
assert.deepEqual(sourcedComplexCrosswalk.properties.source_crossing_node_ids, ['known-complex-crossing']);
|
||||
const sourcedStopLine = sourceCrossingGeometry.vehicleStopLines.features.find(
|
||||
(feature) => feature.properties?.crossing_key === inferredComplexCrosswalk.properties.crossing_key,
|
||||
);
|
||||
if (sourcedStopLine) assert.equal(sourcedStopLine.properties.facility_evidence, 'source-crossing-node');
|
||||
const sourceStructure = sourceCrossingGeometry.roadSurface.features.find(
|
||||
(feature) => feature.properties?.junction_structure,
|
||||
)?.properties.junction_structure;
|
||||
assert.equal(
|
||||
sourceStructure.facilities.find((facility) => facility.key === inferredComplexCrosswalk.properties.object_key)
|
||||
.provenance.facilityEvidence,
|
||||
'source-crossing-node',
|
||||
);
|
||||
console.log('road compiler package tests passed');
|
||||
Reference in new issue
Block a user