Quadtree grid generator
Project description
Quadgrid
The quadgrid
package provides a class and some convenience functions
for generating quadtree-based grids at arbitrary resolutions in pandas, geopandas and xarray formats for use in geospatial analysis and catastrophe risk modelling.
Overview
Quadtree grids are a way of recursively partitioning a plane into nested quadrants, allowing for simple but efficient geocoding of points.
Some assumptions have been made to simplify the package:
- all coordinates are in decimal degrees
- all longitudes range from -180 to +180 degrees
- the centre of the grid is at 0E, 0N
The package contains a single class, QuadGrid
, which is used to
generate grid objects. The class has methods to convert the grid into
tabular (pandas DataFrame), vector (geopandas GeoDataFrame) and raster
(xarray Dataset) formats which can be saved or used in further processing.
Individual quadcells at a given resolution are labelled with unique quadtreeIDs (qids). In the simplified example below, the red point is in top-level cell '2', then cell '2', then '0' then '3' giving a nominal qid of '2203'. In practice, quadtrees lend themselves to a base-4 encoding, allowing them to be stored and processed efficiently as integers.
Versions
0.1.2
Changed email address in pyproject.toml
0.1.1
Bug fix to ensure user-specified bounded grid is consistent with the global grid
0.1.0
First release
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
Built Distribution
File details
Details for the file quadgrid-0.1.3.tar.gz
.
File metadata
- Download URL: quadgrid-0.1.3.tar.gz
- Upload date:
- Size: 228.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01a53b5fb25bb601ff88477c1b2c72962e5bcad34059ffac60a5594b85dc4a61 |
|
MD5 | b4f79b2497637e2c69aff1481dce2f2e |
|
BLAKE2b-256 | 2e1409518adf45d1bd4d4ee0657b9cd28c8d100969e50fe7bf41fbbf4ce2cba2 |
File details
Details for the file quadgrid-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: quadgrid-0.1.3-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb06ba4e51bec2ba1d4baaf4a2e714c228ae0e153e488a93d06163d7ee0c4015 |
|
MD5 | b2cf930f81df9244dbbbdcae5b445e72 |
|
BLAKE2b-256 | 493156ce70c109bac94fa6a24799ad83351e97a57b2e2683e2b47e754faf8c59 |