Comments (2)
Thanks for reporting this. It seems that the two stations are close and their COMID belong to a non-network flowline:
from pynhd import NLDI, NHD
from pygeohydro import NWIS
import geopandas as gpd
nwis = NWIS()
info = nwis.get_info({"site": "04253294,04253296"})
coords = list(zip(info.dec_long_va, info.dec_lat_va))
nldi = NLDI()
comids = nldi.comid_byloc(coords)
ids = list(set(comids.comid))
nhd = NHD("flowline_mr")
flw = nhd.byids("COMID", ids)
bbox = gpd.GeoSeries(info.geometry.tolist() + flw.geometry.tolist()).unary_union.bounds
nhd_wb = NHD("waterbody_hr")
wb = nhd_wb.bygeom(bbox)
ax = flw.plot(color="r", label="Flowline", figsize=(10, 10))
wb.plot(ax=ax, color="b", alpha=0.2, label="Water Bodies")
info.plot(ax=ax, label="Stations")
ax.set_title(flw.GNIS_NAME.values[0])
ax.legend()
The non-flowline COMIDs are not included in NLDI, that's why it returns an empty geometry.
from pynhd.
from pynhd.
Related Issues (20)
- nhd_attrs not working HOT 2
- Bad Gateway for WaterData() URL HOT 7
- Add support for pygeoapi_plugins
- Add support for StreamStat HOT 3
- Example notebook import errors HOT 9
- Add the updated NHDPlus attrs
- 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
- pynhd and shapely import error HOT 5
- Docs for versions less than 0.14 HOT 3
- NLDI input error "x, y, z, and time must be same size" HOT 4
- Querying gages with WaterData('gagesii') within geometry of huc02 HOT 3
- WaterData().bygeom() error HOT 4
- Fail to extract watershed boundary 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.