@squawk/procedure-data
Advanced tools
+19
-15
| import type { Procedure } from '@squawk/types'; | ||
| /** | ||
| * Metadata properties attached to the procedure dataset describing | ||
| * the FAA NASR data vintage and build provenance. | ||
| * Metadata properties attached to the procedure dataset describing the | ||
| * FAA CIFP data vintage and build provenance. | ||
| */ | ||
@@ -9,16 +9,18 @@ export interface ProcedureDatasetProperties { | ||
| generatedAt: string; | ||
| /** NASR cycle effective date (e.g. "2026-01-22"). */ | ||
| nasrCycleDate: string; | ||
| /** CIFP cycle effective date in `YYYY-MM-DD` (e.g. "2026-03-25"). */ | ||
| cifpCycleDate: string; | ||
| /** Total number of procedure records in the dataset. */ | ||
| recordCount: number; | ||
| /** Number of SID procedures. */ | ||
| /** Number of Standard Instrument Departure (SID) procedures. */ | ||
| sidCount: number; | ||
| /** Number of STAR procedures. */ | ||
| /** Number of Standard Terminal Arrival Route (STAR) procedures. */ | ||
| starCount: number; | ||
| /** Total number of waypoint records across all procedures. */ | ||
| waypointCount: number; | ||
| /** Number of Instrument Approach Procedure (IAP) procedures. */ | ||
| iapCount: number; | ||
| /** Total leg count across all common routes, transitions, and missed approaches. */ | ||
| legCount: number; | ||
| } | ||
| /** | ||
| * A pre-processed array of Procedure records with attached metadata | ||
| * about the build provenance and NASR cycle. | ||
| * A pre-processed array of {@link Procedure} records together with | ||
| * metadata about the build provenance and CIFP cycle. | ||
| */ | ||
@@ -32,8 +34,10 @@ export interface ProcedureDataset { | ||
| /** | ||
| * Pre-processed snapshot of US instrument procedure data derived from the | ||
| * FAA NASR 28-day subscription cycle. | ||
| * Pre-processed snapshot of US instrument procedure data derived from | ||
| * the FAA CIFP (Coded Instrument Flight Procedures) 28-day cycle. | ||
| * | ||
| * Contains Standard Instrument Departures (SIDs) and Standard Terminal | ||
| * Arrival Routes (STARs) with full waypoint sequences, named transitions, | ||
| * and adapted airport associations. | ||
| * Contains Standard Instrument Departures (SIDs), Standard Terminal | ||
| * Arrival Routes (STARs), and Instrument Approach Procedures (IAPs) in | ||
| * the unified ARINC 424 leg model, including path terminators, | ||
| * altitude and speed constraints, recommended navaids, RNP values, and | ||
| * FAF / MAP / IAF / FACF flags. | ||
| * | ||
@@ -40,0 +44,0 @@ * Pass the `records` array directly to `createProcedureResolver()` from |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EAOV,MAAM,eAAe,CAAC;AAqFvB;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,4DAA4D;IAC5D,WAAW,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,aAAa,EAAE,MAAM,CAAC;IACtB,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAC;IACpB,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,8DAA8D;IAC9D,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,wCAAwC;IACxC,UAAU,EAAE,0BAA0B,CAAC;IACvC,yBAAyB;IACzB,OAAO,EAAE,SAAS,EAAE,CAAC;CACtB;AA4DD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,mBAAmB,EAAE,gBAUjC,CAAC"} | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAIV,SAAS,EASV,MAAM,eAAe,CAAC;AAmKvB;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,4DAA4D;IAC5D,WAAW,EAAE,MAAM,CAAC;IACpB,qEAAqE;IACrE,aAAa,EAAE,MAAM,CAAC;IACtB,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAC;IACpB,gEAAgE;IAChE,QAAQ,EAAE,MAAM,CAAC;IACjB,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,QAAQ,EAAE,MAAM,CAAC;IACjB,oFAAoF;IACpF,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,wCAAwC;IACxC,UAAU,EAAE,0BAA0B,CAAC;IACvC,yBAAyB;IACzB,OAAO,EAAE,SAAS,EAAE,CAAC;CACtB;AA0KD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,mBAAmB,EAAE,gBAWjC,CAAC"} |
+138
-26
@@ -6,42 +6,141 @@ import { readFileSync } from 'node:fs'; | ||
| /** | ||
| * Expands a compact waypoint into the full ProcedureWaypoint interface. | ||
| * Expands a compact altitude constraint into the full interface. | ||
| */ | ||
| function expandWaypoint(c) { | ||
| const wp = { | ||
| fixIdentifier: c.fi, | ||
| category: c.cat, | ||
| typeCode: c.tc, | ||
| lat: c.lat, | ||
| lon: c.lon, | ||
| function expandAltitudeConstraint(c) { | ||
| const ac = { | ||
| descriptor: c.d, | ||
| primaryFt: c.p, | ||
| }; | ||
| if (c.icao !== undefined) { | ||
| wp.icaoRegionCode = c.icao; | ||
| if (c.s !== undefined) { | ||
| ac.secondaryFt = c.s; | ||
| } | ||
| return wp; | ||
| return ac; | ||
| } | ||
| /** | ||
| * Expands a compact transition into the full ProcedureTransition interface. | ||
| * Expands a compact speed constraint into the full interface. | ||
| */ | ||
| function expandSpeedConstraint(c) { | ||
| return { descriptor: c.d, speedKt: c.s }; | ||
| } | ||
| /** | ||
| * Expands a compact leg into the full {@link ProcedureLeg} interface. | ||
| */ | ||
| function expandLeg(c) { | ||
| const leg = { pathTerminator: c.pt }; | ||
| if (c.fi !== undefined) { | ||
| leg.fixIdentifier = c.fi; | ||
| } | ||
| if (c.cat !== undefined) { | ||
| leg.category = c.cat; | ||
| } | ||
| if (c.lat !== undefined) { | ||
| leg.lat = c.lat; | ||
| } | ||
| if (c.lon !== undefined) { | ||
| leg.lon = c.lon; | ||
| } | ||
| if (c.ir !== undefined) { | ||
| leg.icaoRegionCode = c.ir; | ||
| } | ||
| if (c.ac !== undefined) { | ||
| leg.altitudeConstraint = expandAltitudeConstraint(c.ac); | ||
| } | ||
| if (c.sc !== undefined) { | ||
| leg.speedConstraint = expandSpeedConstraint(c.sc); | ||
| } | ||
| if (c.crs !== undefined) { | ||
| leg.courseDeg = c.crs; | ||
| } | ||
| if (c.ct === 1) { | ||
| leg.courseIsTrue = true; | ||
| } | ||
| if (c.dist !== undefined) { | ||
| leg.distanceNm = c.dist; | ||
| } | ||
| if (c.hold !== undefined) { | ||
| leg.holdTimeMin = c.hold; | ||
| } | ||
| if (c.rn !== undefined) { | ||
| leg.recommendedNavaid = c.rn; | ||
| } | ||
| if (c.rnIr !== undefined) { | ||
| leg.recommendedNavaidIcaoRegionCode = c.rnIr; | ||
| } | ||
| if (c.th !== undefined) { | ||
| leg.thetaDeg = c.th; | ||
| } | ||
| if (c.rh !== undefined) { | ||
| leg.rhoNm = c.rh; | ||
| } | ||
| if (c.rnp !== undefined) { | ||
| leg.rnpNm = c.rnp; | ||
| } | ||
| if (c.td !== undefined) { | ||
| leg.turnDirection = c.td; | ||
| } | ||
| if (c.ar !== undefined) { | ||
| leg.arcRadiusNm = c.ar; | ||
| } | ||
| if (c.cf !== undefined) { | ||
| leg.centerFix = c.cf; | ||
| } | ||
| if (c.cfIr !== undefined) { | ||
| leg.centerFixIcaoRegionCode = c.cfIr; | ||
| } | ||
| if (c.iaf === 1) { | ||
| leg.isInitialApproachFix = true; | ||
| } | ||
| if (c.ifx === 1) { | ||
| leg.isIntermediateFix = true; | ||
| } | ||
| if (c.faf === 1) { | ||
| leg.isFinalApproachFix = true; | ||
| } | ||
| if (c.facf === 1) { | ||
| leg.isFinalApproachCourseFix = true; | ||
| } | ||
| if (c.map === 1) { | ||
| leg.isMissedApproachPoint = true; | ||
| } | ||
| if (c.fo === 1) { | ||
| leg.isFlyover = true; | ||
| } | ||
| return leg; | ||
| } | ||
| /** | ||
| * Expands a compact transition into the full interface. | ||
| */ | ||
| function expandTransition(c) { | ||
| return { | ||
| name: c.nm, | ||
| waypoints: c.wps.map(expandWaypoint), | ||
| legs: c.lg.map(expandLeg), | ||
| }; | ||
| } | ||
| /** | ||
| * Expands a compact common route into the full ProcedureCommonRoute interface. | ||
| * Expands a compact common route into the full interface. | ||
| */ | ||
| function expandCommonRoute(c) { | ||
| return { | ||
| waypoints: c.wps.map(expandWaypoint), | ||
| const route = { | ||
| legs: c.lg.map(expandLeg), | ||
| airports: c.apt, | ||
| }; | ||
| if (c.rw !== undefined) { | ||
| route.runway = c.rw; | ||
| } | ||
| return route; | ||
| } | ||
| /** | ||
| * Expands a compact procedure record into the full Procedure interface. | ||
| * Expands a compact missed approach into the full interface. | ||
| */ | ||
| function expandMissedApproach(c) { | ||
| return { legs: c.lg.map(expandLeg) }; | ||
| } | ||
| /** | ||
| * Expands a compact procedure record into the full {@link Procedure} | ||
| * interface, populating IAP-specific fields when present. | ||
| */ | ||
| function expandProcedure(c) { | ||
| return { | ||
| const p = { | ||
| name: c.nm, | ||
| computerCode: c.cc, | ||
| identifier: c.id, | ||
| type: c.tp, | ||
@@ -52,2 +151,12 @@ airports: c.apt, | ||
| }; | ||
| if (c.at !== undefined) { | ||
| p.approachType = c.at; | ||
| } | ||
| if (c.rw !== undefined) { | ||
| p.runway = c.rw; | ||
| } | ||
| if (c.ma !== undefined) { | ||
| p.missedApproach = expandMissedApproach(c.ma); | ||
| } | ||
| return p; | ||
| } | ||
@@ -58,8 +167,10 @@ const dataPath = resolve(dirname(fileURLToPath(import.meta.url)), '../data/procedures.json.gz'); | ||
| /** | ||
| * Pre-processed snapshot of US instrument procedure data derived from the | ||
| * FAA NASR 28-day subscription cycle. | ||
| * Pre-processed snapshot of US instrument procedure data derived from | ||
| * the FAA CIFP (Coded Instrument Flight Procedures) 28-day cycle. | ||
| * | ||
| * Contains Standard Instrument Departures (SIDs) and Standard Terminal | ||
| * Arrival Routes (STARs) with full waypoint sequences, named transitions, | ||
| * and adapted airport associations. | ||
| * Contains Standard Instrument Departures (SIDs), Standard Terminal | ||
| * Arrival Routes (STARs), and Instrument Approach Procedures (IAPs) in | ||
| * the unified ARINC 424 leg model, including path terminators, | ||
| * altitude and speed constraints, recommended navaids, RNP values, and | ||
| * FAF / MAP / IAF / FACF flags. | ||
| * | ||
@@ -79,9 +190,10 @@ * Pass the `records` array directly to `createProcedureResolver()` from | ||
| generatedAt: raw.meta.generatedAt, | ||
| nasrCycleDate: raw.meta.nasrCycleDate, | ||
| cifpCycleDate: raw.meta.cifpCycleDate, | ||
| recordCount: raw.meta.recordCount, | ||
| sidCount: raw.meta.sidCount, | ||
| starCount: raw.meta.starCount, | ||
| waypointCount: raw.meta.waypointCount, | ||
| iapCount: raw.meta.iapCount, | ||
| legCount: raw.meta.legCount, | ||
| }, | ||
| records, | ||
| }; |
+7
-4
| { | ||
| "name": "@squawk/procedure-data", | ||
| "version": "0.3.3", | ||
| "version": "0.5.0", | ||
| "type": "module", | ||
| "description": "Pre-processed FAA NASR procedure snapshot for use with @squawk/procedures", | ||
| "description": "Pre-processed FAA CIFP procedure snapshot (SIDs, STARs, IAPs) for use with @squawk/procedures", | ||
| "author": "Neil Cochran", | ||
@@ -38,3 +38,3 @@ "license": "MIT", | ||
| "dependencies": { | ||
| "@squawk/types": "^0.3.1" | ||
| "@squawk/types": "^0.5.0" | ||
| }, | ||
@@ -46,4 +46,7 @@ "keywords": [ | ||
| "star", | ||
| "iap", | ||
| "approach", | ||
| "faa", | ||
| "nasr" | ||
| "cifp", | ||
| "arinc-424" | ||
| ], | ||
@@ -50,0 +53,0 @@ "publishConfig": { |
+57
-31
@@ -5,5 +5,6 @@ <h1><img src="../../assets/squawk-logo.svg" alt="squawk logo" width="48" height="48" style="vertical-align: middle"> @squawk/procedure-data</h1> | ||
| Pre-processed snapshot of US instrument procedure data from the **2026-04-16** FAA NASR | ||
| cycle. Data only - no query logic, no dependency on | ||
| `@squawk/procedures`. | ||
| Pre-processed snapshot of US instrument procedure data from the **2026-03-25** FAA CIFP | ||
| cycle. Covers Standard Instrument Departures (SIDs), Standard Terminal Arrival Routes | ||
| (STARs), and Instrument Approach Procedures (IAPs) in the unified ARINC 424 leg model. | ||
| Data only - no query logic, no dependency on `@squawk/procedures`. | ||
@@ -16,9 +17,13 @@ **[Documentation](https://neilcochran.github.io/squawk/modules/_squawk_procedure-data.html)** | ||
| - Standard Instrument Departures (SIDs/DPs) | ||
| - Standard Instrument Departures (SIDs) | ||
| - Standard Terminal Arrival Routes (STARs) | ||
| - Full waypoint sequences with fix identifiers and coordinates | ||
| - Named enroute transitions for each procedure | ||
| - Multiple common route variants for different runway configurations | ||
| - Adapted airport associations per procedure and per route | ||
| - Waypoint type classification (fix, navaid, airport) | ||
| - Instrument Approach Procedures (IAPs): ILS, LOC, LOC-BC, RNAV, RNAV (RNP), VOR, VOR/DME, NDB, NDB/DME, TACAN, GLS, IGS, LDA, SDF, GPS, FMS, MLS | ||
| - Full ARINC 424 leg model per procedure: path terminators (IF, TF, CF, DF, CA, CI, CR, FA, FC, FD, FM, HA, HF, HM, PI, RF, AF, VA, VD, VI, VM, VR) | ||
| - Altitude constraints (at / at-or-above / at-or-below / between / glide-slope / step-down descriptors) with primary and secondary altitudes | ||
| - Speed constraints with descriptor | ||
| - Recommended navaid, RNP value, turn direction, arc radius, center fix (for RF legs) | ||
| - Approach-role flags: IAF, IF (intermediate), FAF, FACF, MAP, fly-over | ||
| - Named transitions (approach transitions for IAPs, enroute / runway transitions for SIDs and STARs) | ||
| - Missed-approach sequences for IAPs | ||
| - Resolved lat/lon for every fix, navaid, airport, and runway reference | ||
@@ -37,6 +42,7 @@ ## Installation | ||
| // Inspect metadata | ||
| console.log(usBundledProcedures.properties.nasrCycleDate); // "2026-01-22" | ||
| console.log(usBundledProcedures.properties.cifpCycleDate); // "2026-03-25" | ||
| console.log(usBundledProcedures.properties.recordCount); | ||
| console.log(usBundledProcedures.properties.sidCount); | ||
| console.log(usBundledProcedures.properties.starCount); | ||
| console.log(usBundledProcedures.properties.iapCount); | ||
@@ -50,3 +56,3 @@ // Use with @squawk/procedures for zero-config procedure queries | ||
| Consumers who have their own data pipeline can use `@squawk/procedures` alone and | ||
| pass any compatible Procedure array at initialization. | ||
| pass any compatible `Procedure` array at initialization. | ||
@@ -57,26 +63,46 @@ ## Data format | ||
| | Property | Type | Description | | ||
| | -------------- | ---------------------- | --------------------------------------------------------- | | ||
| | `name` | string | Human-readable name (e.g. "AALLE FOUR") | | ||
| | `computerCode` | string | FAA computer code (e.g. "AALLE4") | | ||
| | `type` | ProcedureType | SID or STAR | | ||
| | `airports` | string[] | All adapted airports served by this procedure | | ||
| | `commonRoutes` | ProcedureCommonRoute[] | Trunk paths with waypoints and per-route adapted airports | | ||
| | `transitions` | ProcedureTransition[] | Named entry/exit transitions | | ||
| | Property | Type | Description | | ||
| | ---------------- | ------------------------- | -------------------------------------------------------------------- | | ||
| | `name` | string | Human-readable name (e.g. `AALLE4`, `ILS RWY 04L`) | | ||
| | `identifier` | string | CIFP procedure identifier (e.g. `AALLE4`, `I04L`) | | ||
| | `type` | ProcedureType | `SID`, `STAR`, or `IAP` | | ||
| | `airports` | string[] | Airports served by this procedure | | ||
| | `commonRoutes` | ProcedureCommonRoute[] | Trunk paths with legs and per-route adapted airports | | ||
| | `transitions` | ProcedureTransition[] | Named transitions (approach / enroute / runway depending on type) | | ||
| | `approachType` | ApproachType \| undefined | Approach classification (IAPs only) | | ||
| | `runway` | string \| undefined | Runway served by the approach (IAPs with a runway-specific approach) | | ||
| | `missedApproach` | MissedApproachSequence | Missed-approach climb-out (IAPs only) | | ||
| Each `ProcedureWaypoint` contains: | ||
| Each `ProcedureLeg` carries: | ||
| | Property | Type | Description | | ||
| | ---------------- | ------------------------- | ---------------------------------------------- | | ||
| | `fixIdentifier` | string | Fix or navaid identifier (e.g. "AALLE", "DEN") | | ||
| | `category` | ProcedureWaypointCategory | FIX, NAVAID, or AIRPORT | | ||
| | `typeCode` | ProcedureWaypointTypeCode | Raw FAA type code (P, R, NW, ND, AA, etc.) | | ||
| | `lat`, `lon` | number | Decimal degrees | | ||
| | `icaoRegionCode` | string or undefined | ICAO region code (e.g. "K2", "K5") | | ||
| | Property | Type | Description | | ||
| | ----------------------------------------------------------------------------------------------------------------------------------- | -------------------------- | ------------------------------------------------------ | | ||
| | `pathTerminator` | ProcedureLegPathTerminator | ARINC 424 path terminator (e.g. `TF`, `CF`, `CA`) | | ||
| | `fixIdentifier`, `category`, `lat`, `lon`, `icaoRegionCode` | (see types) | Termination fix (absent on pure heading/altitude legs) | | ||
| | `altitudeConstraint` | AltitudeConstraint | Descriptor + primary/secondary altitudes in feet | | ||
| | `speedConstraint` | SpeedConstraint | Descriptor + speed in knots | | ||
| | `courseDeg`, `courseIsTrue` | number / boolean | Outbound or intercept course | | ||
| | `distanceNm`, `holdTimeMin` | number | Distance or hold time (leg-type dependent) | | ||
| | `recommendedNavaid`, `thetaDeg`, `rhoNm`, `rnpNm` | (see types) | Recommended navaid + bearing/distance/RNP reference | | ||
| | `turnDirection` | `'L' \| 'R'` | Commanded turn direction | | ||
| | `arcRadiusNm`, `centerFix` | (see types) | Populated on RF constant-radius-arc legs | | ||
| | `isInitialApproachFix`, `isIntermediateFix`, `isFinalApproachFix`, `isFinalApproachCourseFix`, `isMissedApproachPoint`, `isFlyover` | boolean | Approach role flags | | ||
| ## Data source | ||
| All data is derived from the [FAA National Airspace System Resource (NASR)](https://www.faa.gov/air_traffic/flight_info/aeronav/aero_data/NASR_Subscription/) 28-day | ||
| subscription, which is public domain. Procedure data comes from STARDP.txt, a | ||
| fixed-width file encoding SID and STAR waypoint sequences. The build pipeline | ||
| that produces this dataset lives in [tools/build-procedure-data](https://github.com/neilcochran/squawk/tree/main/tools/build-procedure-data). | ||
| Data is derived from the [FAA CIFP (Coded Instrument Flight Procedures)](https://www.faa.gov/air_traffic/flight_info/aeronav/digital_products/cifp/) | ||
| 28-day cycle, which is public domain and published in ARINC 424 v18 format. The | ||
| build pipeline that produces this dataset lives in | ||
| [tools/build-procedure-data](https://github.com/neilcochran/squawk/tree/main/tools/build-procedure-data). | ||
| ### A note on Obstacle Departure Procedures (ODPs) | ||
| Graphic ODPs are encoded by CIFP as SIDs (PD records) with no distinguishing | ||
| field, so they are included in this dataset labelled as `SID` alongside regular | ||
| Standard Instrument Departures. There is no reliable way to distinguish ODPs | ||
| from regular SIDs using CIFP data alone - the ODP indicator lives in the d-TPP | ||
| (Digital Terminal Procedures Publication) chart titles. | ||
| Textual ODPs (plain-English climb instructions published in the d-TPP | ||
| supplement) are not carried by CIFP at all and are therefore not included in | ||
| this dataset. |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
2548631
558.62%247
88.55%104
33.33%1
Infinity%+ Added
- Removed
Updated