0
# Command Line Interface
1
2
Complete command-line interface (fio) for processing geospatial data without writing Python code, including format conversion, data inspection, and spatial analysis operations.
3
4
## Main Commands
5
6
### Data Inspection
7
8
```bash
9
# Get dataset information
10
fio info data.shp
11
12
# List layers in multi-layer dataset
13
fio ls database.gpkg
14
15
# Print dataset bounds
16
fio bounds data.shp
17
18
# Print environment information
19
fio env
20
```
21
22
### Data Processing
23
24
```bash
25
# Print features as GeoJSON
26
fio cat data.shp
27
28
# Dump features to output format
29
fio dump --format GeoJSON data.shp > output.geojson
30
31
# Collect features into collections
32
fio collect input1.shp input2.shp > combined.geojson
33
34
# Load features from input
35
fio load --format Shapefile < input.geojson
36
```
37
38
### Data Management
39
40
```bash
41
# Remove datasets or layers
42
fio rm unwanted.shp
43
fio rm database.gpkg --layer temp_layer
44
45
# Interactive inspection
46
fio insp data.shp
47
```
48
49
### Advanced Operations (requires optional dependencies)
50
51
```bash
52
# Filter features with expressions
53
fio cat data.shp | fio filter "properties.population > 100000"
54
55
# Transform/map features
56
fio cat data.shp | fio map "properties.area = properties.area * 0.0001"
57
58
# Reduce features with expressions
59
fio cat data.shp | fio reduce "sum(properties.population)"
60
```
61
62
#### Usage Examples
63
64
```bash
65
# Convert shapefile to GeoJSON
66
fio cat input.shp > output.geojson
67
68
# Get basic information about a dataset
69
fio info /path/to/data.gpkg
70
# Output: driver, layer count, bounds, CRS, etc.
71
72
# List all layers in a GeoPackage
73
fio ls database.gpkg
74
# Output: layer1, layer2, layer3
75
76
# Get bounds of a dataset
77
fio bounds data.shp
78
# Output: minx miny maxx maxy
79
80
# Print features with pretty formatting
81
fio cat --precision 2 data.geojson
82
83
# Process features through pipeline
84
fio cat large_dataset.shp | \
85
fio filter "properties.category == 'urban'" | \
86
fio collect > urban_areas.geojson
87
88
# Complex data processing pipeline
89
fio cat cities.shp | \
90
fio filter "properties.population > 500000" | \
91
fio map "properties.density = properties.population / properties.area" | \
92
fio filter "properties.density > 1000" | \
93
jq '.features[] | select(.properties.country == "USA")' > dense_us_cities.geojson
94
95
# Multi-source data collection
96
fio cat source1.shp source2.geojson source3.gpkg | \
97
fio filter "properties.date >= '2020-01-01'" | \
98
fio collect --precision 6 > recent_data.geojson
99
100
# Data validation and conversion pipeline
101
fio info input.shp --count --bounds | \
102
tee validation_report.txt && \
103
fio cat input.shp | \
104
fio dump --format GeoPackage --dst-crs EPSG:3857 > converted.gpkg
105
106
# Spatial bounds-based filtering
107
BOUNDS=$(fio bounds region_of_interest.shp)
108
fio cat large_dataset.shp | \
109
fio filter "intersects(geometry, $BOUNDS)" | \
110
fio collect > filtered_by_region.geojson
111
```