Tools for dealing with geospatial data
Project description
Geowrangler
Tools for wrangling with geospatial data
Overview
Geowrangler is a python package for geodata wrangling. It helps you build data transformation workflows with no out-of-the-box solutions from other geospatial libraries.
We have surveyed our past geospatial projects to extract these solutions for our work and hope it 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.
Modules
- Grid Tile Generation
- Geometry Validation
- Vector Zonal Stats
- Raster Zonal Stats (planned)
- Geometry Simplification (planned)
- Grid Tile Spatial Imputation (planned)
Installation
pip install git+https://github.com/thinkingmachines/geowrangler.git
Documentation
The documentation for the package is available here
Development
Development Setup
If you want to learn more about Geowrangler and explore its inner workings, you can setup a local development environment. You can run geowrangler's jupyter notebooks to see how the different modules are built and how they work.
Please ensure you are using python 3.7
or higher
pip install pre-commit poetry
pre-commit install
poetry install
poetry run pip install pip --upgrade
poetry run pip install -e .
Jupyter Notebook Development
The code for the geowrangler python package resides in Jupyter notebooks located in the notebooks
folder.
Using nbdev, we generate the python modules residing in the geowrangler
folder from code cells in jupyter notebooks marked with an #export
comment. A #default_exp <module_name>
comment at the first code cell of each notebook directs nbdev
to put the code in a module named <module_name>
in the geowrangler
folder.
See the nbdev cli documentation for more details on the commands to generate the package as well as the documentation.
Running notebooks
Run the following to view the jupyter notebooks in the notebooks
folder
poetry run jupyter lab
Generating and viewing the documentation site
To generate and view the documentation site on your local machine, the quickest way is to setup Docker. The following assumes that you have setup docker on your system.
poetry run nbdev_build_docs --mk_readme False --force_all True
docker-compose up jekyll
As an alternative if you don't want to use Docker you can install jekyll to view the documentation site locally.
nbdev
converts notebooks within the notebooks/
folder into a jekyll site.
From this jekyll site, you can then create a static site.
To generate the docs, run the following
poetry run nbdev_build_docs -mk_readme False --force_all True
cd docs && bundle i && cd ..
To run the jekyll site, run the following
cd docs
bundle exec jekyll serve
Running tests
We are using pytest
as our test framework. To run all tests and generate a generate a coverage report, run the following.
poetry run pytest --cov --cov-config=.coveragerc -n auto
To run a single test or test file
# for a single test function
poetry run pytest tests/test_grids.py::test_create_grids
# for a single test file
poetry run pytest tests/test_grids.py
Contributing
Please read CONTRIBUTING.md and CODE_OF_CONDUCT.md before anything.
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 geowrangler-0.1.0.dev1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfd14454e6ff346323a64686ac2af3eed6e8b73df14fdd85f26e40f920c1d125 |
|
MD5 | 1acdb0ae06c691a8161da0ad60a8ec57 |
|
BLAKE2b-256 | b1147e5a030cba21b0590e33b0919ec2f7fe4ab5ada50b63ca540b994f944abb |