A Python package for geospatial iteration utilities
Project description
GeoIters
Installation
pip install geoiters
Usage
1. Grid Iterator
Grid by Rows and Columns
from geoiters.grid import GridIterator
from geoiters.utils import Extent
ext = Extent(-74.2, 40.65, -73.7, 40.85, crs="EPSG:4326")
itr = GridIterator(ext, rows=10, columns=10)
for i, patch in enumerate(itr):
print(i, patch)
See the complete example here.
Grid by Max Patch Area
from geoiters.grid import GridIterator
from geoiters.utils import Extent
ext = Extent(-74.2, 40.65, -73.7, 40.85, crs="EPSG:4326")
itr = GridIterator(ext, patch_max_area=10_000_000) # area in sqm
for i, patch in enumerate(itr):
print(i, patch)
See the complete example here.
To Use with Multiprocessing
import time
import multiprocessing as mp
from geoiters.utils import Extent
from geoiters.grid import GridIterator
def worker(patch: Extent):
time.sleep(1) # simulate a time-consuming task
print(f"Worker {mp.current_process().name}: "
f"Processing patch with extent {patch}")
ext = Extent(-74.2, 40.65, -73.7, 40.85, crs="EPSG:4326")
itr = GridIterator(ext, rows=4, columns=4)
pool = mp.Pool(processes=4)
pool.map(worker, itr)
pool.close()
pool.join()
See the complete example here.
2. Tiles Iterator
from geoiters.grid import TilesIterator
from geoiters.utils import Extent
ext = Extent(-74.2, 40.65, -73.7, 40.85, crs="EPSG:4326")
itr = TilesIterator(ext, zoom_level=13)
for i, tile in enumerate(itr):
print(i, tile)
See the complete example here.
Features
- Lightweight and easy to use.
- Efficient iteration over geospatial grids.
- Divide a geographical extent into patches and iterate through them.
- Divide a geographical extent by the number of rows and the number of columns.
- Divide a geographical extent by the maximum area of a single patch.
To be Implemented
- Implement a hexagonal tessellation iterator.
- Overlapping patches.
- Iteration order options (sequence, checkered, etc.)
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file geoiters-0.2.7.tar.gz.
File metadata
- Download URL: geoiters-0.2.7.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23490b23be1103ca1adc06c30e60e0c5c43eb4c6b78fe1628bb0cdcbe8e073dc
|
|
| MD5 |
6347374b85e1f580389dc298b163c107
|
|
| BLAKE2b-256 |
144e5818a79bbbf09c5d9da89c20ad66b3e396b23d42485613c44c3a90dca929
|
Provenance
The following attestation bundles were made for geoiters-0.2.7.tar.gz:
Publisher:
publish_pypi.yml on sabughazal/geoiters
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
geoiters-0.2.7.tar.gz -
Subject digest:
23490b23be1103ca1adc06c30e60e0c5c43eb4c6b78fe1628bb0cdcbe8e073dc - Sigstore transparency entry: 778914680
- Sigstore integration time:
-
Permalink:
sabughazal/geoiters@e5b5130a28ac65173f7afe4553bab507b84efce3 -
Branch / Tag:
refs/tags/v0.2.7 - Owner: https://github.com/sabughazal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@e5b5130a28ac65173f7afe4553bab507b84efce3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file geoiters-0.2.7-py3-none-any.whl.
File metadata
- Download URL: geoiters-0.2.7-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09e097217b83fc1453a333f8547e91d3e5c506537000935109ad1bd370de7f7d
|
|
| MD5 |
a4e19d31d5571d3dbaebf7dc4e1d0076
|
|
| BLAKE2b-256 |
9f9fa5f0c28281d409897f3086f93750e70f0b24cd81a3a2539411efa9a85f47
|
Provenance
The following attestation bundles were made for geoiters-0.2.7-py3-none-any.whl:
Publisher:
publish_pypi.yml on sabughazal/geoiters
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
geoiters-0.2.7-py3-none-any.whl -
Subject digest:
09e097217b83fc1453a333f8547e91d3e5c506537000935109ad1bd370de7f7d - Sigstore transparency entry: 778914682
- Sigstore integration time:
-
Permalink:
sabughazal/geoiters@e5b5130a28ac65173f7afe4553bab507b84efce3 -
Branch / Tag:
refs/tags/v0.2.7 - Owner: https://github.com/sabughazal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@e5b5130a28ac65173f7afe4553bab507b84efce3 -
Trigger Event:
release
-
Statement type: