🌏 A python package for wrangling geospatial datasets
Project description
Geowrangler
Overview
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
- Grids Generation
- Geometry Validation
- Vector Zonal Stats
- Raster Zonal Stats
- Area Zonal Stats
- Distance Zonal Stats
- DHS Processing Utils
- Dataset Downloads
- Spatial Join Using Highest Intersection
- Tile Clustering
- Raster Processing
- Raster to Dataframe
Reference
- Grids Generation
- Polygon Fill Algorithms
- Geometry Validation
- Vector Zonal Stats
- Raster Zonal Stats
- Area Zonal Stats
- Distance Zonal Stats
- DHS Processing Utils
- Dataset Geofabrik (OSM)
- Dataset Ookla
[!NOTE]
All the documentation pages (including the references) are executable Jupyter notebooks.
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
File details
Details for the file geowrangler-0.5.1.tar.gz
.
File metadata
- Download URL: geowrangler-0.5.1.tar.gz
- Upload date:
- Size: 67.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a8722c75f1a180c4daee3bb79334b0ea9e4b09e6ec5978f91f1dd8bd3a701e8 |
|
MD5 | 6852fa91b743c50843a4cfa2d9a0546e |
|
BLAKE2b-256 | 74567e0c1d06504fe8fb8d39a444e2caecca5f355e06a5e27efb9297277f57ab |
File details
Details for the file geowrangler-0.5.1-py3-none-any.whl
.
File metadata
- Download URL: geowrangler-0.5.1-py3-none-any.whl
- Upload date:
- Size: 55.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 761cdda281284977f0cb6f4981b2cb8d9d66500df7213c21fd977eb925497fe6 |
|
MD5 | d175c8cc0387578078f983f36e274ea1 |
|
BLAKE2b-256 | c07d698c12271b9ff67c581716bf4cf58a7713819f2569f6a173b763aa2504bc |