chore(task): archive 08-24-v2x-amap-intersection-data
This commit is contained in:
@@ -0,0 +1 @@
|
||||
{"_example": "Fill with {\"file\": \"<path>\", \"reason\": \"<why>\"}. Put spec/research files only — no code paths. Run `python3 .trellis/scripts/get_context.py --mode packages` to list available specs. Delete this line once real entries are added."}
|
||||
@@ -0,0 +1,82 @@
|
||||
# Design: Live V2X Cesium Intersection View
|
||||
|
||||
## Architecture
|
||||
|
||||
The native pipeline remains the source of static scene geometry and package
|
||||
placement. The existing Cesium preview gains an operations overlay and a compact
|
||||
V2X sign-in gate. Vehicle entities and their trace lines exist only after the
|
||||
authenticated V2X streams provide valid positions; no generated traffic route or
|
||||
simulation is rendered. The implementation stays in the current generated static
|
||||
preview architecture and does not import the source dashboard's Vue, AMap, or
|
||||
Three dependencies.
|
||||
|
||||
The generated preview runtime is divided into four browser concerns:
|
||||
|
||||
1. `auth`: presents the V2X sign-in form, MD5-hashes the password to match the
|
||||
source contract, stores a successful token in `sessionStorage`, and clears it
|
||||
on sign-out or authorization failure.
|
||||
2. `v2x-client`: owns configured REST/WS origins, adds the raw `Authorization`
|
||||
request header, normalizes the source API envelope, and reports a capability
|
||||
status rather than blanking the preview if an optional resource fails.
|
||||
3. `coordinates`: labels external values as GCJ-02 and native values as WGS84 or
|
||||
ENU. It converts V2X GCJ-02 positions to WGS84 exactly once before Cesium
|
||||
entity creation; the existing native package placement contract is unchanged.
|
||||
4. `cesium-v2x-overlay`: adds V2X links, devices, pole/configuration evidence,
|
||||
metrics, and real signal phase updates to the existing Cesium viewer, with
|
||||
independent visibility controls and diagnostics.
|
||||
|
||||
## Data Flow
|
||||
|
||||
```text
|
||||
V2X sign-in -> session token
|
||||
| |
|
||||
| +--> Authorization header / WS query parameter
|
||||
v
|
||||
configured V2X REST + WS endpoints -> GCJ-02 V2X geometry, devices, metrics, lamps
|
||||
|
|
||||
v
|
||||
GCJ-02-to-WGS84 adapter
|
||||
|
|
||||
native package + route/signal descriptors -> WGS84/ENU -> existing Cesium viewer
|
||||
^
|
||||
|
|
||||
Cesium V2X operations overlay
|
||||
```
|
||||
|
||||
## Endpoint Contract
|
||||
|
||||
The first delivery consumes `queryCrossLinkInfo`, `queryPoles`, bound-device,
|
||||
cross-device-config, and weekly flow-ratio APIs. It subscribes to
|
||||
`/network/ws/network/signal` only after link data establishes usable phases.
|
||||
Endpoint host/prefixes and selected `crossCode` are deployment configuration. A
|
||||
development proxy forwards REST and WebSocket traffic so the browser never needs
|
||||
a hard-coded private origin.
|
||||
|
||||
## Coordinate Contract
|
||||
|
||||
| Producer | Source CRS | Consumer rule |
|
||||
| --- | --- | --- |
|
||||
| Native compiler package, traffic signals, route descriptor | WGS84 / local ENU | Preserve the existing Cesium package placement and WGS84 entity contracts. |
|
||||
| V2X dashboard link, road, device, and pole data | GCJ-02 | Convert to WGS84 once before creating Cesium entities. |
|
||||
| High德 reference GeoJSON | GCJ-02 | Calibration-only compiler input; no runtime map or SDK dependency. |
|
||||
|
||||
The existing `gaode-junction-reference` inverse conversion is an appropriate
|
||||
source for the V2X adapter. It will be factored or safely reused only when doing
|
||||
so preserves its compiler behavior and test coverage.
|
||||
|
||||
## Compatibility And Failure Handling
|
||||
|
||||
- Existing Cesium preview and its static-only workflow remain usable.
|
||||
- The V2X overlay starts only after successful sign-in.
|
||||
- An expired token returns the user to sign-in and removes live entities rather
|
||||
than presenting stale data as current.
|
||||
- A REST/WS capability failure is shown in diagnostics; native scene and signals
|
||||
remain usable, while the vehicle layer stays empty rather than simulating data.
|
||||
- Removing the optional overlay/support files restores current preview behavior
|
||||
without changing static package contracts.
|
||||
|
||||
## Security
|
||||
|
||||
`sessionStorage` limits the upstream token to the current tab session. Credentials
|
||||
are never persisted. Configuration examples use placeholders, and deployment
|
||||
documentation requires an HTTPS same-origin reverse proxy for V2X API/WS traffic.
|
||||
@@ -0,0 +1 @@
|
||||
{"_example": "Fill with {\"file\": \"<path>\", \"reason\": \"<why>\"}. Put spec/research files only — no code paths. Run `python3 .trellis/scripts/get_context.py --mode packages` to list available specs. Delete this line once real entries are added."}
|
||||
@@ -0,0 +1,41 @@
|
||||
# Implementation Plan: Live V2X Cesium Intersection View
|
||||
|
||||
1. Read preview and pipeline specifications, then add a focused V2X preview
|
||||
configuration. Keep secrets and private origins out of defaults and tracked
|
||||
area configuration.
|
||||
2. Add browser-safe GCJ-02-to-WGS84 conversion and focused tests for source
|
||||
coordinate labels and prevention of duplicate conversion. Preserve the current
|
||||
compiler reference conversion behavior.
|
||||
3. Implement the V2X browser client: login, session token lifecycle, REST
|
||||
envelope handling, capability errors, and signal WebSocket lifecycle.
|
||||
4. Extend the generated Cesium preview with V2X entities and operations controls
|
||||
for links, devices, poles/configuration, metrics, live signal state, and the
|
||||
OBU/target-vehicle streams. Do not load or generate simulated vehicle routes.
|
||||
5. Add a local development/proxy configuration example and deployment
|
||||
documentation for V2X REST/WS proxying. Do not add an AMap key, SDK, or page.
|
||||
6. Add focused tests for HTML generation, configuration escaping, login/request
|
||||
construction, coordinate conversion, source-layer diagnostics, and graceful
|
||||
unavailable/auth states. Run existing preview and native-road regressions.
|
||||
7. Validate in a browser with a real V2X account and configured proxy: sign in,
|
||||
inspect aligned native/V2X features, verify REST panels and signal updates,
|
||||
then verify sign-out/token expiry behavior.
|
||||
|
||||
## Validation Commands
|
||||
|
||||
```bash
|
||||
node --check scripts/lib/area-preview.js
|
||||
node --check scripts/lib/cesium-preview.js
|
||||
npm run test:gaode-junction-reference
|
||||
npm run test:preview-assets
|
||||
npm run test:native-preview-traffic
|
||||
npm run test:traffic-signals
|
||||
npm run road:compile -- --config config/areas/fengshu-er-road.json
|
||||
npm run build:area -- --config config/areas/fengshu-er-road.json --stages preview
|
||||
```
|
||||
|
||||
## Review Gates
|
||||
|
||||
- Confirm no token, account, or private host is committed.
|
||||
- Verify V2X GCJ-02 coordinates convert once before Cesium use.
|
||||
- Verify the existing native WGS84/ENU scene contract remains unchanged.
|
||||
- Verify the current Cesium preview works without V2X configuration or sign-in.
|
||||
@@ -0,0 +1,85 @@
|
||||
# Integrate live V2X intersection data into Cesium preview
|
||||
|
||||
## Goal
|
||||
|
||||
Provide a Cesium-based operational view of the current complex intersection in
|
||||
this repository. It must show live data from the existing V2X platform while
|
||||
retaining the native road compiler's WGS84/ENU output as the geometry authority.
|
||||
|
||||
## Confirmed Facts
|
||||
|
||||
- The source dashboard's holographic-intersection view uses V2X REST resources for
|
||||
road/link geometry, device bindings, poles, configuration, traffic metrics, and
|
||||
a token-authenticated signal WebSocket.
|
||||
- The dashboard development proxy targets `172.16.1.159:50400` under `/api`,
|
||||
`/websocket`, and `/vectortile`; the application sends the upstream token as the
|
||||
`Authorization` header.
|
||||
- The source dashboard uses AMap and therefore its road/link data is GCJ-02. Its
|
||||
road-network exporter converts that data from GCJ-02 to WGS84 before export.
|
||||
- This repository's native road, signal, and simulation artifacts are WGS84/ENU.
|
||||
- The target is the existing Cesium preview, not AMap. High德 data in this
|
||||
repository is a calibration/reference GeoJSON only, not a target runtime map.
|
||||
- The requested page has a simple login gate; V2X data must remain real live
|
||||
interface data, not copied mock data.
|
||||
|
||||
## Requirements
|
||||
|
||||
- R1: Add a Cesium-based complex-intersection operations view to this repository, protected by
|
||||
a simple application login.
|
||||
- R2: Integrate the real V2X REST endpoints used by the source dashboard, including
|
||||
current intersection/link geometry, devices, poles/configuration, traffic metrics,
|
||||
and signal state where upstream authorization permits it.
|
||||
- R3: Keep the V2X platform credentials separate from the simple application login;
|
||||
do not put a reusable upstream credential into browser source or committed files.
|
||||
- R4: Treat V2X map-facing coordinates as GCJ-02. Treat native compiler artifacts
|
||||
as WGS84/ENU, and convert V2X GCJ-02 coordinates to WGS84 exactly once before
|
||||
adding them to Cesium.
|
||||
- R5: Surface a clear unavailable/authentication state when live data cannot be
|
||||
loaded while leaving the native complex-intersection view usable.
|
||||
- R6: Make endpoint origin, selected V2X intersection code, and authorization
|
||||
mechanism deployment configuration rather than hard-coded source values.
|
||||
- R7: Vehicle lines and moving vehicles must come only from the authenticated
|
||||
V2X vehicle streams. Do not render or fall back to generated route/simulation
|
||||
data when the service is unavailable.
|
||||
|
||||
## Candidate Upstream Resources
|
||||
|
||||
- `GET /network/api/link/network/queryCrossLinkInfo/{crossCode}`: intersection
|
||||
link geometry and signal phase association.
|
||||
- `GET /network/api/pole/network/queryPoles/{crossCode}`: pole and light placement
|
||||
configuration.
|
||||
- `GET /facilities/api/crossDevice/findDeviceByCrossCode/{crossCode}`: bound devices.
|
||||
- `GET /facilities/api/crossDeviceConfig/{crossCode}`: target-device configuration.
|
||||
- `GET /facilities/api/FlowTravelRatio/queryListWeek?code={crossCode}` and related
|
||||
cross-monitor resources: operational metrics.
|
||||
- `WS /network/ws/network/signal?authorization={token}`: live signal lamps.
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
- [ ] A user can pass the local login gate and open the current complex-intersection
|
||||
Cesium view.
|
||||
- [ ] The page retrieves and renders live V2X data for a configurable intersection
|
||||
code without source-dashboard runtime dependencies.
|
||||
- [ ] The page identifies the coordinate reference of each source and visually
|
||||
aligns native WGS84 geometry with V2X data converted from GCJ-02.
|
||||
- [ ] A missing/expired upstream credential or unavailable service is visible and
|
||||
does not make the native intersection view unusable.
|
||||
- [ ] Upstream URL, intersection code, and credentials/tokens are excluded from
|
||||
tracked application source and documented for deployment.
|
||||
|
||||
## Out Of Scope
|
||||
|
||||
- Copying the source dashboard's Vue, AMap/Three, or proprietary UI component stack.
|
||||
- Building a full user/role management service.
|
||||
- Replacing native road geometry or traffic-signal contracts with V2X data.
|
||||
- Generated vehicle-route or traffic-simulation fallback in the operations preview.
|
||||
|
||||
## Authentication Decision
|
||||
|
||||
- The page signs in to the upstream V2X service with the user-entered account,
|
||||
posting `userName` and MD5-hashed `password` to
|
||||
`/facilities/api/sys/login` through the configured API prefix.
|
||||
- The returned token lives only in `sessionStorage`, is sent as the raw
|
||||
`Authorization` header for REST requests, and is supplied as the
|
||||
`authorization` WebSocket query parameter for the signal subscription.
|
||||
- No default credentials, reusable token, or API secret may be committed.
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"id": "v2x-amap-intersection-data",
|
||||
"name": "v2x-amap-intersection-data",
|
||||
"title": "Integrate live V2X intersection data into AMap preview",
|
||||
"description": "",
|
||||
"status": "completed",
|
||||
"dev_type": null,
|
||||
"scope": null,
|
||||
"package": null,
|
||||
"priority": "P2",
|
||||
"creator": "dingkang",
|
||||
"assignee": "dingkang",
|
||||
"createdAt": "2026-08-24",
|
||||
"completedAt": "2026-08-24",
|
||||
"branch": null,
|
||||
"base_branch": "fengshu-er-road",
|
||||
"worktree_path": null,
|
||||
"commit": null,
|
||||
"pr_url": null,
|
||||
"subtasks": [],
|
||||
"children": [],
|
||||
"parent": null,
|
||||
"relatedFiles": [],
|
||||
"notes": "",
|
||||
"meta": {}
|
||||
}
|
||||
Reference in New Issue
Block a user