fix: pave complex junction crossings
This commit is contained in:
1 parent
062f20f34c
commit
914adcc4e6
2 files changed
+95
No files matched your search
@@ -84,6 +84,10 @@ function buildComplexJunctionGeometry(model, cluster, helpers) {
|
||||
const boundaryParts = [];
|
||||
const transitionDiagnostics = [];
|
||||
const crosswalks = [];
|
||||
// A crossing is a connection across a paved carriageway, never decoration
|
||||
// over empty ground. Keep its complete rectangle as an explicit road-surface
|
||||
// component so core closure gaps cannot show through the white stripes.
|
||||
const crosswalkPavements = [];
|
||||
const stopLines = [];
|
||||
const islands = [];
|
||||
const crossingControls = helpers.clusterCrossingControls || new Map();
|
||||
@@ -340,6 +344,28 @@ function buildComplexJunctionGeometry(model, cluster, helpers) {
|
||||
arm.crosswalkFrame.endpoints = endpoints;
|
||||
arm.crosswalkFrame.spanMeters = usableSpan;
|
||||
arm.crosswalkFrame.roadEdgeInsetMeters = roadEdgeInset;
|
||||
const pavementRing = [
|
||||
helpers.offsetCoordinate(endpoints[0], crossingHeading, -groupDepth / 2),
|
||||
helpers.offsetCoordinate(endpoints[1], crossingHeading, -groupDepth / 2),
|
||||
helpers.offsetCoordinate(endpoints[1], crossingHeading, groupDepth / 2),
|
||||
helpers.offsetCoordinate(endpoints[0], crossingHeading, groupDepth / 2),
|
||||
helpers.offsetCoordinate(endpoints[0], crossingHeading, -groupDepth / 2),
|
||||
];
|
||||
crosswalkPavements.push({
|
||||
type: 'Feature',
|
||||
properties: {
|
||||
native_id: `complex-crosswalk-pavement:${cluster.id}:${item.approach.segmentId}`,
|
||||
object_key: `crossing:${arm.key}`,
|
||||
crossing_key: `crossing:${arm.key}`,
|
||||
arm_key: arm.key,
|
||||
cluster_id: cluster.id,
|
||||
kind: 'complex-crosswalk-pavement',
|
||||
complex_part: 'crosswalk-pavement',
|
||||
road_id: item.approach.roadIds[0],
|
||||
provenance: 'native-road-complex-junction-crosswalk-pavement/v1',
|
||||
},
|
||||
geometry: { type: 'Polygon', coordinates: [pavementRing] },
|
||||
});
|
||||
for (let stripe = 0; stripe < stripeCount; stripe += 1) {
|
||||
const along = layout.centers[stripe];
|
||||
const centerPoint = helpers.offsetCoordinate(endpoints[0], bearing(...endpoints), along);
|
||||
@@ -606,6 +632,48 @@ function buildComplexJunctionGeometry(model, cluster, helpers) {
|
||||
const diagonalHeading = outwardHeading;
|
||||
const diagonalCenter = helpers.offsetCoordinate(outerMidpoint, outwardHeading, diagonalDepth / 2);
|
||||
const diagonalSpan = COMPLEX_CROSSWALK_DEPTH_METERS;
|
||||
const diagonalPavementRing = [
|
||||
helpers.offsetCoordinate(
|
||||
helpers.offsetCoordinate(diagonalCenter, diagonalHeading + 90, -diagonalSpan / 2),
|
||||
diagonalHeading,
|
||||
-diagonalDepth / 2,
|
||||
),
|
||||
helpers.offsetCoordinate(
|
||||
helpers.offsetCoordinate(diagonalCenter, diagonalHeading + 90, diagonalSpan / 2),
|
||||
diagonalHeading,
|
||||
-diagonalDepth / 2,
|
||||
),
|
||||
helpers.offsetCoordinate(
|
||||
helpers.offsetCoordinate(diagonalCenter, diagonalHeading + 90, diagonalSpan / 2),
|
||||
diagonalHeading,
|
||||
diagonalDepth / 2,
|
||||
),
|
||||
helpers.offsetCoordinate(
|
||||
helpers.offsetCoordinate(diagonalCenter, diagonalHeading + 90, -diagonalSpan / 2),
|
||||
diagonalHeading,
|
||||
diagonalDepth / 2,
|
||||
),
|
||||
helpers.offsetCoordinate(
|
||||
helpers.offsetCoordinate(diagonalCenter, diagonalHeading + 90, -diagonalSpan / 2),
|
||||
diagonalHeading,
|
||||
-diagonalDepth / 2,
|
||||
),
|
||||
];
|
||||
crosswalkPavements.push({
|
||||
type: 'Feature',
|
||||
properties: {
|
||||
native_id: `complex-corner-crosswalk-pavement:${cluster.id}:${index + 1}`,
|
||||
object_key: `crossing:corner:${first.cornerKey}`,
|
||||
crossing_key: `crossing:corner:${first.cornerKey}`,
|
||||
island_key: `island:inferred/${first.cornerKey}`,
|
||||
cluster_id: cluster.id,
|
||||
kind: 'complex-crosswalk-pavement',
|
||||
complex_part: 'crosswalk-pavement',
|
||||
corner_key: first.cornerKey,
|
||||
provenance: 'native-road-complex-junction-crosswalk-pavement/v1',
|
||||
},
|
||||
geometry: { type: 'Polygon', coordinates: [diagonalPavementRing] },
|
||||
});
|
||||
const layout = stripeLayout(diagonalDepth);
|
||||
const stripeCount = layout.centers.length;
|
||||
const stripeSpacing = layout.pitch;
|
||||
@@ -810,6 +878,7 @@ function buildComplexJunctionGeometry(model, cluster, helpers) {
|
||||
// Corner fills come last so they overlay the rectangular carriageway ends
|
||||
// they are smoothing; they never replace an OSM-derived road surface.
|
||||
features.push(...cornerFills);
|
||||
features.push(...crosswalkPavements);
|
||||
if (coreFeature) features.push(coreFeature);
|
||||
// `coreRadiusMeters` is only consulted when there is no reference geometry.
|
||||
// Under calibration the radius comes from the reference span, so a configured
|
||||
|
||||
Reference in new issue
Block a user