feat(junction): classify complex junction shapes

This commit is contained in:
que01 committed 2026-09-07 10:52:12 +08:00
1 parent 38ea779d9b
commit a359f88edc
13 files changed
+440 -14

No files matched your search

@@ -88,6 +88,10 @@ export function JunctionWorkspace({
),
);
}, [descriptor, state?.debug?.junctionClusters]);
const shapeSummary = useMemo(
() => state?.debug?.junctionShapes?.find((shape) => shape.clusterId === descriptor.ref.id),
[descriptor.ref.id, state?.debug?.junctionShapes],
);
const candidate = useMemo(() => {
return candidateForJunction(state, descriptor);
}, [descriptor, state]);
@@ -192,6 +196,14 @@ export function JunctionWorkspace({
</header>
<div className="junction-workspace__body">
<dl>
{shapeSummary ? (
<>
<dt>路口形态</dt>
<dd>
{shapeSummary.label} · {shapeSummary.armCount} 条有效道路臂
</dd>
</>
) : null}
<dt>组成节点</dt>
<dd>{descriptor.nodeIds.length ? `${descriptor.nodeIds.length} 个路口节点` : '—'}</dd>
<dt>进口道路</dt>
+12 -1
View File
@@ -70,6 +70,13 @@ export interface JunctionClusterConfig {
nodeIds: string[];
coreRadiusMeters?: number;
}
export interface JunctionShapeSummary {
clusterId: string;
kind: string;
label: string;
armCount: number;
throughPairCount: number;
}
export interface Diagnostic {
id: string;
message: string;
@@ -94,5 +101,9 @@ export interface WorkbenchState {
comparison: Record<string, unknown>;
layers: Record<string, GeoJson | null>;
junctionReference?: { converted: GeoJson };
debug?: { junctionCandidates: JunctionCandidate[]; junctionClusters?: JunctionClusterConfig[] } | null;
debug?: {
junctionCandidates: JunctionCandidate[];
junctionClusters?: JunctionClusterConfig[];
junctionShapes?: JunctionShapeSummary[];
} | null;
}