feat: add immutable road revision storage

This commit is contained in:
2026-08-26 17:54:38 +08:00
parent 35002371ae
commit c0c8a16dd4
7 changed files with 373 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ const { generate, validateDocument, runtime } = require('../src/native-traffic-s
const { convertGeoJson } = require('../src/reference/gaode');
const { exportNativeRoadPackage } = require('../src/export/native-road-package');
const { compileInput } = require('../src/compile/compiler');
const { ensureRevisionStore } = require('../src/compile/road-revisions');
function startWorkbench({
area = null,
@@ -167,6 +168,9 @@ function handle(request, response, session) {
}
function state(area, junctionReference = null, debug = false) {
// This is the read entry point for both a fresh import and a reopened legacy
// workspace. Initialization only adds the v2 layout; it never rewrites v1 files.
ensureRevisionStore(path.dirname(area.input));
const nativeDir = area.outputs.nativeRoadDir;
const osm2streetsRoadSurface = area.outputs.geojsonDir
? path.join(area.outputs.geojsonDir, 'road_surface.geojson')
@@ -325,6 +329,7 @@ function readUpload(request, session) {
);
try {
const compiled = compileInput(input);
ensureRevisionStore(root);
session.area = compiled.area;
return compiled;
} catch (error) {