Export Features
Export layers (filtered or unfiltered) to various formats using the EXPORTING tab.
Overviewβ
The EXPORTING tab allows you to export layers from your QGIS project to standalone datasets for:
- Sharing with colleagues or clients
- Analysis in other software
- Archiving snapshots of data
- Publishing web maps
- Reporting tabular data
Key Features:
- Multi-selection of layers to export
- Multiple output formats (GPKG, Shapefile, GeoJSON, etc.)
- CRS transformation (re-projection)
- Style export (QML, SLD, ArcGIS)
- Batch mode (separate files per layer)
- ZIP compression for delivery
Layers can be exported with or without filters applied. If you've used the FILTERING tab to create filtered subsets, those filters are preserved during export. To export unfiltered data, remove filters first in the FILTERING tab.
EXPORTING Tab Componentsβ
Layer Selectionβ
Select which layers to export from your QGIS project:
Check one or more layers to export
Features:
- Multi-selection: Export multiple layers at once
- Geometry indicators: Visual icons for point/line/polygon layers
- Feature count: Shows current feature count (respects active filters)
- Backend info: Displays data source (PostgreSQLβ‘, Spatialite, OGR)
Format Selectionβ
Choose the output format for exported data:
Dropdown with available export formats
Supported Formatsβ
| Format | Type | Best For | Max Size | Extension |
|---|---|---|---|---|
| GeoPackage | Vector | General use, large datasets | Unlimited | .gpkg |
| Shapefile | Vector | Legacy compatibility | 2 GB | .shp |
| GeoJSON | Vector | Web mapping, APIs | ~500 MB | .geojson |
| KML/KMZ | Vector | Google Earth, mobile | ~100 MB | .kml, .kmz |
| CSV | Tabular | Spreadsheets, coordinates only | Unlimited | .csv |
| PostGIS | Database | Large datasets, enterprise | Unlimited | (database) |
| Spatialite | Database | Medium datasets, portable | ~140 TB | .sqlite |
CRS Transformationβ
Re-project layers during export to a different coordinate system:
QgsProjectionSelectionWidget for CRS selection
Features:
- Choose any EPSG code or custom CRS
- Common CRS presets (WGS84, Web Mercator, local projections)
- On-the-fly reprojection during export
- Preserves original layer (no modification)
Common CRS Transformations:
Original β Export CRS | Use Case
-------------------------|----------------------------------
EPSG:4326 β EPSG:3857 | Web mapping (Leaflet, OpenLayers)
Local β EPSG:4326 | GPS compatibility
EPSG:4326 β UTM zone | Accurate distance measurements
Various β Single CRS | Harmonize multi-source data
Style Exportβ
Export layer styling alongside data:
--> Choose style format: QML (QGIS), SLD (Standard), or ArcGIS
Available Formats:
- QML (QGIS Style) - Full QGIS styling, preserves all features
- SLD (Styled Layer Descriptor) - OGC standard, works in GeoServer, MapServer
- ArcGIS - ArcGIS-compatible styling for Esri software
Style Export Behavior:
Format | Includes | Compatible With
-----------|----------------------------|---------------------------
QML | Full QGIS style tree | QGIS only
SLD | Basic symbology + labels | GeoServer, MapServer, QGIS
ArcGIS | Esri symbology | ArcGIS Desktop, ArcGIS Pro
Output Optionsβ
Configure destination and delivery mode:
QgsFileWidget for folder selection
Checkboxes for Batch mode and ZIP compression
Options:
- Output Folder: Choose destination directory
- Batch Mode: Export each layer to a separate file (vs single file for all)
- ZIP Compression: Automatically compress output for delivery
Batch Mode Comparison:
Normal Mode:
output_folder/
βββ export.gpkg (contains all layers)
Batch Mode:
output_folder/
βββ layer1.gpkg
βββ layer2.gpkg
βββ layer3.gpkg
Batch + ZIP:
output_folder/
βββ export_2024-12-09.zip
βββ layer1.gpkg
βββ layer2.gpkg
βββ layer3.gpkg
Export Workflowβ
Complete export process from EXPORTING tab:
Step-by-Step Example: Export After Filteringβ
Scenario: Export buildings within 200m of roads (from FILTERING tab) to GeoPackage
--> 1. FILTERING tab: Filter applied, 3,847 buildings found
--> 2. Switch to EXPORTING tab
--> 3. Select "buildings" layer to export (filtered subset will be exported)
--> 4. Configure: Format=GPKG, CRS=EPSG:3857 (Web Mercator), Styles=QML
All indicators active:
- Has Layers to Export β
- Has Datatype (GPKG) β
- Has Projection (EPSG:3857) β
- Has Styles (QML) β
--> 5. Select output folder + filename
--> 6. Click EXPORT button β Progress bar shows processing
-->
7. Success notification with output path: C:/exports/buildings_filtered.gpkg (3,847 features, 2.3 MB)
Result:
- File created:
buildings_filtered.gpkg - Style file:
buildings_filtered.qml(in same folder) - CRS: EPSG:3857 (reprojected from original EPSG:4326)
- Features: 3,847 (filtered subset only)
Format Detailsβ
GeoPackage (.gpkg)β
Recommended format for most use cases.
Advantages:
- β Single file (portable)
- β Unlimited size
- β Multiple layers per file
- β Spatial indexes built-in
- β Open standard (OGC)
- β Fast performance
- β Supports all geometry types
Limitations:
- β οΈ Requires GDAL 2.0+ (standard in modern QGIS)
When to Use:
- Default choice for most exports
- Large datasets (>100k features)
- Multi-layer exports
- Long-term archiving
Export Example:
output_file = "/path/to/export.gpkg"
layer_name = "filtered_features"
# Single file, multiple layers possible
Shapefile (.shp)β
Legacy format for backward compatibility.
Advantages:
- β Universal compatibility
- β Widely supported
- β Simple structure
Limitations:
- β 2 GB file size limit
- β 10-character field name limit
- β Limited data types
- β Multiple files (.shp, .dbf, .shx, .prj)
- β No mixed geometry types
- β οΈ Encoding issues (non-ASCII characters)
When to Use:
- Required by legacy software
- Sharing with ArcGIS Desktop 9.x users
- Simple, small datasets
Recommendations:
- Use GeoPackage instead when possible
- Keep feature count < 100k
- Avoid long field names
- Test encoding with non-ASCII characters
Export Example:
output_file = "/path/to/export.shp"
# Creates .shp, .dbf, .shx, .prj files
GeoJSON (.geojson)β
Text-based format for web applications.
Advantages:
- β Human-readable
- β Web-friendly
- β JavaScript native
- β API integration
- β Version control friendly
Limitations:
- β οΈ Large file sizes (text format)
- β οΈ Slower performance than binary formats
- β οΈ No spatial indexes
- β οΈ WGS84 (EPSG:4326) recommended
When to Use:
- Web mapping (Leaflet, Mapbox)
- REST APIs
- Small to medium datasets (<10k features)
- Git version control
Export Example:
output_file = "/path/to/export.geojson"
crs = "EPSG:4326" # WGS84 recommended for web
KML/KMZ (.kml, .kmz)β
Format for Google Earth and mobile apps.
Advantages:
- β Google Earth compatibility
- β KMZ includes styling and images
- β Mobile app support
- β Human-readable (KML)
Limitations:
- β Limited attribute support
- β Styling complexity
- β οΈ Performance issues with large datasets
- β οΈ WGS84 only (EPSG:4326)
When to Use:
- Google Earth visualization
- Mobile field apps
- Stakeholder presentations
- Public engagement
Export Example:
output_file = "/path/to/export.kmz" # Compressed
# or
output_file = "/path/to/export.kml" # Text
CSV (.csv)β
Tabular format for coordinates and attributes.
Advantages:
- β Universal spreadsheet compatibility
- β Small file size
- β Easy to edit
- β Database import friendly
Limitations:
- β No geometry (only X,Y coordinates for points)
- β No spatial reference
- β No styling
- β οΈ Points only (no lines/polygons)
When to Use:
- Point coordinates only
- Excel/spreadsheet analysis
- Attribute-only reports
- Database imports
Export Example:
output_file = "/path/to/export.csv"
# Includes X, Y columns for point geometry
# GEOMETRY_AS: 'AS_XY' or 'AS_WKT'
PostGIS (PostgreSQL)β
Export to PostgreSQL database with PostGIS extension.
Advantages:
- β Best performance
- β Unlimited size
- β Multi-user access
- β Spatial indexes
- β Advanced querying
- β Enterprise features
Limitations:
- β οΈ Requires PostgreSQL + PostGIS
- β οΈ Network setup needed
- β οΈ More complex administration
When to Use:
- Enterprise environments
- Large datasets (>1M features)
- Multi-user collaboration
- Continuous updates
- Integration with backend systems
Export Example:
connection = "postgresql://user:password@host:5432/database"
schema = "public"
table_name = "filtered_features"
Spatialite (.sqlite)β
Lightweight database file.
Advantages:
- β Single file
- β Spatial indexes
- β SQL queries
- β Good performance
- β No server needed
Limitations:
- β οΈ Slower than PostGIS
- β οΈ Single-writer limitation
- β οΈ 140 TB theoretical max
When to Use:
- Portable databases
- Medium datasets (10k-1M features)
- Offline work
- Desktop applications
Export Example:
output_file = "/path/to/export.sqlite"
table_name = "filtered_features"
Export Optionsβ
Coordinate Reference System (CRS)β
Choose the target CRS for your export:
# Keep original CRS
crs = layer.crs()
# Transform to WGS84 (web/GPS)
crs = "EPSG:4326"
# Transform to local projection
crs = "EPSG:32633" # UTM Zone 33N
Common CRS Choices:
- EPSG:4326 (WGS84) - Web maps, GPS, global
- EPSG:3857 (Web Mercator) - Web tiles
- EPSG:32xxx (UTM) - Local projected, metric
- Original CRS - Maintain source projection
Field Selectionβ
Export specific fields or all attributes:
# All fields
export_fields = None
# Selected fields only
export_fields = ['name', 'population', 'area', 'date']
# Exclude fields
exclude_fields = ['internal_id', 'temp_field']
Geometry Typeβ
Control geometry export:
# Keep geometry (default)
geometry = True
# Attribute-only (no geometry)
geometry = False
# Simplify geometry (reduce size)
geometry = "simplified"
simplify_tolerance = 10 # meters
Encodingβ
Character encoding for text fields:
# UTF-8 (recommended, default)
encoding = "UTF-8"
# Latin-1 (Western Europe)
encoding = "ISO-8859-1"
# Windows-1252 (Windows default)
encoding = "CP1252"
Export Strategiesβ
Large Dataset Exportβ
For datasets > 100k features:
Recommendations:
- Use GeoPackage or PostGIS - Binary formats
- Enable spatial indexes - Faster subsequent access
- Batch processing - Export in chunks if needed
- Simplify geometry - Reduce vertex count if appropriate
Multi-Format Exportβ
Export the same data to multiple formats:
# Export workflow
filter_applied = True
# Web version (GeoJSON)
export_geojson(crs="EPSG:4326", simplified=True)
# Desktop version (GeoPackage)
export_geopackage(crs=original_crs, full_precision=True)
# Spreadsheet version (CSV)
export_csv(coordinates="XY", attributes_only=False)
Incremental Exportsβ
Export changes since last update:
# Filter by date
filter_expression = "last_modified >= '2024-01-01'"
# Export with timestamp
output_file = f"updates_{datetime.now().strftime('%Y%m%d')}.gpkg"
Practical Examplesβ
Urban Planning Exportβ
# Export filtered parcels for review
filter_expression = """
zone = 'commercial'
AND area > 5000
AND status = 'proposed'
"""
# Multiple formats for different stakeholders
export_geopackage("parcels_review.gpkg") # GIS team
export_kml("parcels_review.kmz") # Public presentation
export_csv("parcels_list.csv") # Planning board
Environmental Monitoringβ
# Export monitoring sites with recent data
filter_expression = """
site_type = 'water_quality'
AND last_sample >= now() - interval '30 days'
AND parameter_count > 5
"""
# GeoJSON for web dashboard
export_geojson(
output="monitoring_sites.geojson",
crs="EPSG:4326",
fields=['site_id', 'last_sample', 'status']
)
Emergency Responseβ
# Export evacuation zones
filter_expression = """
intersects(
$geometry,
buffer(geometry(get_feature('hazard', 'status', 'active')), 2000)
)
AND occupancy > 0
"""
# KML for field teams
export_kml("evacuation_zones.kmz")
# GeoPackage for GIS analysis
export_geopackage("evacuation_analysis.gpkg")
Performance Optimizationβ
Backend Comparisonβ
| Backend | Export Speed | Recommended |
|---|---|---|
| PostgreSQL | β‘β‘β‘β‘ Fastest | GeoPackage, PostGIS |
| Spatialite | β‘β‘β‘ Fast | GeoPackage, Spatialite |
| OGR | β‘β‘ Moderate | GeoPackage |
Optimization Tipsβ
-
Simplify Geometry
# Reduce vertex count
simplify_tolerance = 10 # meters -
Select Necessary Fields
# Export only needed attributes
fields = ['id', 'name', 'status'] -
Use Appropriate Format
# Binary formats faster than text
GeoPackage > Shapefile > GeoJSON -
Enable Spatial Indexes
# For GeoPackage/Spatialite
create_spatial_index = True
Troubleshootingβ
Export Failsβ
Common Issues:
-
File Locked
- Close applications using the file
- Check file permissions
-
Disk Space
- Verify available space
- Use compression (KMZ, GPKG)
-
Invalid Geometries
-- Filter invalid geometries before export
is_valid($geometry) -
Encoding Issues
- Use UTF-8 encoding
- Test with sample features
Large File Sizeβ
Solutions:
-
Simplify geometry
simplify_tolerance = 10 # Reduce precision -
Reduce attributes
fields = ['essential_field_1', 'essential_field_2'] -
Use compression
# KMZ instead of KML
# GPKG has internal compression -
Split into tiles
# Export by region or grid
filter_expression = "region = 'north'"
Projection Issuesβ
Solutions:
-
Verify source CRS
source_crs = layer.crs()
print(f"Source: {source_crs.authid()}") -
Transform explicitly
target_crs = "EPSG:4326" -
Check transformation accuracy
# Use appropriate transformation
# Especially for historic datums
Batch Export Examplesβ
Multiple Filtered Layersβ
Export several layers with different configurations:
Scenario: Export 3 layers with different filters, formats, and CRS
Step 1 - Filter Layers (in FILTERING tab):
Layer 1 (parcels): zone = 'commercial'
Layer 2 (buildings): year_built > 2020
Layer 3 (roads): road_class = 'highway'
Step 2 - Configure Batch Export (in EXPORTING tab):
EXPORTING Tab Configuration:
- Layers selected: parcels, buildings, roads (all 3)
- Format: GeoPackage
- CRS: EPSG:3857 (Web Mercator)
- Styles: QML
- Output folder: C:/exports/
- Batch mode: ENABLED
- ZIP: ENABLED
Result:
C:/exports/export_2024-12-09.zip
βββ parcels.gpkg (commercial zones, filtered)
βββ parcels.qml
βββ buildings.gpkg (recent buildings, filtered)
βββ buildings.qml
βββ roads.gpkg (highways, filtered)
βββ roads.qml
Benefits:
- Single operation exports all layers
- Each layer in separate file (batch mode)
- All reprojected to Web Mercator
- Styles preserved
- Compressed for delivery
Exporting Unfiltered Dataβ
To export complete layers (without filters):
Option 1 - Remove Filters First (FILTERING tab):
- Switch to FILTERING tab
- Click RESET button to clear all filters
- Switch to EXPORTING tab
- Export as usual
Option 2 - Export Different Layers:
- Simply select layers that don't have filters applied
- EXPORTING tab exports current layer state
- With filters: EXPORTING tab exports only features matching current filters
- Without filters: Exports complete layer (all features)
- Check feature count in layer selector to verify what will be exported
Related Topicsβ
- Filtering Basics - Create filters to export filtered subsets (FILTERING tab)
- Geometric Filtering - Apply spatial filters before export
- Buffer Operations - Proximity-based filtering before export
- Interface Overview - Complete EXPORTING tab component guide
- FILTERING tab: Create filtered subsets (optional)
- EXPLORING tab: Visualize and verify features (optional)
- EXPORTING tab: Export to various formats (filtered or unfiltered)
All three tabs work together to provide complete data processing workflow.
Next Stepsβ
- Filter History - Reuse filter configurations for exports
- Interface Overview - Learn about all three main tabs