From f04385dd71dab7a705865066d45fea144bac68a4 Mon Sep 17 00:00:00 2001 From: Damien Allen Date: Sun, 9 Jun 2024 16:13:04 +0000 Subject: [PATCH] Added missing data endpoint --- urban_heat/main.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/urban_heat/main.py b/urban_heat/main.py index f365088..658f5db 100644 --- a/urban_heat/main.py +++ b/urban_heat/main.py @@ -63,6 +63,14 @@ async def get_source_counts(): return OrderedDict(sorted(countries.items())) +@app.get("/urau/missing", response_model=list[str]) +async def get_missing(): + await init_db() + + features = await UrbanExtent.find_all().to_list() + return sorted([f.properties.URAU_CODE for f in features if not f.prepared_sources]) + + @app.get("/urau/{code}", response_model=UrbanExtent) async def get_urau(code: str): await init_db()