Metadata-Version: 2.1
Name: pygeoutils
Version: 0.10.0
Summary: A set of utilities for manipulating (Geo)JSON and (Geo)TIFF data.
Home-page: https://github.com/cheginit/pygeoutils
Author: Taher Chegini
Author-email: cheginit@gmail.com
License: MIT license
Project-URL: Issues, https://github.com/cheginit/pygeoutils/issues
Project-URL: CI, https://github.com/cheginit/pygeoutils/actions
Project-URL: Changelog, https://github.com/cheginit/pygeoutils/blob/master/HISTORY.rst
Description: .. .. image:: https://raw.githubusercontent.com/cheginit/pygeohydro/master/docs/_static/pygeoutils_logo.png
        ..     :target: https://github.com/cheginit/pygeoutils
        ..     :align: center
        
        .. |
        
        .. |pygeohydro| image:: https://github.com/cheginit/pygeohydro/actions/workflows/test.yml/badge.svg
            :target: https://github.com/cheginit/pygeohydro/actions?query=workflow%3Apytest
            :alt: Github Actions
        
        .. |pygeoogc| image:: https://github.com/cheginit/pygeoogc/actions/workflows/test.yml/badge.svg
            :target: https://github.com/cheginit/pygeoogc/actions?query=workflow%3Apytest
            :alt: Github Actions
        
        .. |pygeoutils| image:: https://github.com/cheginit/pygeoutils/actions/workflows/test.yml/badge.svg
            :target: https://github.com/cheginit/pygeoutils/actions?query=workflow%3Apytest
            :alt: Github Actions
        
        .. |pynhd| image:: https://github.com/cheginit/pynhd/actions/workflows/test.yml/badge.svg
            :target: https://github.com/cheginit/pynhd/actions?query=workflow%3Apytest
            :alt: Github Actions
        
        .. |py3dep| image:: https://github.com/cheginit/py3dep/actions/workflows/test.yml/badge.svg
            :target: https://github.com/cheginit/py3dep/actions?query=workflow%3Apytest
            :alt: Github Actions
        
        .. |pydaymet| image:: https://github.com/cheginit/pydaymet/actions/workflows/test.yml/badge.svg
            :target: https://github.com/cheginit/pydaymet/actions?query=workflow%3Apytest
            :alt: Github Actions
        
        =========== ==================================================================== ============
        Package     Description                                                          Status
        =========== ==================================================================== ============
        PyGeoHydro_ Access NWIS, NID, HCDN 2009, NLCD, and SSEBop databases              |pygeohydro|
        PyGeoOGC_   Send queries to any ArcGIS RESTful-, WMS-, and WFS-based services    |pygeoogc|
        PyGeoUtils_ Convert responses from PyGeoOGC's supported web services to datasets |pygeoutils|
        PyNHD_      Navigate and subset NHDPlus (MR and HR) using web services           |pynhd|
        Py3DEP_     Access topographic data through National Map's 3DEP web service      |py3dep|
        PyDaymet_   Access Daymet for daily climate data both single pixel and gridded   |pydaymet|
        =========== ==================================================================== ============
        
        .. _PyGeoHydro: https://github.com/cheginit/pygeohydro
        .. _PyGeoOGC: https://github.com/cheginit/pygeoogc
        .. _PyGeoUtils: https://github.com/cheginit/pygeoutils
        .. _PyNHD: https://github.com/cheginit/pynhd
        .. _Py3DEP: https://github.com/cheginit/py3dep
        .. _PyDaymet: https://github.com/cheginit/pydaymet
        
        PyGeoUtils: Utilities for (Geo)JSON and (Geo)TIFF Conversion
        ------------------------------------------------------------
        
        .. image:: https://img.shields.io/pypi/v/pygeoutils.svg
            :target: https://pypi.python.org/pypi/pygeoutils
            :alt: PyPi
        
        .. image:: https://img.shields.io/conda/vn/conda-forge/pygeoutils.svg
            :target: https://anaconda.org/conda-forge/pygeoutils
            :alt: Conda Version
        
        .. image:: https://codecov.io/gh/cheginit/pygeoutils/branch/master/graph/badge.svg
            :target: https://codecov.io/gh/cheginit/pygeoutils
            :alt: CodeCov
        
        .. image:: https://mybinder.org/badge_logo.svg
            :target: https://mybinder.org/v2/gh/cheginit/pygeohydro/master?filepath=docs%2Fexamples
            :alt: Binder
        
        |
        
        .. image:: https://www.codefactor.io/repository/github/cheginit/pygeoutils/badge
           :target: https://www.codefactor.io/repository/github/cheginit/pygeoutils
           :alt: CodeFactor
        
        .. image:: https://img.shields.io/badge/code%20style-black-000000.svg
            :target: https://github.com/psf/black
            :alt: black
        
        .. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white
            :target: https://github.com/pre-commit/pre-commit
            :alt: pre-commit
        
        |
        
        Features
        --------
        
        PyGeoUtils is part of a software stack for retrieving and processing hydrology and climatology
        dataset. This package provides utilities for manipulating (Geo)JSON and (Geo)TIFF responses
        from web services. 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 <https://xarray.pydata.org/>`__
          datasets.
        - ``gtiff2file``: For saving (Geo)TIFF objects to a raster file.
        - ``xarray_geomask``: For masking a ``xarray.Dataset`` or ``xarray.DataArray`` using a polygon.
        
        All these functions handle all necessary CRS transformations.
        
        You can find some example notebooks `here <https://github.com/cheginit/geohydrohub-examples>`__.
        
        Please note that since this project is in early development stages, while the provided
        functionalities should be stable, changes in APIs are possible in new releases. But we
        appreciate it if you give this project a try and provide feedback. Contributions are most welcome.
        
        Moreover, requests for additional functionalities can be submitted via
        `issue tracker <https://github.com/cheginit/pygeoutils/issues>`__.
        
        Installation
        ------------
        
        You can install PyGeoUtils using ``pip`` after installing ``libgdal`` on your system
        (for example, in Ubuntu run ``sudo apt install libgdal-dev``):
        
        .. code-block:: console
        
            $ pip install pygeoutils
        
        Alternatively, PyGeoUtils can be installed from the ``conda-forge`` repository
        using `Conda <https://docs.conda.io/en/latest/>`__:
        
        .. code-block:: console
        
            $ conda install -c conda-forge pygeoutils
        
        Quick start
        -----------
        
        To demonstrate capabilities of PyGeoUtils let's use
        `PyGeoOGC <https://github.com/cheginit/pygeoogc>`__ to access
        `National Wetlands Inventory <https://www.fws.gov/wetlands/>`__ from WMS, and
        `FEMA National Flood Hazard <https://www.fema.gov/national-flood-hazard-layer-nfhl>`__
        via WFS, then convert the output to ``xarray.Dataset`` and ``GeoDataFrame``, respectively.
        
        .. code-block:: python
        
            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 = "https://www.fws.gov/wetlands/arcgis/services/Wetlands_Raster/ImageServer/WMSServer"
            wms = WMS(
                url_wms,
                layers="0",
                outformat="image/tiff",
                crs="epsg:3857",
            )
            r_dict = wms.getmap_bybox(
                geometry.bounds,
                1e3,
                box_crs="epsg:4326",
            )
            wetlands = geoutils.gtiff2xarray(r_dict, geometry, "epsg:4326")
        
            url_wfs = "https://hazards.fema.gov/gis/nfhl/services/public/NFHL/MapServer/WFSServer"
            wfs = WFS(
                url_wfs,
                layer="public_NFHL:Base_Flood_Elevations",
                outformat="esrigeojson",
                crs="epsg:4269",
            )
            r = wfs.getfeature_bybox(geometry.bounds, box_crs="epsg:4326")
            flood = geoutils.json2geodf(r.json(), "epsg:4269", "epsg:4326")
        
        We can also save WMS outpus as raster file using ``gtiff2file``:
        
        .. code-block:: python
        
            geoutils.gtiff2file(r_dict, geometry, "epsg:4326", "raster")
        
        Contributing
        ------------
        
        Contributions are very welcomed. Please read
        `CONTRIBUTING.rst <https://github.com/cheginit/pygeoogc/blob/master/CONTRIBUTING.rst>`__
        file for instructions.
        
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.6
Description-Content-Type: text/x-rst
