Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/tame-emus-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@navigraph/amdb": patch
"navigraph": patch
---

Fixed field names
8 changes: 4 additions & 4 deletions packages/amdb/src/types/features/aprons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export type ApronElement = AmdbFeature<
*
* Example: `Asphalt: 2`
*/
gsurftype: GroundSurfaceType
gsurftyp: GroundSurfaceType

/**
* The name of the apron
Expand Down Expand Up @@ -226,7 +226,7 @@ export type ParkingStandArea = AmdbFeature<
*
* Example: `Asphalt: 2`
*/
gsurftype: GroundSurfaceType
gsurftyp: GroundSurfaceType

/**
* Availability of a jetway for the stands in this area
Expand Down Expand Up @@ -306,7 +306,7 @@ export type DeicingArea = AmdbFeature<
*
* Example: `Asphalt: 2`
*/
gsurftype: GroundSurfaceType
gsurftyp: GroundSurfaceType

/**
* Identifier of the underlying:
Expand Down Expand Up @@ -342,7 +342,7 @@ export type ServiceRoad = AmdbFeature<
*
* Example: `Asphalt: 2`
*/
gsurftype: GroundSurfaceType
gsurftyp: GroundSurfaceType

/**
* Type of feature which is overlapped by this road
Expand Down
11 changes: 1 addition & 10 deletions packages/amdb/src/types/features/runway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ export type RunwayShoulder = AmdbFeature<
*
* Example: `Asphalt: 2`
*/
gsurftype: GroundSurfaceType
gsurftyp: GroundSurfaceType
},
FeatureType.RunwayShoulder,
Polygon
Expand Down Expand Up @@ -486,15 +486,6 @@ export type BlastPad = AmdbFeature<
* Example: `9`
*/
idthr: string | null

/**
* Permanent state of feature (exceeding the AIRAC-cycle of 56 days)
*
* Non-permanent closures or outages of less than 56 days are not adressed in the airport maping database but will be addressed via NOTAMS
*
* Example: `Open: 1`
*/
status: Status
},
FeatureType.BlastPad,
Polygon
Expand Down
4 changes: 2 additions & 2 deletions packages/amdb/src/types/features/taxiways.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export type TaxiwayElement = AmdbFeature<
*
* Example: `Asphalt: 2`
*/
gsurftype: GroundSurfaceType
gsurftyp: GroundSurfaceType

/**
* Indicates whether the taxiway is a bridge, and if so, what kind of bridge it is
Expand Down Expand Up @@ -104,7 +104,7 @@ export type TaxiwayShoulder = AmdbFeature<
*
* Example: `Asphalt: 2`
*/
gsurftype: GroundSurfaceType
gsurftyp: GroundSurfaceType
},
FeatureType.TaxiwayShoulder,
Polygon
Expand Down
32 changes: 19 additions & 13 deletions packages/amdb/src/types/features/types.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
import { Feature, LineString, Point, Polygon } from "geojson"
import { FeatureType } from "../enums"

type Properties<F extends FeatureType, P> = {
/** Unique identifier for this feature instance. Only unique per feature type */
id: number
export type AmdbFeature<P, F extends FeatureType, G extends Point | LineString | Polygon> = Feature<
G,
{
/** Unique identifier for this feature instance. Only unique per feature type */
id: number

feattype: F
feattype: F

/**
* ICAO aerodrome location indicator
*
* Example: `NZCH`
*/
idarpt: string
} & P

export type AmdbFeature<P, F extends FeatureType, G extends Point | LineString | Polygon> = Feature<G, Properties<F, P>>
/**
* ICAO aerodrome location indicator
*
* Example: `NZCH`
*/
idarpt: string
} & P &
(G extends Polygon
? { centroid: Point }
: G extends LineString
? { midpoint: F extends FeatureType.AsrnEdge ? undefined : Point } // This AsrnEdge check isn't very nice, but its neccessary since it is the only table without a populated midpoint value
: Record<string, never>)
>