Skip to content

Commit

Permalink
Distinguishes between conus/ak projections
Browse files Browse the repository at this point in the history
Refs #931
  • Loading branch information
shawncrawley committed Oct 24, 2024
1 parent 8a0e05e commit f3a3a55
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 f3a3a55

Please sign in to comment.