Giter VIP home page Giter VIP logo

Comments (7)

sjordan29 avatar sjordan29 commented on June 17, 2024 1

That worked! Thanks so much.

from pynhd.

cheginit avatar cheginit commented on June 17, 2024

Thank you!

500 errors usually mean that the service is temporary unavailable. I just gave it try, and it works now.

from pynhd.

sjordan29 avatar sjordan29 commented on June 17, 2024

Okay, that is good to know. I am still getting that error, but I'll keep trying. Thanks for your help!

from pynhd.

sjordan29 avatar sjordan29 commented on June 17, 2024

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.

cheginit avatar cheginit commented on June 17, 2024

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.

cheginit avatar cheginit commented on June 17, 2024

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.

cheginit avatar cheginit commented on June 17, 2024

Great! I am going to release a new version with the fix. Thanks for reporting and testing.

from pynhd.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.