tessl install tessl/pypi-fiona@1.10.0Fiona reads and writes spatial data files
Agent Success
Agent success rate when using this tile
88%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.1x
Baseline
Agent success rate without this tile
80%
A utility for efficiently loading large collections of geographic features into GIS datasets with proper transaction handling and error recovery.
Write features to a GeoPackage dataset while leveraging automatic transaction batching for optimal performance.
Ensure that when errors occur during bulk writes, the system behaves predictably.
Write features to various GIS formats that support transaction operations.
@generates
def load_features(features, output_path, driver='GPKG', crs='EPSG:4326'):
"""
Load a list of geographic features into a GIS dataset.
Args:
features: List of feature dictionaries with 'geometry' and 'properties' keys.
Each geometry should have 'type' and 'coordinates'.
Example: {'geometry': {'type': 'Point', 'coordinates': [0, 0]},
'properties': {'name': 'Location 1'}}
output_path: Path to the output file
driver: Output format driver (default: 'GPKG' for GeoPackage)
crs: Coordinate reference system (default: 'EPSG:4326')
Returns:
Number of features successfully written
Raises:
ValueError: If features list is empty or contains invalid data
IOError: If output file cannot be created or written
"""
passProvides GIS data I/O capabilities with transaction support for efficient bulk writes.