CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-fiona

Fiona reads and writes spatial data files

88

1.10x
Overview
Eval results
Files

cli.mddocs/

Command Line Interface

Complete command-line interface (fio) for processing geospatial data without writing Python code, including format conversion, data inspection, and spatial analysis operations.

Main Commands

Data Inspection

# Get dataset information
fio info data.shp

# List layers in multi-layer dataset  
fio ls database.gpkg

# Print dataset bounds
fio bounds data.shp

# Print environment information
fio env

Data Processing

# Print features as GeoJSON
fio cat data.shp

# Dump features to output format
fio dump --format GeoJSON data.shp > output.geojson

# Collect features into collections
fio collect input1.shp input2.shp > combined.geojson

# Load features from input
fio load --format Shapefile < input.geojson

Data Management

# Remove datasets or layers
fio rm unwanted.shp
fio rm database.gpkg --layer temp_layer

# Interactive inspection
fio insp data.shp

Advanced Operations (requires optional dependencies)

# Filter features with expressions
fio cat data.shp | fio filter "properties.population > 100000"

# Transform/map features
fio cat data.shp | fio map "properties.area = properties.area * 0.0001"

# Reduce features with expressions  
fio cat data.shp | fio reduce "sum(properties.population)"

Usage Examples

# Convert shapefile to GeoJSON
fio cat input.shp > output.geojson

# Get basic information about a dataset
fio info /path/to/data.gpkg
# Output: driver, layer count, bounds, CRS, etc.

# List all layers in a GeoPackage
fio ls database.gpkg
# Output: layer1, layer2, layer3

# Get bounds of a dataset
fio bounds data.shp  
# Output: minx miny maxx maxy

# Print features with pretty formatting
fio cat --precision 2 data.geojson

# Process features through pipeline
fio cat large_dataset.shp | \
fio filter "properties.category == 'urban'" | \
fio collect > urban_areas.geojson

# Complex data processing pipeline
fio cat cities.shp | \
fio filter "properties.population > 500000" | \
fio map "properties.density = properties.population / properties.area" | \
fio filter "properties.density > 1000" | \
jq '.features[] | select(.properties.country == "USA")' > dense_us_cities.geojson

# Multi-source data collection
fio cat source1.shp source2.geojson source3.gpkg | \
fio filter "properties.date >= '2020-01-01'" | \
fio collect --precision 6 > recent_data.geojson

# Data validation and conversion pipeline
fio info input.shp --count --bounds | \
tee validation_report.txt && \
fio cat input.shp | \
fio dump --format GeoPackage --dst-crs EPSG:3857 > converted.gpkg

# Spatial bounds-based filtering
BOUNDS=$(fio bounds region_of_interest.shp)
fio cat large_dataset.shp | \
fio filter "intersects(geometry, $BOUNDS)" | \
fio collect > filtered_by_region.geojson

Install with Tessl CLI

npx tessl i tessl/pypi-fiona

docs

cli.md

collection-management.md

crs.md

data-model.md

environment.md

file-io.md

index.md

schema.md

transforms.md

utilities.md

tile.json