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)
)1.10.1
- –Several typos were found and fixed (#1448). 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 (#1445).
This is 1.10.0. At last! The project has added 25 new contributors since 1.9.0, for a total of 73.
- –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. This, and the previously mentioned constants, were not meant to be used by projects downstream.
This is the first release candidate for 1.10.0.
- –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
luigi
Build complex batch pipelines with dependency management.
ClickHouse
Column-oriented database for real-time analytics with SQL support and distributed computing capabilities.
pandas
Labeled data structures for tabular data analysis.
flyway
Version-controlled SQL migrations with automated execution tracking.
dbt-core
SQL-based transformation framework for analytics data warehouses.