feat(junction): project sourced islands

This commit is contained in:
que01 committed 2026-09-09 10:54:45 +08:00
1 parent cd3a9c9613
commit 0e162d1f43
3 files changed
+67 -1

No files matched your search

+27 -1
View File
@@ -536,7 +536,33 @@ function buildComplexJunctionGeometry(model, cluster, helpers) {
),
]
: [];
const allFeatures = [...features, ...islands, ...sidewalkCorners, ...crosswalks, ...stopLines];
const knownIslandFeatures = (model.exclusionRegions || [])
.filter(
(region) =>
Array.isArray(region.ring) &&
region.ring.length >= 4 &&
region.ring.some((point) => helpers.distanceMeters(point, center) <= outerRadius + 12),
)
.map((region) => ({
type: 'Feature',
properties: {
native_id: `osm-traffic-island:${region.id}`,
object_key: `island:osm/${region.id}`,
kind: 'island',
osm_way_ids: String(region.id),
source: region.source,
facility_evidence: 'source-osm-region',
},
geometry: { type: 'Polygon', coordinates: [region.ring] },
}));
const allFeatures = [
...features,
...islands,
...sidewalkCorners,
...crosswalks,
...stopLines,
...knownIslandFeatures,
];
const structure = structureFromTopology(topology, shape, center, allFeatures);
for (const feature of allFeatures) {
feature.properties.junction_key = structure.junctionKey;
+1
View File
@@ -77,6 +77,7 @@ function structureFromTopology(topology, shape, center, features) {
'complex-corner-crosswalk': 'crossing',
'complex-stop-line': 'stop-line',
'complex-corner-island': 'island',
island: 'island',
'complex-sidewalk-corner': 'sidewalk-turn',
}[p.kind];
if (!kind || !p.object_key) continue;