Skip to main content

A set of utilities for manipulating (Geo)JSON and (Geo)TIFF data.

Project description

Package Description Status
Hydrodata Access NWIS, HCDN 2009, NLCD, and SSEBop databases Github Actions
PyGeoOGC Send queries to any ArcGIS RESTful-, WMS-, and WFS-based services Github Actions
PyGeoUtils Convert responses from PyGeoOGC’s supported web services to datasets Github Actions
PyNHD Navigate and subset NHDPlus (MR and HR) using web services Github Actions
Py3DEP Access topographic data through National Map’s 3DEP web service Github Actions
PyDaymet Access Daymet for daily climate data both single pixel and gridded Github Actions

PyGeoUtils: Manipulate (Geo)JSON and (Geo)TIFF data

PyPi Conda Version CodeCov Binder

CodeFactor black pre-commit

🚨 This package is under heavy development and breaking changes are likely to happen. 🚨


PyGeoUtils is a part of Hydrodata software stack and provides utilities for manipulating (Geo)JSON and (Geo)TIFF data. These utilities are:

  • json2geodf: For converting (Geo)JSON objects to GroPandas dataframe.
  • arcgis2geojson: For converting ESRIGeoJSON objects to standard GeoJSON format.
  • gtiff2xarray: For converting (Geo)TIFF objects to xarray datasets.
  • xarray_geomask: For masking a xarray.Dataset or xarray.DataArray using a polygon.

All these function handle all necessary CRS transformations. Moreover, requests for additional functionalities can be submitted via issue tracker.


You can install PyGeoUtils using pip after installing libgdal on your system (for example, in Ubuntu run sudo apt install libgdal-dev):

$ pip install pygeoutils

Alternatively, PyGeoUtils can be installed from the conda-forge repository using Conda:

$ conda install -c conda-forge pygeoutils

Quick start

To demonstrate capabilities of PyGeoUtils lets use PyGeoOGC to access National Wetlands Inventory from WMS, and FEMA National Flood Hazard via WFS, then convert the output to GeoDataFrame and xarray.Dataset using PyGeoUtils.

import pygeoutils as geoutils
from pygeoogc import WFS, WMS
from shapely.geometry import Polygon

geometry =  Polygon(
        [-118.72, 34.118],
        [-118.31, 34.118],
        [-118.31, 34.518],
        [-118.72, 34.518],
        [-118.72, 34.118],

url_wms = ""
wms = WMS(
r_dict = wms.getmap_bybox(
wetlands = geoutils.gtiff2xarray(r_dict, geometry, "epsg:4326")

url_wfs = ""
wfs = WFS(
r = wfs.getfeature_bybox(geometry.bounds, box_crs="epsg:4326")
flood = geoutils.json2geodf(r.json(), "epsg:4269", "epsg:4326")


Contributions are very welcomed. Please read CONTRIBUTING.rst file for instructions.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pygeoutils, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size pygeoutils-0.2.0-py2.py3-none-any.whl (12.3 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size pygeoutils-0.2.0.tar.gz (35.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page