PyEarthBuffer
Geographic Coordinate System (GCS) Buffer Operations in Python.
If you find this package useful, please cite it in your work. You can also support it by buying me a coffee or sponsoring it on GitHub.
Dependencies
pyearthbuffer directly depends on the following packages:
gdalnumpypyearthscipy
Documentation
Please refer to the documentation for details on how to get started using the pyearthbuffer package.
Installation
pyearthbuffer depends on several geospatial packages including gdal, which are most reliably installed through conda:
conda install -c conda-forge pyearthbuffer
Or install from source in editable mode:
pip install -e .
Features
pyearthbuffer provides geodesic buffer operations on the WGS84 ellipsoid:
-
Object-based vector buffer (
gcsbuffer):- Geodesic buffers for Points, LineStrings, Polygons, and Multi-geometries.
- Accepts WKT strings, GeoJSON mappings, OGR geometries, or coordinate sequences.
- Formats output as WKT, GeoJSON, or OGR geometry objects.
- Explicit helpers:
gcsbuffer_point,gcsbuffer_line,gcsbuffer_polygon.
-
File-based vector batch buffer (
gcsbuffer_file):- Batch-processes GIS vector files (Shapefile, GeoJSON, GeoPackage, etc.).
- Preserves feature attribute tables and schema.
- Supports dissolve/union (
dissolve=True) and polygon area filtering (min_area). - Explicit helpers:
gcsbuffer_point_file,gcsbuffer_line_file,gcsbuffer_polygon_file.
Quick Start
1. In-Memory Geometry Buffering
import pyearthbuffer as peb
# Buffer a point (lon, lat) by 1,000 meters
point_wkt = peb.gcsbuffer((-74.006, 40.7128), distance=1000.0)
# Buffer a line corridor to GeoJSON
line_wkt = "LINESTRING (-74.006 40.7128, -73.990 40.7200)"
corridor = peb.gcsbuffer(line_wkt, distance=50.0, output_format="geojson")
# Buffer a polygon
poly_wkt = "POLYGON ((-74.0 40.7, -74.0 40.8, -73.9 40.8, -73.9 40.7, -74.0 40.7))"
poly_buffered = peb.gcsbuffer(poly_wkt, distance=500.0)
2. Batch File Buffering
import pyearthbuffer as peb
# Buffer an entire vector dataset file
peb.gcsbuffer_file(
input_file="input_roads.geojson",
output_file="output_corridors.shp",
distance=100.0,
dissolve=True, # Merge overlapping buffer zones
preserve_attributes=True,
)
Acknowledgment
This research was supported as part of the Next Generation Ecosystem Experiments-Tropics, funded by the U.S. Department of Energy, Office of Science, Office of Biological and Environmental Research at Pacific Northwest National Laboratory. The study was also partly supported by U.S. Department of Energy Office of Science Biological and Environmental Research through the Earth and Environmental System Modeling program as part of the Energy Exascale Earth System Model (E3SM) project.
License
BSD 3-Clause License. See LICENSE.md for details.
Metadata
Release files for pyearthbuffer 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyearthbuffer-0.1.0.tar.gz | 26.1 kB | Without provenance | Details for pyearthbuffer-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyearthbuffer-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pyearthbuffer-0.1.0-py3-none-any.whl |
Total release size: 43.9 kB
Release files / pyearthbuffer-0.1.0.tar.gz
| Download URL | pyearthbuffer-0.1.0.tar.gz |
|---|---|
| Size | 26.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3f00564c92cd709423d103efa2baeb6c0a754b7730288fbf66aaacf657bade4d
|
|
BLAKE2b-256 checksum How to use checksums |
8623a537e1b1dd570f536f93b7af0483357b86438fe675476c7c1df06cb0ff77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / pyearthbuffer-0.1.0-py3-none-any.whl
| Download URL | pyearthbuffer-0.1.0-py3-none-any.whl |
|---|---|
| Size | 17.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f9e4be1b11b857dda17ad39bb1684640042b4027c1a09f2ddb753f44f99c889b
|
|
BLAKE2b-256 checksum How to use checksums |
fb19e33767c4a5c6e0ef7fcc86d67b184d5e9b84bbc0f617a9aed59a326c8f43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for pyearthbuffer 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.