test: make road compiler fixtures self contained
This commit is contained in:
1 parent
284d3dbedb
commit
2469cfdbff
4 files changed
+18
-11
No files matched your search
@@ -147,6 +147,11 @@ cp config/examples/template.json config/areas/my-area.json
|
|||||||
| `junctionTemplates.clusters[].cornerRadiusMeters` | `12`(4–25) | 仅 `complex-junction-v1`:相邻进口夹角处路缘圆角的半径。圆角切于两侧最外道路边缘,只补齐夹角处的路面,不改变 connector、信号或停止线。 |
|
| `junctionTemplates.clusters[].cornerRadiusMeters` | `12`(4–25) | 仅 `complex-junction-v1`:相邻进口夹角处路缘圆角的半径。圆角切于两侧最外道路边缘,只补齐夹角处的路面,不改变 connector、信号或停止线。 |
|
||||||
| `junctionTemplates.clusters[].outerRadiusExtraMeters` | `18`(18–35) | 仅 `complex-junction-v1`:路口中心到外部进口交接边界的额外半径。用于让圆角包住角部斑马线;未配置时保持原有 18 m。 |
|
| `junctionTemplates.clusters[].outerRadiusExtraMeters` | `18`(18–35) | 仅 `complex-junction-v1`:路口中心到外部进口交接边界的额外半径。用于让圆角包住角部斑马线;未配置时保持原有 18 m。 |
|
||||||
|
|
||||||
|
`junctionTemplates.references[*].referenceFile` 与
|
||||||
|
`junctionTemplates.clusters[*].referenceFile` 是唯一允许相对写法的路径:相对当前
|
||||||
|
`config/areas/<id>.json` 解析。`readAreaConfig()` 会先将其规范化为绝对路径,再通过
|
||||||
|
`toRoadCompilerInput()` 传入 road compiler;包内不得自行解析相对路径或读取配置文件。
|
||||||
|
|
||||||
### `v2xPreview`
|
### `v2xPreview`
|
||||||
|
|
||||||
这是 Cesium 验证预览的可选实时叠加层,不进入发布的 `package/`。默认值:
|
这是 Cesium 验证预览的可选实时叠加层,不进入发布的 `package/`。默认值:
|
||||||
|
|||||||
@@ -66,14 +66,14 @@
|
|||||||
|
|
||||||
## Acceptance Criteria
|
## Acceptance Criteria
|
||||||
|
|
||||||
- [ ] AC1.1 两个有效区域 `road-parity --compare` 对 Phase 0 基线全绿
|
- [x] AC1.1 两个有效区域 `road-parity --compare` 对 Phase 0 基线全绿
|
||||||
- [ ] AC1.2 `npm run test:native-road`、`npm run test:road-workbench` 通过
|
- [x] AC1.2 `npm run test:native-road`、`npm run test:road-workbench` 通过
|
||||||
- [ ] AC1.3 `npm run build:area` 枫树二路完整跑通(含 blender / cesium 阶段)
|
- [x] AC1.3 `npm run build:area` 枫树二路完整跑通(含 blender / cesium 阶段)
|
||||||
- [ ] AC1.4 `grep -rn "area-config\|config/areas" packages/road-compiler/` 无命中
|
- [x] AC1.4 `grep -rn "area-config\|config/areas" packages/road-compiler/` 无命中
|
||||||
- [ ] AC1.5 `packages/road-compiler/` 内 `npm test` 不访问宿主 `inputs/` 或 `outputs/`
|
- [x] AC1.5 `packages/road-compiler/` 内 `npm test` 不访问宿主 `inputs/` 或 `outputs/`
|
||||||
- [ ] AC1.6 `scripts/lib/` 下无搬迁文件的残留副本
|
- [x] AC1.6 `scripts/lib/` 下无搬迁文件的残留副本
|
||||||
- [ ] AC1.7 K1 的「函数 × 使用方」矩阵已产出并归档到 `research/`
|
- [x] AC1.7 K1 的「函数 × 使用方」矩阵已产出并归档到 `research/`
|
||||||
- [ ] AC1.8 `compiled.json` 结构未变(父任务 AC7 / C1)
|
- [x] AC1.8 `compiled.json` 结构未变(父任务 AC7 / C1)
|
||||||
|
|
||||||
## 依赖与顺序
|
## 依赖与顺序
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
{"type":"FeatureCollection","features":[{"type":"Feature","id":"10","properties":{"type":1},"geometry":{"type":"MultiPolygon","coordinates":[[[[114.12670642509887,30.459719866954526],[114.12672480418713,30.459728657730796],[114.12674493919597,30.459737997306732],[114.1267833123607,30.459756158076946],[114.12680436982367,30.45976593212108],[114.12685397313732,30.459789508849415],[114.12690012817846,30.45981125331352],[114.12696581650293,30.459842297256657],[114.12703599666129,30.459875724524046],[114.1270498805918,30.45988229362388],[114.12705936578135,30.459887101893713],[114.12713738017123,30.459929772755643],[114.1272371446353,30.459984098991324],[114.12732032068887,30.460029332274345],[114.12756802667649,30.460156811375963],[114.1276272681774,30.46018476753933],[114.12767330666927,30.460206334960937],[114.12774798860086,30.460241752793856],[114.12781876709889,30.460274913778548],[114.12793737942023,30.46033070051492],[114.12802476152558,30.460371550079984],[114.12803377753897,30.460375985604387],[114.12804110941299,30.460380028660342],[114.12805101374497,30.460386354257707],[114.12806883527543,30.460398025244622],[114.12808654794983,30.46041118828605],[114.12809933710143,30.46042164630667],[114.1281073950421,30.460428573291047],[114.12811395128384,30.460434620557336],[114.12811938213294,30.460440066689017],[114.12812926407065,30.460450347349173],[114.12813473454605,30.46045657462467],[114.12814164327082,30.460464424462735],[114.12814730374363,30.460471255615666],[114.12815294371121,30.460478077312562],[114.12815879253623,30.460486283596325],[114.1281645602278,30.460494776825477],[114.12816883816927,30.460501272024807],[114.12817349886402,30.460509245696944],[114.1281771352045,30.460517071410813],[114.12817986770692,30.460522406328934],[114.12818358105403,30.460530441147434],[114.12818686670175,30.46053817825591],[114.12819018776598,30.460545819342492],[114.12819418910176,30.46055564186251],[114.12820380410353,30.460582194804786],[114.12820842032188,30.46060375471472],[114.12821202983478,30.46062954010985],[114.1282137381741,30.46064526447438],[114.12821400817043,30.460653439918755],[114.12821393731382,30.46067277098964],[114.12821257637805,30.46069672891237],[114.12821098332131,30.460710299619304],[114.12820721720577,30.460726258836115],[114.12819314233184,30.460756750044617],[114.12817805241743,30.46078387834311],[114.1281664689422,30.460803920591136],[114.12815723705758,30.46081876175518],[114.12813556102246,30.46085392543641],[114.12786187058398,30.461286782141404],[114.12767310863411,30.461588040608625],[114.12749605673096,30.46186848121499],[114.12771556983981,30.46197223706339],[114.12829921553568,30.46103318454979],[114.12834745214138,30.460953266211526],[114.12837228716977,30.460914859036752],[114.1283903573218,30.460889225666122],[114.12840962380116,30.46086537779413],[114.12842658919257,30.46084461385105],[114.12844027647458,30.460830720633155],[114.12845700359827,30.460817290594896],[114.12846927807756,30.460807952031754],[114.1284793259837,30.46080120044445],[114.12848732126338,30.46079615416839],[114.12849824982679,30.460790108078196],[114.12851735673152,30.46078057113085],[114.12853428994015,30.460773234382117],[114.12854767478771,30.460768204092016],[114.12856867125925,30.460760493145365],[114.12858706934223,30.460754937340415],[114.12861834861083,30.46074820545063],[114.12862756243905,30.46074661029612],[114.12864869683986,30.46074212232996],[114.12865920934019,30.460740441110147],[114.12866868493343,30.460739396487128],[114.12868036248904,30.460738380348605],[114.12868990874968,30.460737761184348],[114.12870180719327,30.460737363112344],[114.12871667998598,30.460737392256405],[114.1287292771692,30.46073780823301],[114.1287499886682,30.46073912084974],[114.12876640653077,30.460741578573987],[114.12877789632182,30.460743427010925],[114.12878992723334,30.460745602599992],[114.12880068089633,30.46074775119988],[114.12881210760563,30.460750689795557],[114.12882252563773,30.460753300372676],[114.12882949358202,30.460755215632997],[114.12884206581988,30.460759486418695],[114.12884823128418,30.460761483949376],[114.12890089866964,30.460782505183808],[114.12891485544512,30.460788816797255],[114.12895540785316,30.460808048501978],[114.12902501127174,30.46084044145126],[114.12908466293443,30.460868698056956],[114.12910546198879,30.46087847390208],[114.1291300006723,30.460890007409656],[114.12917162969823,30.4609095887503],[114.12927120714293,30.460956547967346],[114.12935900625274,30.460997903663344],[114.12943766593234,30.461035023980024],[114.12945728539037,30.461044170004904],[114.12947426624748,30.461052231980972],[114.12948015380047,30.46105484591913],[114.12948639545796,30.4610574312437],[114.1294967439802,30.461061699880304],[114.12951325767341,30.461068326698438],[114.12953869523535,30.4610785199137],[114.12956431897612,30.461088970193117],[114.12959304786149,30.461100566489673],[114.1296316067205,30.461116134315017],[114.12965073525396,30.461123943783882],[114.1296767364358,30.46113443300Line truncated
|
||||||
@@ -164,12 +164,13 @@ assert.equal(clusterApproaches.filter((feature) => feature.properties.kind === "
|
|||||||
assert.ok(clusterApproachGeometry.diagnostics.some((item) => item.rule === "complex-junction-insufficient-nodes"));
|
assert.ok(clusterApproachGeometry.diagnostics.some((item) => item.rule === "complex-junction-insufficient-nodes"));
|
||||||
assert.equal(clusterApproachGeometry.intersectionSurface.features.length, 0);
|
assert.equal(clusterApproachGeometry.intersectionSurface.features.length, 0);
|
||||||
|
|
||||||
const fengshuOsm = fs.readFileSync(path.join(__dirname, "..", "inputs", "osm", "枫树二路.osm"), "utf8");
|
const fixtureDir = path.join(__dirname, "..", "packages", "road-compiler", "test", "fixtures");
|
||||||
|
const fengshuOsm = fs.readFileSync(path.join(fixtureDir, "fengshu-er-road.osm"), "utf8");
|
||||||
const fengshuModel = compileRoadModel(fengshuOsm, empty);
|
const fengshuModel = compileRoadModel(fengshuOsm, empty);
|
||||||
const fengshuCluster = {
|
const fengshuCluster = {
|
||||||
id: "zhushanhu-fengshu-complex",
|
id: "zhushanhu-fengshu-complex",
|
||||||
template: "complex-junction-v1",
|
template: "complex-junction-v1",
|
||||||
referenceFile: path.join(__dirname, "..", "inputs", "osm", "珠山湖大道(枫树二路)口.geojson"),
|
referenceFile: path.join(fixtureDir, "fengshu-junction-reference.geojson"),
|
||||||
approachWidthMultiplier: 1.45,
|
approachWidthMultiplier: 1.45,
|
||||||
approachLengthMeters: 32,
|
approachLengthMeters: 32,
|
||||||
coreRadiusMeters: 28,
|
coreRadiusMeters: 28,
|
||||||
@@ -187,7 +188,7 @@ assert.equal(fengshuConfiguredSidewalks.length, 2, "sidewalk overrides on comple
|
|||||||
const fengshuConfiguredCore = fengshuSidewalkGeometry.roadSurface.features.find((feature) => feature.properties.kind === "complex-core");
|
const fengshuConfiguredCore = fengshuSidewalkGeometry.roadSurface.features.find((feature) => feature.properties.kind === "complex-core");
|
||||||
assert.ok(fengshuConfiguredSidewalks.every((feature) => !ringsOverlap(feature.geometry.coordinates[0], fengshuConfiguredCore.geometry.coordinates[0])), "configured sidewalks stop at the complex-junction handoff instead of entering its core");
|
assert.ok(fengshuConfiguredSidewalks.every((feature) => !ringsOverlap(feature.geometry.coordinates[0], fengshuConfiguredCore.geometry.coordinates[0])), "configured sidewalks stop at the complex-junction handoff instead of entering its core");
|
||||||
assert.equal(fengshuSidewalkGeometry.sidewalkSurface.features.filter((feature) => feature.properties.provenance === "native-road-sidewalk-corner/v1" && fengshuCluster.nodeIds.includes(String(feature.properties.osm_node_id))).length, 0, "ordinary sidewalk corners are not generated at member nodes of a complex junction");
|
assert.equal(fengshuSidewalkGeometry.sidewalkSurface.features.filter((feature) => feature.properties.provenance === "native-road-sidewalk-corner/v1" && fengshuCluster.nodeIds.includes(String(feature.properties.osm_node_id))).length, 0, "ordinary sidewalk corners are not generated at member nodes of a complex junction");
|
||||||
const genericComplexSource = fs.readFileSync(path.join(__dirname, "lib", "complex-junction.js"), "utf8");
|
const genericComplexSource = fs.readFileSync(path.join(__dirname, "..", "packages", "road-compiler", "src", "compile", "complex-junction.js"), "utf8");
|
||||||
assert.doesNotMatch(genericComplexSource, /8005332807|8024512135|8024512145|8024512147|858770823|珠山湖|枫树二路/, "complex junction generator must not contain sample-specific identifiers");
|
assert.doesNotMatch(genericComplexSource, /8005332807|8024512135|8024512145|8024512147|858770823|珠山湖|枫树二路/, "complex junction generator must not contain sample-specific identifiers");
|
||||||
const renamedCluster = { ...fengshuCluster, id: "generic-complex-validation-cluster" };
|
const renamedCluster = { ...fengshuCluster, id: "generic-complex-validation-cluster" };
|
||||||
const renamedGeometry = compileGeometry(fengshuModel, empty, { edgeLines: false, junctionTemplates: { enabled: true, references: [], clusters: [renamedCluster] } });
|
const renamedGeometry = compileGeometry(fengshuModel, empty, { edgeLines: false, junctionTemplates: { enabled: true, references: [], clusters: [renamedCluster] } });
|
||||||
|
|||||||
Reference in new issue
Block a user