From a8807f7de7a918b94bd1dfca667654aa05d0f346 Mon Sep 17 00:00:00 2001 From: Conor Brady Date: Mon, 12 Aug 2024 09:40:16 -0700 Subject: [PATCH] Use shape id, not source identifier for storing TPI stats (#3831) Store/lookup by shape id, not the source identifier. --- api/app/auto_spatial_advisory/elevation.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/api/app/auto_spatial_advisory/elevation.py b/api/app/auto_spatial_advisory/elevation.py index 572c624a0..b75f5d344 100644 --- a/api/app/auto_spatial_advisory/elevation.py +++ b/api/app/auto_spatial_advisory/elevation.py @@ -243,7 +243,6 @@ async def process_tpi_by_firezone(run_type: RunType, run_date: date, for_date: d gdal.SetConfigOption("AWS_VIRTUAL_HOSTING", "FALSE") bucket = config.get("OBJECT_STORE_BUCKET") dem_file = config.get("CLASSIFIED_TPI_DEM_NAME") - key = f"/vsis3/{bucket}/dem/tpi/{dem_file}" tpi_source: gdal.Dataset = gdal.Open(key, gdal.GA_ReadOnly) pixel_size_metres = int(tpi_source.GetGeoTransform()[1]) @@ -278,7 +277,7 @@ async def process_tpi_by_firezone(run_type: RunType, run_date: date, for_date: d # Drop TPI class 4, this is the no data value from the TPI raster tpi_class_freq_dist.pop(4, None) - fire_zone_stats[row[1]] = tpi_class_freq_dist + fire_zone_stats[row[0]] = tpi_class_freq_dist hfi_masked_tpi = None return FireZoneTPIStats(fire_zone_stats=fire_zone_stats, pixel_size_metres=pixel_size_metres)