Get all HUC4 for CONUS as GeoDataFrame #15
-
Struggling to figure out how I can get a geopandas dataframe of all the huc4 for CONUS. I see:
Would I need to get the geometry of CONUS and request |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 3 replies
-
Yes, the best way is to pass the bounds and use wbd = WBD("huc4")
conus_bound = (-124.848974, 24.396308, -66.885444, 49.384479)
huc4 = wbd.bygeom(conus_bound) |
Beta Was this translation helpful? Give feedback.
-
I have written a little function for my personal use that gets the full HUC geometries. Since it's useful at least for one person, I just added it to PygeoHydro! You can reinstall from the repo to use it. It's called |
Beta Was this translation helpful? Give feedback.
-
@cheginit , thanks so much! Although the response back sounded like failure: from pygeohydro import WBD
import pygeohydro as gh
conus = gh.helpers.get_us_states("contiguous")
bbox = tuple(conus.total_bounds)
wbd = WBD("huc2")
dhuc2 = wbd.bygeom(bbox)
It would seem like it worked:
|
Beta Was this translation helpful? Give feedback.
-
@cheginit , this is great! I used it in this notebook! |
Beta Was this translation helpful? Give feedback.
-
Grrr, thanks! Fixed in https://nbviewer.org/gist/32bc2c9ee50dd26335de2e54663b6531 |
Beta Was this translation helpful? Give feedback.
Yes, the best way is to pass the bounds and use
.bygeom
. For example, for CONUS you can do: