freshcrate
Home > Databases > fiona

fiona

Fiona reads and writes spatial data files

Description

===== Fiona ===== .. image:: https://github.com/Toblerity/Fiona/actions/workflows/tests.yml/badge.svg :target: https://github.com/Toblerity/Fiona/actions/workflows/tests.yml .. image:: https://github.com/Toblerity/Fiona/actions/workflows/test_gdal_latest.yml/badge.svg :target: https://github.com/Toblerity/Fiona/actions/workflows/test_gdal_latest.yml .. image:: https://img.shields.io/pypi/v/fiona :target: https://pypi.org/project/fiona/ .. image:: https://api.securityscorecards.dev/projects/github.com/Toblerity/Fiona/badge :target: https://securityscorecards.dev/viewer/?uri=github.com/Toblerity/Fiona Fiona streams simple feature data to and from GIS formats like GeoPackage and Shapefile. Fiona can read and write real-world data using multi-layered GIS formats, zipped and in-memory virtual file systems, from files on your hard drive or in cloud storage. This project includes Python modules and a command line interface (CLI). Fiona depends on `GDAL <https://gdal.org>`__ but is different from GDAL's own `bindings <https://gdal.org/api/python_bindings.html>`__. Fiona is designed to be highly productive and to make it easy to write code which is easy to read. Installation ============ Fiona has several `extension modules <https://docs.python.org/3/extending/extending.html>`__ which link against libgdal. This complicates installation. Binary distributions (wheels) containing libgdal and its own dependencies are available from the Python Package Index and can be installed using pip. .. code-block:: console pip install fiona These wheels are mainly intended to make installation easy for simple applications, not so much for production. They are not tested for compatibility with all other binary wheels, conda packages, or QGIS, and omit many of GDAL's optional format drivers. If you need, for example, GML support you will need to build and install Fiona from a source distribution. It is possible to install Fiona from source using pip (version >= 22.3) and the `--no-binary` option. A specific GDAL installation can be selected by setting the GDAL_CONFIG environment variable. .. code-block:: console pip install -U pip pip install --no-binary fiona fiona Many users find Anaconda and conda-forge a good way to install Fiona and get access to more optional format drivers (like GML). Fiona 1.10 requires Python 3.8 or higher and GDAL 3.4 or higher. Python Usage ============ Features are read from and written to file-like ``Collection`` objects returned from the ``fiona.open()`` function. Features are data classes modeled on the GeoJSON format. They don't have any spatial methods of their own, so if you want to transform them you will need Shapely or something like it. Here is an example of using Fiona to read some features from one data file, change their geometry attributes using Shapely, and write them to a new data file. .. code-block:: python import fiona from fiona import Feature, Geometry from shapely.geometry import mapping, shape # Open a file for reading. We'll call this the source. with fiona.open( "zip+https://github.com/Toblerity/Fiona/files/11151652/coutwildrnp.zip" ) as src: # The file we'll write to must be initialized with a coordinate # system, a format driver name, and a record schema. We can get # initial values from the open source's profile property and then # modify them as we need. profile = src.profile profile["schema"]["geometry"] = "Point" profile["driver"] = "GPKG" # Open an output file, using the same format driver and coordinate # reference system as the source. The profile mapping fills in the # keyword parameters of fiona.open. with fiona.open("centroids.gpkg", "w", **profile) as dst: # Process only the feature records intersecting a box. for feat in src.filter(bbox=(-107.0, 37.0, -105.0, 39.0)): # Get the feature's centroid. centroid_shp = shape(feat.geometry).centroid new_geom = Geometry.from_dict(centroid_shp) # Write the feature out. dst.write( Feature(geometry=new_geom, properties=f.properties) ) # The destination's contents are flushed to disk and the file is # closed when its with block ends. This effectively # executes ``dst.flush(); dst.close()``. CLI Usage ========= Fiona's command line interface, named "fio", is documented at `docs/cli.rst <https://github.com/Toblerity/Fiona/blob/main/docs/cli.rst>`__. The CLI has a number of different commands. Its ``fio cat`` command streams GeoJSON features from any dataset. .. code-block:: console $ fio cat --compact tests/data/coutwildrnp.shp | jq -c '.' {"geometry":{"coordinates":[[[-111.73527526855469,41.995094299316406],...]]}} ... Documentation ============= For more details about this project, pleas

Release History

VersionChangesUrgencyDate
1.10.1Imported from PyPI (1.10.1)Low4/21/2026
1.10.0This is 1.10.0. At last! The project has added 25 new contributors since 1.9.0, for a total of 73. Fiona 1.10 will continue to support classic GIS programming work with a record-style data model. Rows, that is, not columns. The changes since 1.9.6 are fully described in the changelog, split across pre-releases. Here is a high-level summary. ### Deprecations - Python-style filter expressions for CLI commands are being replaced by Lisp-like expressions. - Some constants in the `fiona.Low9/4/2024
1.10.0rc1This is the first release candidate for 1.10.0. ### Changes - Mutable item access to Feature, Geometry, and Properties instances has been restored (reported in #1430). This usage should be avoided as instances of these classes will be immutable in a future version. - The setup.cfg duplicates project configuration in pyproject.toml and has been removed. ### Packaging - PyPI wheels include GDAL 3.9.2. Please see the CHANGES file for a more detailed enumeration of changes since versLow8/22/2024
1.10b3### Bug fixes - The sketchy, semi-private Python opener interfaces of version 1.10b2 have been replaced by ABCs that are exported from fiona.abc (#1415). How to implement the interfaces and provide a custom opener is documented in `test_pyopener.py` and will be included in the documentation for version 1.10.0. - The truncate GDAL VSI plugin callback has been implemented (#1413). Please see the CHANGES file for a more detailed enumeration of changes since version 1.9.6. Unless showstopper Low7/30/2024
1.10b2This is the second beta release for Fiona 1.10. There are no new features, only bug fixes: ### Bug fixes - The Pyopener registry and VSI plugin have been rewritten to avoid filename conflicts and to be compatible with multithreading. Now, a new plugin handler is registered for each instance of using an opener (#1408). Before GDAL 3.9.0 plugin handlers cannot not be removed and so it may be observed that the size of the Pyopener registry grows during the execution of a program. - A CSLConsLow7/11/2024
1.10b1This is the first beta release for Fiona 1.10. There are no new features, only one bug fix: - Fiona can again set fields with values that are instances of classes derived from date, time, and datetime (#1377). This was broken by changes in 1.10a2. Please see the CHANGES file for a more detailed enumeration of changes since version 1.9.6. Unless showstopper bugs are found in this release, expect a release candidate in two weeks.Low4/16/2024
1.10a2This is the second 1.10 pre-release. The changes since 1.10a1 are enumerated below. ### Deprecations - The FIELD_TYPES, FIELD_TYPES_MAP, and FIELD_TYPES_MAP_REV attributes of fiona.schema are no longer used by the project and will be removed in version 2.0 (#1366). - The Python style of rio-filter expressions introduced in version 1.0 are deprecated. Only the parenthesized list type of expression will be supported by version 2.0. ### New features - All supported Fiona field types arLow4/5/2024
1.9.6This is very likely the last 1.9.x release and fixes several bugs that can't wait until 1.10.0. ### Bug fixes - Ensure that geometry types in a schema are translated to a linear type, as geometry instances are (#1313). - Fix broken stable API documentation on Read The Docs. - Remove install requirement of setuptools, a regression introduced in 1.9.5.Low3/8/2024
1.10a1This is the first 1.10 pre-release. ### Python version Fiona 1.10 will require Python version 3.8 or higher. ### Deprecations The fiona.path module will be removed in version 2.0 and a deprecation warning is issued when the module is imported (#1334). Additionally, members of that module are no longer exported from the top level module. ### New features Python openers can now support discovery of auxiliary "sidecar" files like .aux.xml, .msk, and .tfw files for GeoTIFFs (#1331)Low3/3/2024
1.9.5### Bug fixes - Expand keys in schema mismatch exception, resolving #1278. - Preserve the null properties and geometry of a Feature when serializing (#1276). ### Packaging * The distribution name is now officially "fiona", not "Fiona". The import name remains `fiona`. * Builds now require Cython >= 3.0.2 (#1276). * PyPI wheels include GDAL 3.6.4, PROJ 9.0.1, and GEOS 3.11.2. * PyPI wheels include curl 8.4.0, addressing CVE-2023-38545 and CVE-38546. * PyPI wheels are now available fLow10/12/2023
1.9.4.post1Extraneous files were unintentionally packaged in the 1.9.4 wheels. This post1 release excludes them so that wheel contents are as in version 1.9.3.Low5/23/2023
1.9.4Version 1.9.4 has important bug fixes and improvements and, in the PyPI wheels, updates GDAL to 3.6.4. - The performance of Feature.from_dict() has been improved (#1267). - Several sources of meaningless log messages from fiona._geometry about NULL geometries are avoided (#1264). - The Parquet driver has been added to the list of supported drivers and will be available if your system's GDAL library links libarrow. Note that fiona wheels on PyPI do not include libarrow as it is rather large.Low5/17/2023
1.9.3Version 1.9.3 has a handful of important bug fixes and, in the PyPI wheels, upgrades GEOS to 3.11.2. - Rasterio CRS objects are compatible with the Collection constructor and are now accepted (#1248). - Append mode for fio-load has been enabled (#1237). - Reading a GeoJSON with an empty array property can result in a segmentation fault since version 1.9.0. This has been fixed (#1228).Low4/10/2023
1.9.2Version 1.9.2 has a handful of important bug fixes. - The fio CLI now gets its command entry points using importlib.metadata (#1220). The project has no more runtime dependency on setuptools. - Instead of warning, transform_geom() raises an exception when some points can't be reprojected unless the caller opts in to partial reprojection. This restores the behavior of version 1.8.22. - Add support for open options to all CLI commands that call fiona.open (#1215). - Fix a memory leak that caLow3/21/2023
1.9.1The 1.9.0 release revealed a few bugs. Here are the ones we felt should be squished immediately. - Log a warning message when identically named fields are encountered (#1201). - Avoid dependence on listdir order in tests (#1193). - Prevent empty geometries arrays from appearing in `__geo_interface__` (#1197). - setuptools added to pyproject.toml. Its pkg_resources module is used by the CLI (#1191). Wheels on PyPI include the same versions of GEOS, GDAL, and PROJ as in 1.9.0 but also patLow2/10/2023
1.9.0This is 1.9.0. The GitHub release notes have been clobbered accidentally. We'll try to restore them if/when we can. Low1/30/2023
1.9b21.9b2 (2023-01-22) ------------------ The second 1.9 beta release is ready for early testing. All of the features planned for 1.9.0 are in this release. The binary wheels on PyPI include GDAL 3.5.3, GEOS 3.11.1, and PROJ 9.0.1. To try the wheels, run pip install --pre fiona. #### Changes - Add `Feature.__geo_interface__ property` (#1181). - Invalid creation options are filtered and ignored (#1180). - The readme doc has been shortened and freshened up, with a modern example for versiLow1/23/2023
1.9b1The first 1.9 beta release is ready for early testing. All of the features planned for 1.9.0 are in this release. The binary wheels on PyPI include GDAL 3.5.3, GEOS 3.11.1, and PROJ 9.0.1. To try the wheels, run `pip install --pre fiona`. #### New features * Add listdir and listlayers method to io.MemoryFile (resolving #754). * Add support for TIN and triangle geometries (#1163). * Add an allow_unsupported_drivers option to fiona.open() (#1126). * Added support for the OGR StringListLow12/13/2022
1.9a3Builds now require Cython >= 0.29.29 because of https://github.com/cython/cython/issues/4609 (see https://github.com/Toblerity/Fiona/issues/1143). Wheels include GDAL 3.5.2, PROJ 9.0.1, and GEOS 3.11.0 and are available for Python versions 3.7-3.11.Low10/18/2022
1.8.22Builds now require Cython >= 0.29.29 because of https://github.com/cython/cython/issues/4609 (see #1143). Wheels include GDAL 3.4.3, PROJ 8.2.1, and GEOS 3.10.2.Low10/14/2022
1.9a2The second 1.9 pre-release is ready for early testing. Not all of the features planned for 1.9.0 are in this release, and some of the features here may yet be modified. Please pay close attention to the deprecations and packaging changes. The binary wheels on PyPI include GDAL 3.5.0 and PROJ 9.0.0, the latest versions of each. To try the wheels, run `pip install --pre fiona`. Deprecations: - Fiona's API methods will accept feature and geometry dicts in 1.9.0, but this usage is deprecateLow6/10/2022
1.9a1The first 1.9 pre-release is ready for early testing. Not all of the features planned for 1.9.0 are in this release, and some of the features here may yet be modified. Please pay close attention to the deprecations and packaging changes. The binary wheels on PyPI include GDAL 3.5.0 and PROJ 9.0.0, the latest versions of each. Deprecations: - The fiona.drivers() function has been deprecated and will be removed in version 2.0. It should be replaced by fiona.Env(). - The new fiona.meta moLow5/19/2022
1.8.21Changes: - Driver mode support tests have been made more general and less susceptible to driver quirks involving feature fields and coordinate values (#1060). - OSError is raised on attempts to open a dataset in a Python file object in "a" mode (see #1027). - Upgrade attrs, cython, etc to open up Python 3.10 support (#1049). Bug fixes: - Allow FieldSkipLogFilter to handle exception messages as well as strings (reported in #1035). - Clean up VSI files left by MemoryFileBase, resolvingLow2/7/2022
1.8.13.post1This release is being made to improve binary wheel compatibility with shapely 1.7.0. There have been no changes to the fiona package code since 1.8.13.Low2/22/2020
1.8.0Fiona 1.8.0 is on PyPI today. Congratulations to all 46 developers (see the credits) file and many thanks to everyone who took the time to report a bug or test a new feature. Much of the motivation for this version has been provided by the GeoPandas project. Working with Joris Van den Bossche et al. on various issues has been a pleasure. There are no known breaking changes in 1.8.0. Python warnings should be expected in several cases of class and method deprecation. - The `fiona.driversLow10/31/2018

Dependencies & License Audit

Loading dependencies...

Similar Packages

pineconePinecone client and SDK8.1.2
qdrant-clientClient library for the Qdrant vector search engine1.17.1
pydeckWidget for deck.gl maps0.9.2
azure-storage-blobMicrosoft Azure Blob Storage Client Library for Pythonazure-template_0.1.0b6187637
azure-storage-file-shareMicrosoft Azure Azure File Share Storage Client Library for Pythonazure-template_0.1.0b6187637