fix: publish unified complex junction pavement
This commit is contained in:
1 parent
787faa7604
commit
8882754b23
5 files changed
+155
-1
No files matched your search
@@ -5,6 +5,7 @@ const { COMPLEX_CROSSWALK_DEPTH_METERS } = require('./junction-metrics');
|
||||
const { structureFromTopology } = require('./junction-topology');
|
||||
const { resolveJunctionBuildPlan, stationAtDistanceFrom } = require('./junction-build-plan');
|
||||
const { buildJunctionBoundaryGraph, buildCoreClosure, ringsOverlap } = require('./junction-boundary-graph');
|
||||
const { solveComplexPavementRegion, rectangle, connectCornerCrossing } = require('./junction-pavement-region');
|
||||
const {
|
||||
buildIslandFromCrossingEdges,
|
||||
orthogonalCrossingHeadings,
|
||||
@@ -84,6 +85,8 @@ function buildComplexJunctionGeometry(model, cluster, helpers) {
|
||||
const boundaryParts = [];
|
||||
const transitionDiagnostics = [];
|
||||
const crosswalks = [];
|
||||
const crossingRegions = [];
|
||||
const cornerCrossingFrames = [];
|
||||
const stopLines = [];
|
||||
const islands = [];
|
||||
const crossingControls = helpers.clusterCrossingControls || new Map();
|
||||
@@ -340,6 +343,7 @@ function buildComplexJunctionGeometry(model, cluster, helpers) {
|
||||
arm.crosswalkFrame.endpoints = endpoints;
|
||||
arm.crosswalkFrame.spanMeters = usableSpan;
|
||||
arm.crosswalkFrame.roadEdgeInsetMeters = roadEdgeInset;
|
||||
crossingRegions.push(rectangle(arm.crosswalkFrame.center, crossingHeading, groupDepth, usableSpan));
|
||||
for (let stripe = 0; stripe < stripeCount; stripe += 1) {
|
||||
const along = layout.centers[stripe];
|
||||
const centerPoint = helpers.offsetCoordinate(endpoints[0], bearing(...endpoints), along);
|
||||
@@ -606,6 +610,12 @@ function buildComplexJunctionGeometry(model, cluster, helpers) {
|
||||
const diagonalHeading = outwardHeading;
|
||||
const diagonalCenter = helpers.offsetCoordinate(outerMidpoint, outwardHeading, diagonalDepth / 2);
|
||||
const diagonalSpan = COMPLEX_CROSSWALK_DEPTH_METERS;
|
||||
cornerCrossingFrames.push({
|
||||
center: diagonalCenter,
|
||||
heading: diagonalHeading,
|
||||
depth: diagonalDepth,
|
||||
span: diagonalSpan,
|
||||
});
|
||||
const layout = stripeLayout(diagonalDepth);
|
||||
const stripeCount = layout.centers.length;
|
||||
const stripeSpacing = layout.pitch;
|
||||
@@ -811,6 +821,46 @@ function buildComplexJunctionGeometry(model, cluster, helpers) {
|
||||
// they are smoothing; they never replace an OSM-derived road surface.
|
||||
features.push(...cornerFills);
|
||||
if (coreFeature) features.push(coreFeature);
|
||||
// Publish a single canonical pavement region last. The individual approach,
|
||||
// core and corner polygons above remain structural inputs for editing and
|
||||
// diagnostics; they are no longer the visible authority at the junction.
|
||||
const basePavement = features.map((feature) => feature.geometry.coordinates[0]);
|
||||
const connectedCrossings = [...crossingRegions];
|
||||
const connectors = [];
|
||||
for (const frame of cornerCrossingFrames) {
|
||||
const solved = connectCornerCrossing(basePavement, connectedCrossings, frame);
|
||||
connectedCrossings.push(solved.region);
|
||||
if (solved.connector) connectors.push(solved.connector);
|
||||
}
|
||||
const pavementRegion = solveComplexPavementRegion(basePavement, [...connectedCrossings, ...connectors]);
|
||||
if (pavementRegion.status === 'supported') {
|
||||
for (const feature of features) feature.properties.pavement_input = true;
|
||||
features.push({
|
||||
type: 'Feature',
|
||||
properties: {
|
||||
native_id: `complex-junction:${cluster.id}:pavement-region`,
|
||||
cluster_id: cluster.id,
|
||||
kind: 'complex-pavement-region',
|
||||
complex_part: 'pavement-region',
|
||||
center,
|
||||
region_status: 'supported',
|
||||
region_input_count: pavementRegion.inputCount,
|
||||
crossing_connector_count: connectors.length,
|
||||
provenance: 'native-road-complex-junction-pavement-region/v1',
|
||||
},
|
||||
geometry: { type: 'MultiPolygon', coordinates: pavementRegion.regions },
|
||||
});
|
||||
} else
|
||||
cornerDiagnostics.push(
|
||||
helpers.diagnostic(
|
||||
'warning',
|
||||
`junction-cluster:${cluster.id}`,
|
||||
[...nodeIds],
|
||||
'complex-junction-pavement-region-disconnected',
|
||||
'过街与入口无法组成连续铺装区域,保留结构输入面并拒绝发布统一铺装面。',
|
||||
center,
|
||||
),
|
||||
);
|
||||
// `coreRadiusMeters` is only consulted when there is no reference geometry.
|
||||
// Under calibration the radius comes from the reference span, so a configured
|
||||
// value that silently does nothing has to be reported, not swallowed.
|
||||
|
||||
Reference in new issue
Block a user