Skip to content

Commit 668a5ac

Browse files
missing comments
1 parent 43323a8 commit 668a5ac

File tree

5 files changed

+35
-2
lines changed

5 files changed

+35
-2
lines changed

packages/amdb/src/api/getAmdbLayer.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ import { isAxiosError, navigraphRequest } from "@navigraph/auth"
33
import { getAmdbApiRoot } from "../constants"
44
import { AmdbLayerName, AmdbResult, Projection } from "../types"
55

6+
/**
7+
* Fetches a single layer from the AMDB for a specific airport
8+
*
9+
* @param options.icao - The ICAO code of the desired airport
10+
* @param options.layer - The lowercase name of the desired layer
11+
* @param options.projection - The desired coordinate system for the resulting geoJSON
12+
* @param options.precision - Coordinates will be snapped to a grid with this spacing between lines
13+
* @returns An geoJSON feature collection containing features of the desired layer
14+
*/
615
export default async function getAmdbLayer<L extends AmdbLayerName>({
716
icao,
817
projection,

packages/amdb/src/api/getAmdbLayers.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ import { isAxiosError, navigraphRequest } from "@navigraph/auth"
33
import { getAmdbApiRoot } from "../constants"
44
import { AmdbLayerName, AmdbResult, Projection } from "../types"
55

6+
/**
7+
* Fetches all layers, specific layers, or all layers minus some set of layers from the AMDB for a specific airport
8+
*
9+
* @param options.icao - The ICAO code of the desired airport
10+
* @param options.include - List of layers to include in the response. If this is not specified, all layers will be returned (minus those specified in `options.exclude`)
11+
* @param options.exclude - List of layers to exclude from the response. This will only apply if `options.include` is not specified
12+
* @param options.projection - The desired coordinate system for the resulting geoJSON
13+
* @param options.precision - Coordinates will be snapped to a grid with this spacing between lines
14+
* @returns An record mapping lowercase layer names to feature collections containing the features from that layer
15+
*/
616
export default async function getAmdbLayers<
717
I extends AmdbLayerName[] | undefined = undefined,
818
E extends AmdbLayerName[] | undefined = undefined,

packages/amdb/src/api/searchAmdb.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
import { Logger } from "@navigraph/app"
22
import { isAxiosError, navigraphRequest } from "@navigraph/auth"
33
import { getAmdbApiRoot } from "../constants"
4-
import { AmdbSearchResult } from "../types"
4+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
5+
import { AerodromeReferencePoint, AmdbSearchResult } from "../types"
56

7+
/**
8+
* Searches for airports with AMDB data based on a query string and returns some metadata about them
9+
*
10+
* @param query - All AMDB airports whose `idarpt`, `iata`, or `name` fields (from {@link AerodromeReferencePoint}) which **start** with this query string will be returned
11+
*
12+
* @returns A selection of properties from the {@link AerodromeReferencePoint} of the found airports, as well as the coordinates of said reference point
13+
*/
614
export default async function searchAmdb(query: string) {
715
const result = await navigraphRequest
816
.get<AmdbSearchResult[]>(`${getAmdbApiRoot()}/search`, {

packages/amdb/src/lib/getAmdbAPI.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import getAmdbLayer from "../api/getAmdbLayer"
33
import getAmdbLayers from "../api/getAmdbLayers"
44
import searchAmdb from "../api/searchAmdb"
55

6-
/** Grabs a reference to an object containing available Navigraph Charts API functionality */
6+
/** Grabs a reference to an object containing available Navigraph AMDB API functionality */
77
export const getAmdbAPI = () => {
88
const app = getApp()
99

packages/amdb/src/types/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,13 @@ export const allLayers: AmdbLayerName[] = Object.keys(FeatureType)
9999
export type AmdbResult<P extends AmdbLayerName> = Pick<AmdbResultStructure, P>
100100

101101
export enum Projection {
102+
/**
103+
* A version of {@link https://mathworld.wolfram.com/AzimuthalEquidistantProjection.html Azimuth Equidistant} where there aerodrome reference point is centered at (0, 0), and coordinates are specified in terms of (x, y) displacement in meters
104+
*/
102105
AzimuthalEquidistant = "NAVIGRAPH:ARP_AZEQ",
106+
/**
107+
* Standard coordinate system where locations are specified in decimal degrees of latitude and longitude
108+
*/
103109
Epsg4326 = "EPSG:4326",
104110
}
105111

0 commit comments

Comments
 (0)