Closed msleckman closed 1 year ago
Thanks for reporting the issue. I will look into it and let you know.
The issue is that the geometry of the HUC2 that you're passing to the function is too complex so when it converts the geometry to string the web service cannot handle it. A simple solution is to simplify
the geometry before passing it to the function. For example:
geom = polygon1_huc2.reset_index().geometry[0].simplify(1e-3)
Then pass it to the function.
Please reopen if you still have this issue.
What happened?
I've pulled huc02 and huc4 from the USGS WBD using pynhd's
WaterData()
function.I am trying to pull gages ('gagesii') within those boundary polygons (using
WaterData('gagesii').by_geom()
). I got an error when attempting to pull gages for huc2. Gages returned successfully for the huc04 polygons.----
Examples gpkgs: tmp_huc_polygons.zip
What did you expect to happen?
I tested this with a huc 4 polygon and I did not run into this error. This is the expected output.
Minimal Complete Verifiable Example
MVCE confirmation
Relevant log output
No response
Anything else we need to know?
I've attached 4 example polygons (2x HUC2, 2x HUC4) in the attached zip file (first text box) to test this bug. After downloading those example gpkg files, they can be read in and tested using the code chunk in the MVCE box. 2 polygons per huc level are provided to test and better demonstrate the error.
Environment