Skip to content

Commit

Permalink
fix: gates names
Browse files Browse the repository at this point in the history
  • Loading branch information
daniluk4000 committed Dec 23, 2024
1 parent bbc2587 commit 26ca249
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

# [1.0.0-alpha.1.1]

- Fixed some gates missing

# [1.0.0-alpha.1]

- Added Airport Layouts for Navigraph Ultimate members - those include taxiways, updated gates, and much more
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vatsim-radar",
"version": "1.0.0-alpha.1",
"version": "1.0.0-alpha.1.1",
"private": true,
"type": "module",
"scripts": {
Expand Down
46 changes: 35 additions & 11 deletions src/server/api/data/navigraph/airport/[...icao]/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,41 @@ export default defineEventHandler(async (event): Promise<NavigraphAirportData |
else {
const _layout = layout as NavigraphLayout;

gates = _layout.parkingstandlocation?.features.map(feature => {
const coords = fromServerLonLat((feature.geometry as Point).coordinates);

return {
gate_identifier: `${ feature.properties!.idstd }:${ feature.properties!.termref }`,
gate_longitude: coords[0],
gate_latitude: coords[1],
name: feature.properties!.idstd || feature.properties!.termref,
airport_identifier: feature.properties!.idarpt,
};
}) ?? [];
gates = [
..._layout.parkingstandlocation?.features.map(feature => {
const coords = fromServerLonLat((feature.geometry as Point).coordinates);

return {
gate_identifier: `${ feature.properties!.idstd }:${ feature.properties!.termref }`,
gate_longitude: coords[0],
gate_latitude: coords[1],
name: feature.properties!.idstd || feature.properties!.termref,
airport_identifier: feature.properties!.idarpt,
};
}) ?? [],
..._layout.parkingstandarea?.features.filter(x => x.properties?.centroid && x.properties.idstd && !x.properties.idstd.includes('_')).map(feature => {
const coords = fromServerLonLat((feature.properties!.centroid as Point).coordinates);

return {
gate_identifier: `${ feature.properties!.idstd }:${ feature.properties!.termref }`,
gate_longitude: coords[0],
gate_latitude: coords[1],
name: feature.properties!.idstd || feature.properties!.termref,
airport_identifier: feature.properties!.idarpt,
};
}) ?? [],
..._layout.standguidanceline?.features.filter(x => x.properties?.midpoint && x.properties.idstd && !x.properties.idstd.includes('_')).map(feature => {
const coords = fromServerLonLat((feature.properties!.midpoint as Point).coordinates);

return {
gate_identifier: `${ feature.properties!.idstd }:${ feature.properties!.termref }`,
gate_longitude: coords[0],
gate_latitude: coords[1],
name: feature.properties!.idstd || feature.properties!.termref,
airport_identifier: feature.properties!.idarpt,
};
}) ?? [],
];

gates = gates.filter((x, index) => x.name && !(gates as NavigraphGate[]).some((y, yIndex) => y.gate_identifier === x.gate_identifier && index > yIndex));

Expand Down

0 comments on commit 26ca249

Please sign in to comment.