Fiona: Python library for geographic data files
Python library for reading and writing geographic data files like GeoPackage and Shapefile.
Learn more about Fiona
Fiona is a Python library for reading and writing geographic vector data files built on top of GDAL/OGR. It uses Cython extensions to interface with the underlying GDAL C library while providing a more Pythonic API than GDAL's native bindings. The library models geographic features as data classes following the GeoJSON format specification. Fiona is commonly used for GIS data processing workflows, format conversion, and spatial data analysis pipelines.
GeoJSON-based Features
Models geographic features as GeoJSON-compatible data classes rather than GDAL's native feature objects. This provides a more intuitive and standardized data structure for Python developers.
Streaming Interface
Implements file-like Collection objects that can stream features from large datasets without loading everything into memory. Supports filtering operations like bounding box queries during iteration.
Virtual File Systems
Can read from and write to zipped archives, in-memory file systems, and cloud storage locations. Handles multi-layered GIS formats through GDAL's virtual file system capabilities.
import fiona
from fiona import Feature, Geometry
from shapely.geometry import mapping, shape
# Open a file for reading
with fiona.open("input.shp") as src:
# Get profile for output file
profile = src.profile
profile["schema"]["geometry"] = "Point"
profile["driver"] = "GPKG"
# Open output file and process features
with fiona.open("output.gpkg", "w", **profile) as dst:
for feat in src:
# Transform geometry (example: get centroid)
centroid_shp = shape(feat.geometry).centroid
new_geom = Geometry.from_dict(centroid_shp)
# Write transformed feature
dst.write(
Feature(geometry=new_geom, properties=feat.properties)
)Fixes several typos, renames variables for clarity, and resolves logging issues with NULL object representations in CRS class.
- –Several typos were found and fixed. One variable was renamed and the ContextVar in _vsipyopener.pyx was renamed
- –Logging in the CRS class no longer tries to print representations of objects that may be NULL when searching for authority matches
Major release with 25 new contributors, introducing Lisp-like filter expressions and deprecating Python-style filters and some modules.
- –Python-style filter expressions for CLI commands are being replaced by Lisp-like expressions
- –Some constants in the fiona.schema module will be removed in a future version
- –The fiona.path module will be removed in a future version
First release candidate for 1.10.0 that removes duplicate configuration files and includes GDAL 3.9.2 in PyPI wheels.
- –The setup.cfg duplicates project configuration in pyproject.toml and has been removed
- –PyPI wheels include GDAL 3.9.2
Top in Data Engineering
Related Repositories
Discover similar tools and frameworks used by developers
Flyway
Version-controlled SQL migrations with automated execution tracking.
pandas
Labeled data structures for tabular data analysis.
Neo4j
Open-source graph database storing data as nodes and relationships with Cypher query language.
Luigi
Build complex batch pipelines with dependency management.
COVID-19 Data
Archived NYT dataset of coronavirus cases and deaths across U.S. counties and states (2020-2023).