More airport pruning

This commit is contained in:
2023-09-11 21:50:10 -04:00
parent c6ced0299f
commit e4d68dc772
3 changed files with 3005 additions and 292215 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -53,6 +53,8 @@ impl Airports {
}
}))
.load::<Airports>(&mut conn)?;
// let string = serde_json::to_string(&airports).unwrap();
// std::fs::write("test.json", string);
Ok(airports)
}

View File

@@ -55,7 +55,7 @@ function MapTiles() {
ne_lon: ne.lng,
sw_lat: sw.lat,
sw_lon: sw.lng,
limit: 500,
limit: 100,
page: 1
});
const metars = await getMetars(_airports);
@@ -66,6 +66,13 @@ function MapTiles() {
}
});
});
const temp: string[] = [];
_airports.forEach((airport) => {
if (!airport.metar) {
temp.push(airport.icao);
}
});
console.log(`delete from airports where icao = ANY('{${temp}}'::text[]);`);
setAirports(_airports);
}