gisviewer-vue3-arcgis 1.0.115 → 1.0.116

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/es/src/gis-map/gis-map.vue.d.ts +5 -3
  2. package/es/src/gis-map/gis-map.vue.mjs +93 -92
  3. package/es/src/gis-map/index.d.ts +4 -2
  4. package/es/src/gis-map/stores/appData.d.ts +3 -0
  5. package/es/src/gis-map/stores/appData.mjs +7 -4
  6. package/es/src/gis-map/utils/common-utils.d.ts +12 -0
  7. package/es/src/gis-map/utils/common-utils.mjs +81 -43
  8. package/es/src/gis-map/utils/holo-flow/trace-renderer-external.mjs +3 -3
  9. package/es/src/gis-map/utils/holo-flow/trace-renderer-layer.mjs +0 -1
  10. package/es/src/gis-map/utils/open-drive-renderer/draw-bezier.d.ts +17 -0
  11. package/es/src/gis-map/utils/open-drive-renderer/draw-bezier.mjs +49 -0
  12. package/es/src/gis-map/utils/open-drive-renderer/index.d.ts +31 -3
  13. package/es/src/gis-map/utils/open-drive-renderer/index.mjs +274 -44
  14. package/es/src/gis-map/utils/open-drive-renderer/junction.d.ts +50 -0
  15. package/es/src/gis-map/utils/open-drive-renderer/junction.mjs +151 -0
  16. package/es/src/gis-map/utils/open-drive-renderer/lane-section.d.ts +48 -0
  17. package/es/src/gis-map/utils/open-drive-renderer/lane-section.mjs +82 -0
  18. package/es/src/gis-map/utils/open-drive-renderer/lane-utils.d.ts +29 -0
  19. package/es/src/gis-map/utils/open-drive-renderer/lane-utils.mjs +265 -0
  20. package/es/src/gis-map/utils/open-drive-renderer/lane.d.ts +70 -0
  21. package/es/src/gis-map/utils/open-drive-renderer/lane.mjs +93 -0
  22. package/es/src/gis-map/utils/open-drive-renderer/road.d.ts +60 -0
  23. package/es/src/gis-map/utils/open-drive-renderer/road.mjs +113 -0
  24. package/es/src/gis-map/utils/open-drive-renderer/wasm-loader.d.ts +88 -0
  25. package/es/src/gis-map/utils/open-drive-renderer/wasm-loader.mjs +366 -0
  26. package/es/src/types/index.d.ts +48 -0
  27. package/lib/src/gis-map/gis-map.vue.d.ts +5 -3
  28. package/lib/src/gis-map/gis-map.vue.js +1 -1
  29. package/lib/src/gis-map/index.d.ts +4 -2
  30. package/lib/src/gis-map/stores/appData.d.ts +3 -0
  31. package/lib/src/gis-map/stores/appData.js +1 -1
  32. package/lib/src/gis-map/utils/common-utils.d.ts +12 -0
  33. package/lib/src/gis-map/utils/common-utils.js +1 -1
  34. package/lib/src/gis-map/utils/holo-flow/trace-renderer-external.js +1 -1
  35. package/lib/src/gis-map/utils/holo-flow/trace-renderer-layer.js +1 -1
  36. package/lib/src/gis-map/utils/open-drive-renderer/draw-bezier.d.ts +17 -0
  37. package/lib/src/gis-map/utils/open-drive-renderer/draw-bezier.js +1 -0
  38. package/lib/src/gis-map/utils/open-drive-renderer/index.d.ts +31 -3
  39. package/lib/src/gis-map/utils/open-drive-renderer/index.js +1 -1
  40. package/lib/src/gis-map/utils/open-drive-renderer/junction.d.ts +50 -0
  41. package/lib/src/gis-map/utils/open-drive-renderer/junction.js +1 -0
  42. package/lib/src/gis-map/utils/open-drive-renderer/lane-section.d.ts +48 -0
  43. package/lib/src/gis-map/utils/open-drive-renderer/lane-section.js +1 -0
  44. package/lib/src/gis-map/utils/open-drive-renderer/lane-utils.d.ts +29 -0
  45. package/lib/src/gis-map/utils/open-drive-renderer/lane-utils.js +1 -0
  46. package/lib/src/gis-map/utils/open-drive-renderer/lane.d.ts +70 -0
  47. package/lib/src/gis-map/utils/open-drive-renderer/lane.js +1 -0
  48. package/lib/src/gis-map/utils/open-drive-renderer/road.d.ts +60 -0
  49. package/lib/src/gis-map/utils/open-drive-renderer/road.js +1 -0
  50. package/lib/src/gis-map/utils/open-drive-renderer/wasm-loader.d.ts +88 -0
  51. package/lib/src/gis-map/utils/open-drive-renderer/wasm-loader.js +1 -0
  52. package/lib/src/types/index.d.ts +48 -0
  53. package/package.json +4 -1
@@ -0,0 +1,82 @@
1
+ import a from "../common-utils.mjs";
2
+ import g from "./lane.mjs";
3
+ class m {
4
+ constructor(s, r) {
5
+ this.s0 = s.s0, this.road = r, this.idToLane = /* @__PURE__ */ new Map(), a.getStdVecEntries(
6
+ s.odr_lanes,
7
+ !0
8
+ ).forEach((l) => {
9
+ const n = new g(l, r, this);
10
+ this.idToLane.set(n.id, n);
11
+ }), this.borders = this.getBorderLine();
12
+ const e = [];
13
+ e.push(...this.borders.right), e.push(...this.borders.top), e.push(...[...this.borders.left].reverse()), e.push(...[...this.borders.bottom].reverse()), e.push(e[0]), this.polygon = e;
14
+ }
15
+ /**
16
+ * 获取一个车道
17
+ * @param id
18
+ * @returns
19
+ */
20
+ getLane(s) {
21
+ return this.idToLane.get(s);
22
+ }
23
+ /**
24
+ * 获取所有车道
25
+ * @returns
26
+ */
27
+ get allLanes() {
28
+ return [...this.idToLane.values()];
29
+ }
30
+ get laneNumber() {
31
+ return this.idToLane.size;
32
+ }
33
+ /**
34
+ * 获取所有车道id,id升序排列
35
+ * @returns
36
+ */
37
+ get allLaneIds() {
38
+ return [...this.idToLane.keys()].sort((s, r) => s - r);
39
+ }
40
+ /**
41
+ * 路段采样后的数据
42
+ */
43
+ get sampledLaneSection() {
44
+ const s = this.allLanes.filter((r) => r.id !== 0);
45
+ return {
46
+ id: this.s0,
47
+ lanePaths: s.map((r) => r.sampledLane)
48
+ };
49
+ }
50
+ /**
51
+ * 计算路段上下左右边框
52
+ * @returns
53
+ */
54
+ getBorderLine() {
55
+ let s = [], r = [];
56
+ const t = [], e = [], l = this.allLaneIds;
57
+ return l.filter((n) => n !== 0).forEach((n, p) => {
58
+ const o = this.getLane(n), i = o.innerBorder[o.innerBorder.length - 1], u = o.outerBorder[o.outerBorder.length - 1], h = o.innerBorder[0], d = o.outerBorder[0];
59
+ p === 0 ? (r = o.outerBorder, t.push(i), e.push(h)) : p === l.length - 2 ? (s = o.outerBorder, t.push(i), e.push(h)) : o.id < 0 ? (a.pointsEqual(
60
+ u,
61
+ t[t.length - 1]
62
+ ) || t.push(u), t.push(i), a.pointsEqual(
63
+ d,
64
+ e[e.length - 1]
65
+ ) || e.push(d), e.push(h)) : (a.pointsEqual(
66
+ i,
67
+ t[t.length - 1]
68
+ ) || t.push(i), t.push(u), a.pointsEqual(
69
+ h,
70
+ e[e.length - 1]
71
+ ) || e.push(h), e.push(d));
72
+ }), {
73
+ left: s,
74
+ right: r,
75
+ top: t,
76
+ bottom: e
77
+ };
78
+ }
79
+ }
80
+ export {
81
+ m as default
82
+ };
@@ -0,0 +1,29 @@
1
+ import { ILaneInfo } from '../../../types';
2
+ import Lane from './lane';
3
+ export default class LaneUtils {
4
+ private static shpLanePolygonMap;
5
+ private static shpArrowPositionMap;
6
+ /**
7
+ * 判断车道航向角是否和参考线方向一致,
8
+ * 道路两端都连接到道路时无法计算,默认为true
9
+ * @param lane
10
+ * @returns
11
+ */
12
+ static isLaneDirEqualDriveDir(lane: Lane): boolean;
13
+ /**
14
+ * 计算车道航向角
15
+ * @param lane
16
+ * @returns
17
+ */
18
+ static getDriveAngle(lane: Lane): number;
19
+ /**
20
+ * 获取车道首尾端点,包括内侧、中间、外侧
21
+ * @param type
22
+ * @returns
23
+ */
24
+ static getLaneEndPoints(lane: Lane, type?: string): number[][];
25
+ static getPrevAndNext(lane: Lane): {
26
+ predecessorLanes: ILaneInfo[];
27
+ successorLanes: ILaneInfo[];
28
+ };
29
+ }
@@ -0,0 +1,265 @@
1
+ import h from "@turf/bearing";
2
+ import * as I from "@turf/helpers";
3
+ import a from "./wasm-loader.mjs";
4
+ const L = class {
5
+ /**
6
+ * 判断车道航向角是否和参考线方向一致,
7
+ * 道路两端都连接到道路时无法计算,默认为true
8
+ * @param lane
9
+ * @returns
10
+ */
11
+ static isLaneDirEqualDriveDir(e) {
12
+ var s, i;
13
+ let t = 0;
14
+ if (((s = e.road.predecessor) == null ? void 0 : s.elementType) === "junction") {
15
+ const c = e.road.predecessor.elementId, n = a.getInstance().junctionList.get(c);
16
+ if (n) {
17
+ for (const d of n.laneLinks)
18
+ if (d.outgoing.roadId === e.road.id) {
19
+ t = d.outgoing.laneId;
20
+ break;
21
+ }
22
+ }
23
+ } else if (((i = e.road.successor) == null ? void 0 : i.elementType) === "junction") {
24
+ const c = e.road.successor.elementId, n = a.getInstance().junctionList.get(c);
25
+ if (n) {
26
+ for (const d of n.laneLinks)
27
+ if (d.incoming.roadId === e.road.id) {
28
+ t = d.incoming.laneId;
29
+ break;
30
+ }
31
+ }
32
+ }
33
+ return t === 0 ? !0 : t * e.id > 0;
34
+ }
35
+ /**
36
+ * 计算车道航向角
37
+ * @param lane
38
+ * @returns
39
+ */
40
+ static getDriveAngle(e) {
41
+ const t = L.getLaneEndPoints(e), s = I.point(t[0]), i = I.point(t[1]);
42
+ return h(s, i);
43
+ }
44
+ /**
45
+ * 获取车道首尾端点,包括内侧、中间、外侧
46
+ * @param type
47
+ * @returns
48
+ */
49
+ static getLaneEndPoints(e, t = "middle") {
50
+ let s, i, c, n;
51
+ switch (e.isDirEqual ? (s = e.innerBorder[0], i = e.innerBorder[e.innerBorder.length - 1], c = e.outerBorder[0], n = e.outerBorder[e.outerBorder.length - 1]) : (s = e.innerBorder[e.innerBorder.length - 1], i = e.innerBorder[0], c = e.outerBorder[e.outerBorder.length - 1], n = e.outerBorder[0]), t) {
52
+ case "inner":
53
+ return [s, i];
54
+ case "outer":
55
+ return [c, n];
56
+ default: {
57
+ const d = [
58
+ (s[0] + c[0]) / 2,
59
+ (s[1] + c[1]) / 2
60
+ ], f = [
61
+ (i[0] + n[0]) / 2,
62
+ (i[1] + n[1]) / 2
63
+ ];
64
+ return [d, f];
65
+ }
66
+ }
67
+ }
68
+ static getPrevAndNext(e) {
69
+ var n, d, f, p;
70
+ const t = [], s = [], i = e.laneSection.s0 === 0, c = e.road.isLastLaneSection(e.laneSection.s0);
71
+ if (i) {
72
+ if (((n = e.road.predecessor) == null ? void 0 : n.elementType) === "junction") {
73
+ const o = a.getInstance().junctionList.get(
74
+ e.road.predecessor.elementId
75
+ );
76
+ if (o) {
77
+ const r = o.getSuccessorForIncoming(
78
+ e.road.id,
79
+ e.id
80
+ );
81
+ if (r.length > 0)
82
+ s.push(...r);
83
+ else {
84
+ const u = o.getPredecessorForOutgoing(
85
+ e.road.id,
86
+ e.id
87
+ );
88
+ t.push(...u);
89
+ }
90
+ }
91
+ } else if (((d = e.road.predecessor) == null ? void 0 : d.elementType) === "road" && e.predecessor !== 0) {
92
+ const o = e.road.predecessor.elementId;
93
+ let r = 0;
94
+ if (e.road.predecessor.contactPoint === "end") {
95
+ const g = a.getInstance().roadList.get(o);
96
+ g && (r = g.getLastLaneSection().s0);
97
+ }
98
+ const u = {
99
+ roadId: o,
100
+ sectionId: r,
101
+ laneId: e.predecessor
102
+ };
103
+ e.isDirEqual ? t.push(u) : s.push(u);
104
+ }
105
+ } else if (e.predecessor !== 0) {
106
+ const o = e.road.getPrevLaneSection(e.laneSection.s0);
107
+ if (o) {
108
+ const r = {
109
+ roadId: e.road.id,
110
+ sectionId: o.s0,
111
+ laneId: e.predecessor
112
+ };
113
+ e.isDirEqual ? t.push(r) : s.push(r);
114
+ }
115
+ }
116
+ if (c) {
117
+ if (((f = e.road.successor) == null ? void 0 : f.elementType) === "junction") {
118
+ const o = a.getInstance().junctionList.get(
119
+ e.road.successor.elementId
120
+ );
121
+ if (o) {
122
+ const r = o.getSuccessorForIncoming(
123
+ e.road.id,
124
+ e.id
125
+ );
126
+ if (r.length > 0)
127
+ s.push(...r);
128
+ else {
129
+ const u = o.getPredecessorForOutgoing(
130
+ e.road.id,
131
+ e.id
132
+ );
133
+ t.push(...u);
134
+ }
135
+ }
136
+ } else if (((p = e.road.successor) == null ? void 0 : p.elementType) === "road" && e.successor !== 0) {
137
+ const o = e.road.successor.elementId;
138
+ let r = 0;
139
+ if (e.road.successor.contactPoint === "end") {
140
+ const g = a.getInstance().roadList.get(o);
141
+ g && (r = g.getLastLaneSection().s0);
142
+ }
143
+ const u = {
144
+ roadId: o,
145
+ sectionId: r,
146
+ laneId: e.successor
147
+ };
148
+ e.isDirEqual ? s.push(u) : t.push(u);
149
+ }
150
+ } else if (e.successor !== 0) {
151
+ const o = e.road.getNextLaneSection(e.laneSection.s0);
152
+ if (o) {
153
+ const r = {
154
+ roadId: e.road.id,
155
+ sectionId: o.s0,
156
+ laneId: e.successor
157
+ };
158
+ e.isDirEqual ? s.push(r) : t.push(r);
159
+ }
160
+ }
161
+ return { predecessorLanes: t, successorLanes: s };
162
+ }
163
+ /**
164
+ * 获取OpenDrive车道对应的高精地图中的车道面
165
+ * @param lane
166
+ */
167
+ // public static getShpLanePolygonOfXodrLane(lane: Lane) {
168
+ // const xodrLanePolygon = turf.polygon([lane.polygon]);
169
+ // const xodrLaneCenter = centerOfMass(xodrLanePolygon);
170
+ // const shpLanePolygons = LaneUtils.getShpLanePolygonsInProject("road");
171
+ // // xodr车道的中心点在哪个shp车道面内
172
+ // const shpLanePolygon = shpLanePolygons.find((shpLanePolygon) =>
173
+ // booleanWithin(xodrLaneCenter, shpLanePolygon)
174
+ // );
175
+ // return shpLanePolygon;
176
+ // }
177
+ /**
178
+ * 获取此项目的车道面
179
+ * @param projectName
180
+ * @returns
181
+ */
182
+ // private static getShpLanePolygonsInProject(
183
+ // projectName: string
184
+ // ): turf.Feature<turf.Polygon, turf.Properties>[] {
185
+ // let polygons = LaneUtils.shpLanePolygonMap.get(projectName);
186
+ // // 尚未加载车道面图层
187
+ // if (!polygons) {
188
+ // // 车道面图层地址
189
+ // const layerFilePath = path.join(
190
+ // __dirname,
191
+ // // 默认项目名为"road"
192
+ // projectName === "road"
193
+ // ? "../../../public/files/layers/LanePolygon.json"
194
+ // : `../../../public/files/layers/${projectName}_LanePolygon.json`
195
+ // );
196
+ // const dataString = readFileSync(layerFilePath, "utf8");
197
+ // const layerObj = JSON.parse(dataString);
198
+ // const polygons: turf.Feature<turf.Polygon, turf.Properties>[] =
199
+ // layerObj.features.map((feature: any) =>
200
+ // turf.polygon(
201
+ // feature.geometry.coordinates,
202
+ // { type: feature.properties.Type },
203
+ // { id: feature.properties.ID }
204
+ // )
205
+ // );
206
+ // LaneUtils.shpLanePolygonMap.set(projectName, polygons);
207
+ // return polygons;
208
+ // }
209
+ // return polygons;
210
+ // }
211
+ /**
212
+ * 获取车道内地面转向箭头中心点的位置
213
+ * @param lane
214
+ * @returns
215
+ */
216
+ // public static getArrowPositionsInLane(lane: Lane) {
217
+ // const shpLanePolygon = lane.getShpPolygon();
218
+ // if (shpLanePolygon) {
219
+ // const projectName = "road";
220
+ // const shpArrowPositions =
221
+ // LaneUtils.getShpArrowPositionsInProject(projectName);
222
+ // const positionsInLane = shpArrowPositions
223
+ // .filter((position) => booleanWithin(position, shpLanePolygon))
224
+ // .map((position) => ({
225
+ // id: position.id,
226
+ // type: position.properties?.type,
227
+ // coordinates: position.geometry.coordinates,
228
+ // }));
229
+ // return positionsInLane;
230
+ // }
231
+ // }
232
+ // private static getShpArrowPositionsInProject(projectName: string) {
233
+ // let positions = LaneUtils.shpArrowPositionMap.get(projectName);
234
+ // // 尚未加载转向箭头中心点图层
235
+ // if (!positions) {
236
+ // // 转向箭头中心点图层地址
237
+ // const layerFilePath = path.join(
238
+ // __dirname,
239
+ // // 默认项目名为"road"
240
+ // projectName === "road"
241
+ // ? "../../../public/files/layers/DirectionArrowPoint.json"
242
+ // : `../../../public/files/layers/${projectName}_DirectionArrowPoint.json`
243
+ // );
244
+ // const dataString = readFileSync(layerFilePath, "utf8");
245
+ // const layerObj = JSON.parse(dataString);
246
+ // const positions: turf.Feature<turf.Point, turf.Properties>[] =
247
+ // layerObj.features.map((feature: any) =>
248
+ // turf.point(
249
+ // feature.geometry.coordinates,
250
+ // { type: feature.properties.Type },
251
+ // { id: feature.properties.ID }
252
+ // )
253
+ // );
254
+ // LaneUtils.shpArrowPositionMap.set(projectName, positions);
255
+ // return positions;
256
+ // }
257
+ // return positions;
258
+ // }
259
+ };
260
+ let m = L;
261
+ m.shpLanePolygonMap = /* @__PURE__ */ new Map();
262
+ m.shpArrowPositionMap = /* @__PURE__ */ new Map();
263
+ export {
264
+ m as default
265
+ };
@@ -0,0 +1,70 @@
1
+ import { ISampledLane } from '../../../types';
2
+ import LaneSection from './lane-section';
3
+ import Road from './road';
4
+ export default class Lane {
5
+ /** 车道id:
6
+ * 车道在路段中的序号,-2,-1,0,1,2,...
7
+ */
8
+ id: number;
9
+ /** 车道类型, driving/walk/bike... */
10
+ type: string;
11
+ /** 内侧边线采样点坐标 */
12
+ innerBorder: number[][];
13
+ /** 外侧边线采样点坐标 */
14
+ outerBorder: number[][];
15
+ road: Road;
16
+ laneSection: LaneSection;
17
+ predecessor: number;
18
+ successor: number;
19
+ /** 车道行车方向与正北夹角 */
20
+ private angle;
21
+ /** 车道行车方向是否与参考线方向一致 */
22
+ private _isDirEqual;
23
+ /**
24
+ * 行车方向是否已计算
25
+ * 存在无法计算行车方向, isDirEqual = undefined的情况,额外加一个标志
26
+ * */
27
+ private isDirEqualReady;
28
+ /**
29
+ * 车道面
30
+ */
31
+ ring: number[][];
32
+ constructor(odrLane: any, road: Road, lanesection: LaneSection);
33
+ get isDirEqual(): boolean | undefined;
34
+ /**
35
+ * 车道代码:道路id_路段id_车道id
36
+ */
37
+ get laneCode(): string;
38
+ /**
39
+ * 车道边线采样后的数据
40
+ */
41
+ get sampledLane(): ISampledLane;
42
+ /**
43
+ * 获取路段内同方向最外侧车道
44
+ */
45
+ get outerMostLaneInTheSameDir(): Lane;
46
+ /**
47
+ * 车道航向角
48
+ * @returns
49
+ */
50
+ get drivingAngle(): number;
51
+ /**
52
+ * 获取车道按行车方向的起点、终点,可选择内侧、中间、外侧
53
+ * @param type
54
+ * @returns
55
+ */
56
+ getLaneEndPoints(type?: string): number[][];
57
+ /**
58
+ * 获取车道的前驱车道和后继车道
59
+ * @returns
60
+ */
61
+ getLink(): {
62
+ predecessorLanes: import("../../../types").ILaneInfo[];
63
+ successorLanes: import("../../../types").ILaneInfo[];
64
+ };
65
+ /**
66
+ * 获取车道停止线
67
+ * @returns
68
+ */
69
+ getStopLine(): number[][];
70
+ }
@@ -0,0 +1,93 @@
1
+ import i from "../common-utils.mjs";
2
+ import r from "./lane-utils.mjs";
3
+ class l {
4
+ constructor(e, t, s) {
5
+ this.isDirEqualReady = !1, this.road = t, this.laneSection = s, this.id = e.id, this.type = e.type, this.predecessor = e.predecessor, this.successor = e.successor;
6
+ const o = i.getStdVecEntries(
7
+ e.inner_border,
8
+ !0
9
+ );
10
+ this.innerBorder = i.transformLineProjection(o);
11
+ const a = i.getStdVecEntries(
12
+ e.outer_border,
13
+ !0
14
+ );
15
+ this.outerBorder = i.transformLineProjection(a);
16
+ const n = this.innerBorder.concat([...this.outerBorder].reverse());
17
+ n.push(n[0]), this.ring = n;
18
+ }
19
+ get isDirEqual() {
20
+ return this.isDirEqualReady || (this._isDirEqual = r.isLaneDirEqualDriveDir(this), this.isDirEqualReady = !0), this._isDirEqual;
21
+ }
22
+ /**
23
+ * 车道代码:道路id_路段id_车道id
24
+ */
25
+ get laneCode() {
26
+ return `${this.road.id}_${this.laneSection.s0}_${this.id}`;
27
+ }
28
+ /**
29
+ * 车道边线采样后的数据
30
+ */
31
+ get sampledLane() {
32
+ return {
33
+ id: this.id,
34
+ type: this.type,
35
+ innerPath: this.innerBorder,
36
+ outerPath: this.outerBorder
37
+ };
38
+ }
39
+ /**
40
+ * 获取路段内同方向最外侧车道
41
+ */
42
+ get outerMostLaneInTheSameDir() {
43
+ const e = this.laneSection.allLaneIds, t = this.id > 0 ? e[e.length - 1] : e[0];
44
+ return this.laneSection.getLane(t);
45
+ }
46
+ /**
47
+ * 车道航向角
48
+ * @returns
49
+ */
50
+ get drivingAngle() {
51
+ if (!this.angle) {
52
+ const e = r.getDriveAngle(this);
53
+ this.angle = e;
54
+ }
55
+ return this.angle;
56
+ }
57
+ /**
58
+ * 获取车道按行车方向的起点、终点,可选择内侧、中间、外侧
59
+ * @param type
60
+ * @returns
61
+ */
62
+ getLaneEndPoints(e = "middle") {
63
+ return r.getLaneEndPoints(this, e);
64
+ }
65
+ /**
66
+ * 获取车道的前驱车道和后继车道
67
+ * @returns
68
+ */
69
+ getLink() {
70
+ return r.getPrevAndNext(this);
71
+ }
72
+ // /**
73
+ // * 获取车道对应的高精地图要素
74
+ // * @returns
75
+ // */
76
+ // public getShpPolygon() {
77
+ // return LaneUtils.getShpLanePolygonOfXodrLane(this);
78
+ // }
79
+ // public getArrowPositions() {
80
+ // return LaneUtils.getArrowPositionsInLane(this);
81
+ // }
82
+ /**
83
+ * 获取车道停止线
84
+ * @returns
85
+ */
86
+ getStopLine() {
87
+ const e = this.getLaneEndPoints("inner"), t = this.getLaneEndPoints("outer");
88
+ return [e[1], t[1]];
89
+ }
90
+ }
91
+ export {
92
+ l as default
93
+ };
@@ -0,0 +1,60 @@
1
+ import { IRoadLink, ISampledRoad } from '../../../types';
2
+ import LaneSection from './lane-section';
3
+ export default class Road {
4
+ id: string;
5
+ name: string;
6
+ length: number;
7
+ junction: string;
8
+ successor: IRoadLink;
9
+ predecessor: IRoadLink;
10
+ /** 道路上下左右的边框 */
11
+ borders: {
12
+ left: number[][];
13
+ right: number[][];
14
+ top: number[][];
15
+ bottom: number[][];
16
+ };
17
+ /** 上下左右边框围成的多边形 */
18
+ polygon: number[][];
19
+ refLine: number[][];
20
+ private sToLaneSection;
21
+ constructor(odrRoad: any);
22
+ /**
23
+ * 获取一个路段
24
+ * @param s0
25
+ * @returns
26
+ */
27
+ getLaneSection(s0: number): LaneSection | undefined;
28
+ /**
29
+ * 获取第一个路段
30
+ * @returns
31
+ */
32
+ getFirstLaneSection(): LaneSection;
33
+ /**
34
+ * 获取最后一个路段
35
+ * @returns
36
+ */
37
+ getLastLaneSection(): LaneSection;
38
+ /**
39
+ * 是否是最后一个路段的里程值
40
+ * @param s
41
+ * @returns
42
+ */
43
+ isLastLaneSection(s: number): boolean;
44
+ /**
45
+ * 获取下一个路段
46
+ * @param s
47
+ */
48
+ getNextLaneSection(s: number): LaneSection | undefined;
49
+ /**
50
+ * 获取上一个路段
51
+ * @param s
52
+ * @returns
53
+ */
54
+ getPrevLaneSection(s: number): LaneSection | undefined;
55
+ /** 获取所有路段 */
56
+ get allLaneSections(): LaneSection[];
57
+ get laneSectionNumber(): number;
58
+ get sampledRoad(): ISampledRoad;
59
+ private getBorderLine;
60
+ }