feat(junction): edit complex crossing facilities
This commit is contained in:
1 parent
bb5dc01c07
commit
49a44fdf73
16 files changed
+307
-39
No files matched your search
@@ -151,7 +151,9 @@ function buildComplexJunctionGeometry(model, cluster, helpers) {
|
||||
const crosswalks = [];
|
||||
const stopLines = [];
|
||||
const islands = [];
|
||||
const armCrosswalkRadius = coreRadius * 0.68;
|
||||
const crossingControls = helpers.clusterCrossingControls || new Map();
|
||||
const armCrosswalkRadiusFor = (arm) =>
|
||||
Math.max(1, coreRadius * 0.68 + (crossingControls.get(`crossing:${arm.key}`)?.crosswalkInsetMeters || 0));
|
||||
for (const item of carriageways) {
|
||||
// The approach plan owns the editable handoff distance. It shifts only this
|
||||
// carriageway's outer transition, leaving neighboring arms untouched.
|
||||
@@ -167,7 +169,11 @@ function buildComplexJunctionGeometry(model, cluster, helpers) {
|
||||
if (incomingRoad) {
|
||||
// Keep the stop bar just outside the road crosswalk. The previous fixed
|
||||
// core-radius offset placed it nearly ten metres beyond the crossing.
|
||||
const stopCenter = pointOnCarriagewayRadius(item, center, armCrosswalkRadius + 3, helpers);
|
||||
const arm = arms.find((candidate) => candidate.members.includes(item));
|
||||
const crossingKey = `crossing:${arm.key}`;
|
||||
const crossingRadius = armCrosswalkRadiusFor(arm);
|
||||
const stopOffset = crossingControls.get(crossingKey)?.stopLineOffsetMeters || 3;
|
||||
const stopCenter = pointOnCarriagewayRadius(item, center, crossingRadius + stopOffset, helpers);
|
||||
const ring = [
|
||||
helpers.offsetCoordinate(
|
||||
helpers.offsetCoordinate(stopCenter, item.heading + 90, -outerHalf),
|
||||
@@ -200,6 +206,7 @@ function buildComplexJunctionGeometry(model, cluster, helpers) {
|
||||
properties: {
|
||||
native_id: `complex-stop-line:${cluster.id}:${item.approach.segmentId}`,
|
||||
object_key: `stop-line:${item.key}`,
|
||||
crossing_key: crossingKey,
|
||||
arm_key: item.armKey,
|
||||
carriageway_key: item.key,
|
||||
cluster_id: cluster.id,
|
||||
@@ -217,6 +224,8 @@ function buildComplexJunctionGeometry(model, cluster, helpers) {
|
||||
// crossing remains clipped to its OSM-derived road envelope. Corner islands
|
||||
// fill the remaining frame gaps; crossings must never do that job.
|
||||
for (const arm of arms) {
|
||||
const armCrosswalkRadius = armCrosswalkRadiusFor(arm);
|
||||
arm.crosswalkRadius = armCrosswalkRadius;
|
||||
const envelope = armEnvelopeAtRadius(arm, armCrosswalkRadius, center, helpers);
|
||||
if (!envelope) continue;
|
||||
arm.crosswalkFrame = {
|
||||
@@ -285,13 +294,14 @@ function buildComplexJunctionGeometry(model, cluster, helpers) {
|
||||
properties: {
|
||||
native_id: `complex-crosswalk:${cluster.id}:${item.nodeId}:${item.approach.segmentId}:${stripe + 1}`,
|
||||
object_key: `crossing:${arm.key}`,
|
||||
crossing_key: `crossing:${arm.key}`,
|
||||
arm_key: arm.key,
|
||||
cluster_id: cluster.id,
|
||||
kind: 'complex-crosswalk',
|
||||
crossing_node_id: item.nodeId,
|
||||
road_id: item.approach.roadIds[0],
|
||||
direction: arm.heading,
|
||||
radial_distance_m: armCrosswalkRadius,
|
||||
radial_distance_m: arm.crosswalkRadius,
|
||||
span_m: usableSpan,
|
||||
road_envelope_span_m: arm.crosswalkFrame.envelopeWidthMeters,
|
||||
road_edge_inset_m: roadEdgeInset,
|
||||
|
||||
Reference in new issue
Block a user