Skip to main content

🌏 A python package for wrangling geospatial datasets

Project description

Geowrangler

Geowrangler logo

Overview

License:MIT Versions Docs

Geowrangler is a Python package for geodata wrangling. It helps you build data transformation workflows that have no out-of-the-box solutions from other geospatial libraries.

We surveyed our past geospatial projects to extract these solutions for our work and hope that these will be useful for others as well.

Our audience are researchers, analysts, and engineers delivering geospatial projects.

We welcome your comments, suggestions, bug reports, and code contributions to make Geowrangler better.

Context

Geowrangler was borne out of our efforts to reduce the amount of boilerplate code in wrangling geospatial data. It builds on top of existing geospatial libraries such as geopandas, rasterio, rasterstats, morecantile, and others. Our goals are centered on the following tasks:

  • Extracting area of interest zonal statistics from vector and raster data
  • Gridding areas of interest
  • Validating geospatial datasets
  • Downloading of publically available geospatial datasets (e.g., OSM, Ookla, and Nightlights)
  • Other geospatial vector and raster data processing tasks

To make it easy to document, maintain, and extend the package, we opted to maintain the source code, tests and documentation on Jupyter notebooks. We use nbdev to generate the Python package and documentation from the notebooks. See this document to learn more about our development workflow.

By doing this, we hope to make it easy for geospatial analysts, scientists, and engineers to learn, explore, and extend this package for their geospatial processing needs.

Aside from providing reference documentation for each module, we have included extensive tutorials and use case examples in order to make it easy to learn and use.

Modules

  • Grid Tile Generation
  • Geometry Validation
  • Vector Zonal Stats
  • Raster Zonal Stats
  • Area Zonal Stats
  • Distance Zonal Stats
  • Vector to Raster Mask
  • Raster to Dataframe
  • Raster Processing
  • Demographic and Health Survey (DHS) Processing Utils
  • Geofabrik (OSM) Data Download
  • Ookla Data Download
  • Night Lights
  • Dataset Utils
  • Tile Clustering
  • Spatial Join Highest Intersection

Check this page for more details about our Roadmap.

Installation

pip install geowrangler

Exploring the Documentation

We develop the package modules alongside their documentation. Each page comes with an Open in Colab button that will open the Jupyter notebook in Colab for exploration (including this page).

Click on the Open in Colab button below to open this page as a Google Colab notebook.

# view the source of a grid component
gdf = gpd.GeoDataFrame()
grid = geowrangler.grids.SquareGridGenerator(gdf, 1)
grid??
Type:        SquareGridGenerator
String form: <geowrangler.grids.SquareGridGenerator object>
File:        ~/work/unicef-ai4d/geowrangler-1/geowrangler/grids.py
Source:     
class SquareGridGenerator:
    def __init__(
        self,
        cell_size: float,  # height and width of a square cell in meters
        grid_projection: str = "EPSG:3857",  # projection of grid output
        boundary: Union[SquareGridBoundary, List[float]] = None,  # original boundary
    ):
        self.cell_size = cell_size
        self.grid_projection = grid_projection
        self.boundary = boundary

Tutorials

Reference

Note

All the documentation pages (including the references) are executable Jupyter notebooks.

Project details


Download files

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

Source Distribution

geowrangler-0.4.0.tar.gz (63.5 kB view details)

Uploaded Source

Built Distribution

geowrangler-0.4.0-py3-none-any.whl (52.9 kB view details)

Uploaded Python 3

File details

Details for the file geowrangler-0.4.0.tar.gz.

File metadata

  • Download URL: geowrangler-0.4.0.tar.gz
  • Upload date:
  • Size: 63.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for geowrangler-0.4.0.tar.gz
Algorithm Hash digest
SHA256 5a5ab2ed5fb06d3c46f4aae8da632f133211a74cfdcc3023526fa1abbdf07036
MD5 a48dc9c3a9e3db228a9b5c22dd251880
BLAKE2b-256 1d70ae4ebfcf183409bb2fdadca20162af5be524c8016385cf18117da2464c62

See more details on using hashes here.

File details

Details for the file geowrangler-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: geowrangler-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 52.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for geowrangler-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 90ae1dfed0fc3549a848e5937c80f2ae7f1586a3ca28ee777b21f5514caa90f1
MD5 f5fe5f3794f7087aa3f04ea862c35f6b
BLAKE2b-256 08cddebd196a8acb2592faebae597633e0d1f14389a9ad484239af4c30aec41f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page