Updated metar querying logic and parsing

This commit is contained in:
2023-12-19 12:35:47 -05:00
parent 97be61e297
commit 6ecd9598e7
9 changed files with 198 additions and 65 deletions

View File

@@ -4,7 +4,12 @@ import { Metar } from './metar.types';
export enum AirportCategory {
SMALL = 'small_airport',
MEDIUM = 'medium_airport',
LARGE = 'large_airport'
LARGE = 'large_airport',
HELIPORT = 'heliport',
BALLOONPORT = 'balloonport',
CLOSED = 'closed',
SEAPLANE = 'seaplane_base',
UNKNOWN = 'unknown',
}
export function airportCategoryToText(category: AirportCategory): string {
@@ -15,6 +20,16 @@ export function airportCategoryToText(category: AirportCategory): string {
return 'Medium';
case AirportCategory.LARGE:
return 'Large';
case AirportCategory.HELIPORT:
return 'Helipad';
case AirportCategory.CLOSED:
return 'Closed';
case AirportCategory.SEAPLANE:
return 'Seaplane Base';
case AirportCategory.BALLOONPORT:
return 'Balloonport';
default:
return 'Unknown';
}
}

View File

@@ -53,7 +53,7 @@ export default function MapTiles() {
northEast: { lat: ne.lat, lon: ne.lng },
southWest: { lat: sw.lat, lon: sw.lng }
},
categories: ['small_airport', 'medium_airport', 'large_airport'],
categories: ['large_airport'],
order_field: AirportOrderField.CATEGORY,
order_by: 'asc',
limit: 250,