Exporting vector data from QGIS is a common task, allowing you to save layers or specific features in various formats for use in other software or projects. The primary method involves using the layer's right-click menu.
General Steps to Export a Vector Layer
To export an entire vector layer from QGIS, follow these steps:
- Navigate to the Layers Panel: Locate the vector layer you wish to export in the 'Layers' panel.
- Right-Click the Layer: Right-click on the name of the vector layer.
- Select 'Export': In the context menu that appears, hover over the 'Export' option.
- Choose 'Save Features As...': Click on 'Save Features As...'. This opens the 'Save Vector Layer as...' dialog window.
- Configure Export Settings:
- Format: Choose the desired export format from the dropdown list (e.g., ESRI Shapefile, GeoPackage, GeoJSON, KML).
- File name: Click the browse button (
...
) and specify the location and name for your output file. - CRS: Select the desired Coordinate Reference System (CRS) for the output file. By default, it might use the layer's CRS or the project's CRS.
- Encoding: Choose the appropriate text encoding.
- Geometry: Select how geometry is handled (e.g., 'automatic', 'asPolygon', 'none').
- Fields: You can choose which fields (attributes) to export or rename them.
- Confirm Export: Click 'OK' to start the export process.
Exporting Only Selected Features
Often, you might only need to export a subset of features from a layer. Based on the provided reference, selected features show up on the screen in yellow. QGIS makes it easy to export just these selected features:
- Select Features: Use any of QGIS's selection tools (e.g., 'Select Features by Area or Single Click', 'Select Features by Value') to select the features you want to export. The selected features will be highlighted, typically in yellow as noted in the reference.
- Right-Click the Layer: Right-click on the vector layer containing the selected features.
- Select 'Export': Hover over the 'Export' option.
- Choose 'Save Selected Features As...': Click on 'Save Selected Features As...'. This is the key step that tells QGIS to export only the features currently selected (highlighted yellow).
- Configure Export Settings: Just like exporting the whole layer, configure the Format, File name, CRS, Encoding, and other options in the 'Save Vector Layer as...' dialog.
- Confirm Export: Click 'OK' to save the selected features to a new file.
This method is particularly useful when working with large datasets where you only need a specific area or set of records.
Key Export Options
When exporting, pay attention to these crucial settings:
- Format: Choose a format compatible with the software or platform you'll use the data in. Shapefile (
.shp
) is very common, but GeoPackage (.gpkg
) is becoming increasingly popular due to its single-file nature and support for multiple layers and data types. - Coordinate Reference System (CRS): Ensure the output CRS is appropriate for your needs. Exporting to a standard geographic (like WGS 84) or a relevant projected CRS is essential for spatial accuracy.
- Saving Location and File Name: Choose a clear location and name for your exported file(s).
Common Vector Export Formats
QGIS supports a wide variety of export formats. Here are some frequently used ones:
Format Name | File Extension(s) | Description |
---|---|---|
ESRI Shapefile | .shp , .shx , etc. |
Very common, widely supported. Can be limited in field names and file size. |
GeoPackage (GPKG) | .gpkg |
OGC standard, single file, supports multiple layers and data types. |
GeoJSON | .geojson , .json |
Text-based format, popular for web mapping applications. |
KML, KMZ | .kml , .kmz |
Used by Google Earth and other globes/mapping software. |
SpatiaLite | .sqlite |
Geodatabase format based on SQLite. |
Comma Separated Value | .csv |
Exports attribute data, often includes X, Y coordinates. |
By following these steps, you can efficiently export your vector data or selected features from QGIS in the format and configuration you require.