From 841a26d5663996cf049464d9c8a14e56cd63d910 Mon Sep 17 00:00:00 2001 From: Matt Bowen <83967628+mattbowen-usds@users.noreply.github.com> Date: Thu, 13 Oct 2022 16:20:28 -0400 Subject: [PATCH] Remove suffixes from tribal lands (#1974) (#2008) --- .../data_pipeline/etl/sources/tribal_overlap/etl.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/data/data-pipeline/data_pipeline/etl/sources/tribal_overlap/etl.py b/data/data-pipeline/data_pipeline/etl/sources/tribal_overlap/etl.py index c2c86597..35945228 100644 --- a/data/data-pipeline/data_pipeline/etl/sources/tribal_overlap/etl.py +++ b/data/data-pipeline/data_pipeline/etl/sources/tribal_overlap/etl.py @@ -45,7 +45,7 @@ class TribalOverlapETL(ExtractTransformLoad): ] # A Tribal area that requires some special processing. - ANNETTE_ISLAND_TRIBAL_NAME = "Annette Island LAR" + ANNETTE_ISLAND_TRIBAL_NAME = "Annette Island" CRS_INTEGER = 3857 TRIBAL_OVERLAP_CUTOFF = 0.995 # Percentage of overlap that rounds to 100% @@ -102,6 +102,15 @@ class TribalOverlapETL(ExtractTransformLoad): df=self.tribal_gdf, tract_data=self.census_tract_gdf ) + # Cleanup the suffixes in the tribal names + tribal_overlap_with_tracts[field_names.TRIBAL_LAND_AREA_NAME] = ( + tribal_overlap_with_tracts[field_names.TRIBAL_LAND_AREA_NAME] + .str.replace(" LAR", "") + .str.replace(" TSA", "") + .str.replace(" IRA", "") + .str.replace(" AK", "") + ) + tribal_overlap_with_tracts = tribal_overlap_with_tracts.groupby( [self.GEOID_TRACT_FIELD_NAME] ).agg(