More airport pruning
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -53,6 +53,8 @@ impl Airports {
|
|||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
.load::<Airports>(&mut conn)?;
|
.load::<Airports>(&mut conn)?;
|
||||||
|
// let string = serde_json::to_string(&airports).unwrap();
|
||||||
|
// std::fs::write("test.json", string);
|
||||||
Ok(airports)
|
Ok(airports)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ function MapTiles() {
|
|||||||
ne_lon: ne.lng,
|
ne_lon: ne.lng,
|
||||||
sw_lat: sw.lat,
|
sw_lat: sw.lat,
|
||||||
sw_lon: sw.lng,
|
sw_lon: sw.lng,
|
||||||
limit: 500,
|
limit: 100,
|
||||||
page: 1
|
page: 1
|
||||||
});
|
});
|
||||||
const metars = await getMetars(_airports);
|
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);
|
setAirports(_airports);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user