A set of utilities for manipulating (Geo)JSON and GeoTIFF data.
Project description
🚨 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. There is also an invetory of URLs for some of these web services in form of a class called ServiceURL. These URLs are in three categories: ServiceURL().resful, 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 addiitonal 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
Quickstart
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 hydrodata 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
Contirbutions are very welcomed. Please read CODE_OF_CONDUCT.rst and 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.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 703aa11b81c735fa12c3a2093ae51f6184378f9dc1dccdf8f13f8ee308b9e27a |
|
MD5 | 23bfe8f48d88e7412ddc60bb8d41a8c9 |
|
BLAKE2b-256 | 28f4c51bd8d0481b5c7b3a5326bbca7877b9113f9dfa0a9bb7ad2f5f5ca54ad4 |