Comments (7)
That worked! Thanks so much.
from pynhd.
Thank you!
500 errors usually mean that the service is temporary unavailable. I just gave it try, and it works now.
from pynhd.
Okay, that is good to know. I am still getting that error, but I'll keep trying. Thanks for your help!
from pynhd.
Hi! I figured out the problem -- I was trying to get too many comids at once (12700). After a little testing, it seems like the max is 3000.
I was able to get all the info like this:
ls = []
for i in range(1, int(len(comids) / 1000.)+2):
mn_val = (i-1) * 1000
if i * 1000 > len(comids):
mx_val = len(comids)
else:
mx_val = i * 1000
vals = comids[mn_val:mx_val]
print(mn_val, mx_val)
cat = wd_cat.byid("featureid", vals)
# df.append(cat, ignore_index=True)
ls.append(cat)
from pynhd.
Thanks, for following up on this, and finding the issue.
I didn't notice that you're working with a different station ID than the one in the README. So I now am able to reproduce this error. Please provide a minimal working example (MWE) next time, so I can reproduce the error. This is a MWE that reproduces your error.
from pynhd import NLDI, WaterData
nldi = NLDI()
station_id = "01482100"
basin = nldi.get_basins(station_id)
flw_trib = nldi.navigate_byid(
fsource="nwissite",
fid=f"USGS-{station_id}",
navigation="upstreamTributaries",
source="flowlines",
distance=1000,
)
comids = flw_trib.nhdplus_comid.to_list()
wd = WaterData("catchmentsp")
catchments = wd.byid("featureid", comids)
Since you mentioned that there's a limit, I am going to work on a fix. I will ping you once it's done so just to make sure it's fixed.
from pynhd.
I pushed a fix to pygeoogc
which is the package pynhd
uses for sending requests. Can you please install it from git and retry using the MWE that I provided?
You can install the fix like so:
pip install git+https://github.com/cheginit/pygeoogc
from pynhd.
Great! I am going to release a new version with the fix. Thanks for reporting and testing.
from pynhd.
Related Issues (16)
- WBD watershed access using pynhd.WaterData vs pygeoogc.ArcGISRESTful HOT 9
- nhd_attrs not working HOT 2
- WaterData.byid vs WaterData.getfeature_byid HOT 2
- Add support for pygeoapi_plugins
- Add support for StreamStat HOT 3
- Example notebook import errors HOT 9
- Add the updated NHDPlus attrs
- None values in nldi.get_basins() HOT 2
- Add support for geoconnex
- Invalid projection issue while importing "get_basins()" method from "pynhd". HOT 5
- Error while using pynhd. HOT 4
- Error when using nhd.byids("COMID", main.index.tolist()) (River Elevation and Cross-Section example) HOT 2
- InvalidInputValue Error Using NLDI navigate_byid() HOT 5
- Pynhd: GeoConnex NameError HOT 9
- flow_trace() only returns one upstream river reach HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pynhd.