Skip to content

Commit

Permalink
Update Metadata and mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Jul 16, 2024
1 parent e05a633 commit cbe6740
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
9 changes: 4 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
},
"dependencies": {
"@sinclair/typebox": "^0.32.20",
"@tak-ps/etl": "^4.3.4"
"@tak-ps/etl": "^5.0.0"
}
}
35 changes: 18 additions & 17 deletions task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,22 @@ const Env = Type.Object({
}),
'Query Dist': Type.String({
description: 'Distance from the provided LatLon to provide results',
default: 2650
default: "2650"
}),
'Dist': Type.String({ description: 'Lat, Lon value to use for centering the API request' }),
'ADSBX_TOKEN': Type.String({ description: 'API Token for ADSBExchange' }),
'ADSBX_INCLUDES': Type.Array(Type.Object({
domain: Type.String({
description: 'Public Safety domain of the Aircraft',
enum: ['EMS', 'FIRE', 'LAW']
}),
agency: Type.String({ description: 'Agency in control of the Aircraft' }),
callsign: Type.String({ description: 'Callsign of the Aircraft' }),
registration: Type.String({ description: 'Registration Number of the Aircraft' }),
agency: Type.Optional(Type.String({ description: 'Agency in control of the Aircraft' })),
callsign: Type.Optional(Type.String({ description: 'Callsign of the Aircraft' })),
registration: Type.Optional(Type.String({ description: 'Registration Number of the Aircraft' })),
type: Type.String({
description: 'Type of Aircraft',
default: 'UNKNOWN',
enum: [
'UNKNOWN',
'HELICOPTER',
'FIXED WING'
]
Expand All @@ -42,21 +43,21 @@ const ADSBResponse = Type.Object({
flight: Type.Optional(Type.String()),
r: Type.Optional(Type.String()),
t: Type.Optional(Type.String()),
alt_baro: Type.Number(),
alt_geom: Type.Number(),
gs: Type.Number(),
track: Type.Number(),
baro_rate: Type.Number(),
squawk: Type.String(),
category: Type.String(),
nav_qnh: Type.Number(),
nav_altitude_mcp: Type.Number(),
nav_heading: Type.Number(),
alt_baro: Type.Optional(Type.Union([Type.Number(), Type.String()])),
alt_geom: Type.Optional(Type.Number()),
gs: Type.Optional(Type.Number()),
track: Type.Optional(Type.Number()),
baro_rate: Type.Optional(Type.Number()),
squawk: Type.Optional(Type.String()),
category: Type.Optional(Type.String()),
nav_qnh: Type.Optional(Type.Number()),
nav_altitude_mcp: Type.Optional(Type.Number()),
nav_heading: Type.Optional(Type.Number()),
lat: Type.Number(),
lon: Type.Number(),
seen_pos: Type.Number(),
seen: Type.Number(),
dst: Type.Number()
dst: Type.Optional(Type.Number())
})

export default class Task extends ETL {
Expand Down Expand Up @@ -97,7 +98,7 @@ export default class Task extends ETL {
const coordinates = [ac.lon, ac.lat];

// If alt. is present convert to meters
coordinates.push(ac.alt_geom * 0.3048);
if (ac.alt_geom) coordinates.push(ac.alt_geom * 0.3048);

if (!id.trim().length) continue;

Expand Down

0 comments on commit cbe6740

Please sign in to comment.