Skip to content

Commit 0d88e44

Browse files
feat: remaining typings
Update index.ts
1 parent 5245f12 commit 0d88e44

File tree

5 files changed

+339
-5
lines changed

5 files changed

+339
-5
lines changed

packages/amdb/README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@ This package is part of the Navigraph SDK, and is intended to be used in conjuct
44
See the [navigraph](https://www.npmjs.com/package/navigraph) package for usage.
55

66
> [!WARNING]
7-
> ### When real number or integer values in AMDB feature properties have no value, it is represented with one of the three following default values:
8-
> | Data Type | Null | Unknown | Not Applicable | Not Entered |
9-
> | --------- | ------ | ------- | -------------- | ----------- |
10-
> | Value | -32768 | -32767 | -32765 | -32764 |
7+
> ### When non-string (except for date/time) values in AMDB feature properties have no value, it is represented with one of the four following default values:
8+
> | Data Type | Null | Unknown | Not Applicable | Not Entered |
9+
> | --------- | ---------- | ---------- | -------------- | ----------- |
10+
> | Integer | -32768 | -32767 | -32765 | -32764 |
11+
> | Float | -32768.00 | -32767.00 | -32765.00 | -32764.00 |
12+
> | Date | 0000-00-00 | 0001-00-00 | 0002-00-00 | 0003-00-00 |
13+
> | Time | 25:00:00 | 26:00:00 | 27:00:00 | 28:00:00 |
14+
>
15+
> Note that the Date default values do not match the ER-009 spec, but matches the Jeppesen spec
1116
>
1217
> No-value strings will be all represented as a JSON `null` field, not `undefined` or `"$Null"`
18+

packages/amdb/src/types/enums.ts

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ export enum FeatureType {
99
RunwayShoulder = 7,
1010
Stopway = 8,
1111
RunwayDisplacedArea = 9,
12+
/** Not provided */
13+
// Clearway = 10,
1214
FinalApproachAndTakeoffArea = 11,
1315
TouchDownLiftOfArea = 12,
1416
HelipadThreshold = 13,
@@ -24,9 +26,27 @@ export enum FeatureType {
2426
ParkingStandLocation = 23,
2527
ParkingStandArea = 24,
2628
DeicingArea = 25,
29+
AerodromeReferencePoint = 26,
30+
VerticalPolygonalStructure = 27,
31+
VerticalPointStructure = 28,
32+
VerticalLineStructure = 29,
33+
ConstructionArea = 30,
34+
/** Not provided */
35+
// SurveyControlPoint = 31,
36+
/** Not provided */
37+
// Asle = 32,
2738
BlastPad = 33,
2839
ServiceRoad = 34,
29-
AerodromeReferencePoint = 26,
40+
Water = 35,
41+
Hotspot = 37, // Our data has 37 as the feattype for hotspot, although the ER-009 spec says it should be 36
42+
/** Not provided */
43+
// RunwayCenterlinePoint = 37,
44+
/** Not provided */
45+
// ArrestingSystemLocation = 38,
46+
/** Not provided yet */
47+
// AsrnEdge = 39
48+
/** Not provided yet */
49+
// AsrnNode = 40
3050
}
3151

3252
export enum SurfaceType {
@@ -185,3 +205,62 @@ export enum BaseFeature {
185205
Blastpad,
186206
RunwayDisplacedArea,
187207
}
208+
209+
export enum PolygonalStructureType {
210+
TerminalBuilding = 1,
211+
Hangar,
212+
ControlTower,
213+
NonTerminalBuilding,
214+
Tank,
215+
Tree,
216+
Bush,
217+
Forest,
218+
EarthenWorks,
219+
Navaid,
220+
Sign,
221+
Unknown = -32767,
222+
}
223+
224+
export enum StructureMaterial {
225+
Concrete = 1,
226+
Metal,
227+
StoneOrBrick,
228+
Composition,
229+
Rock,
230+
EarthenWorks,
231+
Wood,
232+
Unknown = -32767,
233+
}
234+
235+
export enum PointStructureType {
236+
Smokestack = 1,
237+
PowerlinePylon,
238+
Antenna,
239+
Windsock,
240+
Tree,
241+
Lightpole,
242+
LightStanchion,
243+
AirportBeacon,
244+
Navaid,
245+
Sign,
246+
NotApplicable = -32765,
247+
Unknown = -32767,
248+
}
249+
250+
export enum Conformance {
251+
NonConformant,
252+
Conformant,
253+
NotApplicable = -32765,
254+
Unknown = -32767,
255+
}
256+
257+
export enum LineStructureType {
258+
PowerLine = 1,
259+
CableRailway,
260+
BushesOrTrees,
261+
Wall,
262+
Navaid,
263+
Sign,
264+
NotApplicable = -32765,
265+
Unknown = -32767,
266+
}

packages/amdb/src/types/features/index.ts

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,62 @@ export type FrequencyArea = AmdbFeature<
6060
Polygon
6161
>
6262

63+
/**
64+
* Part of the aircraft surface movement area that is, or will be, under construction
65+
*
66+
* ConstructionAreas may overlap with all other elements, and with other ConstructionArea features
67+
*/
68+
export type ConstructionArea = AmdbFeature<
69+
{
70+
/**
71+
* Planned construction start date
72+
*
73+
* As of 2408 all pstdate entries are unknown **(0001-00-00)**
74+
*
75+
* Example: `2024-05-3`
76+
*/
77+
pstdate: string
78+
/**
79+
* Planned construction end date
80+
*
81+
* As of 2408 all pendate entries are unknown **(0001-00-00)**
82+
*
83+
* Example: `2024-05-3`
84+
*/
85+
pendate: string
86+
/**
87+
* Planned initial operational date
88+
*
89+
* As of 2408 all piocdate entries are unknown **(0001-00-00)**
90+
*
91+
* Example: `2024-05-3`
92+
*/
93+
piocdate: string
94+
},
95+
FeatureType.ConstructionArea,
96+
Polygon
97+
>
98+
99+
/**
100+
* Represents any enclosed bodies of water which intersect a 200m buffer around aircraft movement areas, and any adjacent major water bodies, only representing the parts of said major bodies which intersect a 5km buffer around the aircraft movement area
101+
*/
102+
export type Water = AmdbFeature<Record<string, never>, FeatureType.Water, Polygon>
103+
104+
/**
105+
* An area in an aerodrome movement area with a history or potential risk of collision or runway incursion, and where heightened attenion by pilots/drivers is necessary
106+
*/
107+
export type Hotspot = AmdbFeature<
108+
{
109+
/**
110+
* Identifier of the hotspot
111+
*
112+
* Example: `HS12`
113+
*/
114+
idhot: string | null
115+
},
116+
FeatureType.Hotspot,
117+
Polygon
118+
>
119+
63120
export * from "./helipads"
64121
export * from "./runway"
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
import { LineString, Point, Polygon } from "geojson"
2+
import {
3+
Conformance,
4+
FeatureType,
5+
LineStructureType,
6+
PointStructureType,
7+
PolygonalStructureType,
8+
StructureMaterial,
9+
} from "../enums"
10+
import { AmdbFeature } from "./types"
11+
12+
/**
13+
* Polygonal structure of a defined vertical extent that is located within 90m of a runway centerline or 50m from other parts of aerodrome movement areas
14+
*/
15+
export type VerticalPolygonalStructure = AmdbFeature<
16+
{
17+
/**
18+
* Type of the structure
19+
*
20+
* Example: `NonTerminalBuilding: 4`
21+
*/
22+
plysttyp: PolygonalStructureType
23+
24+
/**
25+
* Maximum height of the structure measured in **meters**
26+
*
27+
* Example: `34.32`
28+
*/
29+
height: number
30+
31+
/**
32+
* Maximum elevation of the top of the structure measured in **meters**
33+
*
34+
* Example: `103.02`
35+
*/
36+
elev: number
37+
38+
/**
39+
* Predominant surface material of the structure
40+
*
41+
* Example: `Metal: 2`
42+
*/
43+
material: StructureMaterial
44+
45+
/**
46+
* Name/identifier of the structure
47+
*
48+
* Example: `Terminal 5B`
49+
*/
50+
ident: string | null
51+
},
52+
FeatureType.VerticalPolygonalStructure,
53+
Polygon
54+
>
55+
56+
/**
57+
* Point structure of a defined vertical extent that is located within 90m of a runway centerline or 50m from other parts of aerodrome movement areas
58+
*
59+
* The geographical point should be the center of the corresponding real-world object
60+
*/
61+
export type VerticalPointStructure = AmdbFeature<
62+
{
63+
/**
64+
* Type of the structure
65+
*
66+
* Example: `LightPole: 6`
67+
*/
68+
pntsttyp: PointStructureType
69+
70+
/**
71+
* Whether the marking of this structure is on conformance with `ICAO Annex 14, Chapter 6.2`
72+
*
73+
* Example: `Conformant: 1`
74+
*/
75+
marking: Conformance
76+
77+
/**
78+
* Whether the lighting of this structure is on conformance with `ICAO Annex 14, Chapter 6.2`
79+
*
80+
* Example: `Conformant: 1`
81+
*/
82+
lighting: Conformance
83+
84+
/**
85+
* Radius of circle around center of obstacle including body of obstacle and associated structures including guidwires
86+
*
87+
* As of 2408 there is only one point structure with a defined radius value, and it's at Boeing Field... what are the odds
88+
*
89+
* Example: `3.00`
90+
*/
91+
radius: number
92+
93+
/**
94+
* Maximum height of the structure measured in **meters**
95+
*
96+
* Example: `34.32`
97+
*/
98+
height: number
99+
100+
/**
101+
* Maximum elevation of the top of the structure measured in **meters**
102+
*
103+
* Example: `103.02`
104+
*/
105+
elev: number
106+
107+
/**
108+
* Predominant surface material of the structure
109+
*
110+
* Example: `Metal: 2`
111+
*/
112+
material: StructureMaterial
113+
},
114+
FeatureType.VerticalPointStructure,
115+
Point
116+
>
117+
118+
/**
119+
* Line structure of a defined vertical extent that is located within 90m of a runway centerline or 50m from other parts of aerodrome movement areas
120+
*
121+
* The geographical line should be along the center of the corresponding real-world object
122+
*/
123+
export type VerticalLineStructure = AmdbFeature<
124+
{
125+
/**
126+
* Type of the structure
127+
*
128+
* Example: `CableRailway: 2`
129+
*/
130+
linsttyp: LineStructureType
131+
132+
/**
133+
* Whether the marking of this structure is on conformance with `ICAO Annex 14, Chapter 6.2`
134+
*
135+
* Example: `Conformant: 1`
136+
*/
137+
marking: Conformance
138+
139+
/**
140+
* Whether the lighting of this structure is on conformance with `ICAO Annex 14, Chapter 6.2`
141+
*
142+
* Example: `Conformant: 1`
143+
*/
144+
lighting: Conformance
145+
146+
/**
147+
* Radius of circle around center of obstacle including body of obstacle and associated structures including guidwires
148+
*
149+
* As of 2408 there is only one point structure with a defined radius value, and it's at Boeing Field... what are the odds
150+
*
151+
* Example: `3.00`
152+
*/
153+
radius: number
154+
155+
/**
156+
* Maximum height of the structure measured in **meters**
157+
*
158+
* Example: `34.32`
159+
*/
160+
height: number
161+
162+
/**
163+
* Maximum elevation of the top of the structure measured in **meters**
164+
*
165+
* Example: `103.02`
166+
*/
167+
elev: number
168+
169+
/**
170+
* Predominant surface material of the structure
171+
*
172+
* Example: `Metal: 2`
173+
*/
174+
material: StructureMaterial
175+
},
176+
FeatureType.VerticalLineStructure,
177+
LineString
178+
>

0 commit comments

Comments
 (0)