Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use shape id, not source identifier for storing TPI stats #3831

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions api/app/auto_spatial_advisory/elevation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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)
Expand Down
Loading