Skip to content

Commit

Permalink
Merge pull request #932 from NOAA-OWP/bugfix-hand-fim-ak-proj
Browse files Browse the repository at this point in the history
Bugfix: HAND FIM processing update to distinguish between conus/ak projections
  • Loading branch information
shawncrawley authored Oct 28, 2024
2 parents 8a0e05e + f3a3a55 commit ca67401
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,8 @@ def process(window):
from shapely.geometry import shape
geom = [shape(i['geom']) for i in geoms]
hydro_ids = [i['hydro_id'] for i in geoms]
df_final = gpd.GeoDataFrame({'geom':geom, 'hydro_id': hydro_ids}, crs="ESRI:102039", geometry="geom")
crs = 'EPSG:3338' if str(huc8).startswith('19') else 'EPSG:5070'
df_final = gpd.GeoDataFrame({'geom':geom, 'hydro_id': hydro_ids}, crs=crs, geometry="geom")
df_final = df_final.dissolve(by="hydro_id")
df_final = df_final.to_crs(3857)
df_final = df_final.set_crs('epsg:3857')
Expand Down Expand Up @@ -474,7 +475,8 @@ def process(window):
from shapely.geometry import shape
geom = [shape(i['geom']) for i in geoms]
hydro_ids = [i['hydro_id'] for i in geoms]
df_final = gpd.GeoDataFrame({'geom':geom, 'hydro_id': hydro_ids}, crs="ESRI:102039", geometry="geom")
crs = 'EPSG:3338' if str(huc8).startswith('19') else 'EPSG:5070'
df_final = gpd.GeoDataFrame({'geom':geom, 'hydro_id': hydro_ids}, crs=crs, geometry="geom")
df_final = df_final.dissolve(by="hydro_id")
df_final['geom'] = df_final['geom'].simplify(5) #Simplifying polygons to ~5m to clean up problematic geometries
df_final = df_final.to_crs(3857)
Expand Down

0 comments on commit ca67401

Please sign in to comment.