An interface to ArcGIS RESTful-, WFS-, and WMS-based services.
Project description
Package |
Description |
---|---|
Access NWIS, HCDN 2009, NLCD, and SSEBop databases |
|
Query data from any ArcGIS RESTful-, WMS-, and WFS-based services |
|
Convert responses from PyGeoOGC’s supported web services to datasets |
|
Access NLDI and WaterData web services for navigating the NHDPlus database |
|
Access topographic data through the 3D Elevation Program (3DEP) web service |
|
Access the Daymet database for daily climate data |
PyGeoOGC: Query ArcGIS RESTful, WMS, and WFS
🚨 This package is under heavy development and breaking changes are likely to happen. 🚨
Features
PyGeoOGC is a part of Hydrodata software stack and provides interfaces to web services that are based on ArcGIS RESTful, WMS, and WFS. It is noted that although, all these web service have limits on the number of objects (e.g., 1000 objectIDs for RESTful) or pixels (e.g., 8 million pixels) per requests, PyGeoOGC takes care of dividing the requests into smaller chunks under-the-hood and then merges them.
There is also an inventory of URLs for some of these web services in form of a class called ServiceURL. These URLs are in three categories: ServiceURL().restful, ServiceURL().wms, and ServiceURL().wfs.
You can try using PyGeoOGC without installing it on you system by clicking on the binder badge below the PyGeoOGC banner. A Jupyter notebook instance with the Hydrodata software stack pre-installed will be launched in your web browser and you can start coding!
Moreover, requests for additional functionalities can be submitted via issue tracker.
Installation
You can install PyGeoOGC using pip:
$ pip install pygeoogc
Alternatively, PyGeoOGC can be installed from the conda-forge repository using Conda:
$ conda install -c conda-forge pygeoogc
Quick start
We can access Watershed Boundary Dataset via RESTful service, National Wetlands Inventory from WMS, and FEMA National Flood Hazard via WFS. The output for these functions are of type requests.Response that can be converted to GeoDataFrame or xarray.Dataset using Hydrodata.
from pygeoogc import ArcGISRESTful, WFS, WMS, ServiceURL
import pygeoutils as geoutils
from pynhd import NLDI
basin_geom = NLDI().getfeature_byid(
"nwissite",
"USGS-11092450",
basin=True
).geometry[0]
wbd12 = ArcGISRESTful(f"{ServiceURL().restful.wbd}/6")
wbd12.get_featureids(basin_geom)
resp = wbd12.get_features()
huc12 = geoutils.json2geodf(resp)
wms = WMS(
ServiceURL().wms.fws,
layers="0",
outformat="image/tiff",
crs="epsg:3857",
)
r_dict = wms.getmap_bybox(
basin_geom.bounds,
1e3,
box_crs="epsg:4326",
)
wetlands = geoutils.gtiff2xarray(r_dict, basin_geom, "epsg:4326")
wfs = WFS(
ServiceURL().wfs.fema,
layer="public_NFHL:Base_Flood_Elevations",
outformat="esrigeojson",
crs="epsg:4269",
)
r = wfs.getfeature_bybox(basin_geom.bounds, box_crs="epsg:4326")
flood = geoutils.json2geodf(r.json(), "epsg:4269", "epsg:4326")
Contributing
Contributions are very welcomed. Please read CONTRIBUTING.rst file for instructions.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pygeoogc-0.1.7-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fe1d665d57b730f4dfd694c5a24dd5c0bb16872c9599cbd378e2b0f5cc0fe07 |
|
MD5 | 374b219cf57a0d7a1c671714f6e3d75b |
|
BLAKE2b-256 | 65d359bb233806ce30a5c4bd9846775f5deca1b042b5f6eb84f004d9951d1e67 |