Remove suffixes from tribal lands (#1974) (#2008)

This commit is contained in:
Matt Bowen 2022-10-13 16:20:28 -04:00 committed by GitHub
parent 743d3ce37c
commit 841a26d566
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -45,7 +45,7 @@ class TribalOverlapETL(ExtractTransformLoad):
] ]
# A Tribal area that requires some special processing. # A Tribal area that requires some special processing.
ANNETTE_ISLAND_TRIBAL_NAME = "Annette Island LAR" ANNETTE_ISLAND_TRIBAL_NAME = "Annette Island"
CRS_INTEGER = 3857 CRS_INTEGER = 3857
TRIBAL_OVERLAP_CUTOFF = 0.995 # Percentage of overlap that rounds to 100% 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 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( tribal_overlap_with_tracts = tribal_overlap_with_tracts.groupby(
[self.GEOID_TRACT_FIELD_NAME] [self.GEOID_TRACT_FIELD_NAME]
).agg( ).agg(