Numberedheadings | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Working with
| ||||||||||||||||||||||||||
Vector Data in QGISVector data provides a way to represent real world features within the GIS environment. A feature is anything you can see on the landscape. QGIS can open over 60 file-based data formats (using the OGR library), including ESRI shapefile and MapInfo TAB. It can also connect to spatial database sources including PostgreSQL, SpatiaLite, Oracle, and MSSQL), to Web Feature Service (WFS) and Point Cloud data, and to Arc REST services. QGIS’s default file format is GeoPackage, a file-based database. Most QGIS functionality is available for all vector data sources, though some formats are read-only mode and need to be saved to another format for editing. GeoPackageGeoPackage is an OGC standard data format. It has a .gpkg file extension, and it can hold one or many layers, including non-spatial and raster data, and can also store QGIS projects. Load GeoPackage
ESRI ShapefileShapefile is a widely-used legacy format , developed by ESRI, used on many download sites. Shapefiles comprise four or more individual files on disk - all must be available for the file to open. Load Shapefile
MapInfoQGIS can open both MIF and TAB files - these will appear in the browser with other file-based data. Note that MapInfo files can contain multiple geometry types, so QGIS may present a dialog with a choice of geometry types - i.e. line, polygon, point - to load. Load MapInfo
ExcelQGIS will open an Excel file as vector data, and will normally recognise data types (for example string, integer, date). If the data includes coordinates, creating there is an extra step you need to create a geometry column which QGIS can use to represent the data spatially requires an extra step.. Load Excel
Database LayersTo loading database load vector layers from a database, you first need to establish a database connection. The process is similar for all databases, but in this example we will use data in a PostgreSQL database.
Web Feature Service (WFS) LayersData available in OGC Web Feature Service (WFS) format can be loaded in QGIS and used in a similar way to any other vector layer, as long as you have an Internet connection is required, although the data can be saved locally once you are connected. As with database layers, So first of all you need to create a connection. Load WFS
Attribute TableAttribute tables hold the data which sits behind every layer - you can browse the attribute data for each layer by right-clicking on the layer and selecting Open Attribute Table, (or click the icon in the toolbar). Manage the Layer ListNormally, layers at the top of the list in the Layers panel appear on the map in front of layers further down the list. You can change the order of layers in the list by dragging and dropping layers to a new position. Group LayersLayers can be grouped to create a hierarchical layer list, or table of contents. Click the Add Group button at the top of the Layers panelRight-click and Rename the new group Drag and drop layers into the group Remove LayersTo remove a layer from the list, select the layer, then Right-click > Remove. This does not delete the data, just removes it from the map. However you will lose any styling or queries you have applied to the layer. Joining Layers. Open Attribute Tables
Join Layer to Non-Spatial dataIf you want to use data in your map which has no spatial references in the map, you will need to join this to a corresponding spatial dataset. For In this example, you might have population we have Index of Multiple Deprivation (IMD) data for census areas (LLSOAs), and a polygon layer of the census areas themselves, and you want to LLSOAs themselves - we will join the two in order to show the population IMD figures for each areas as a label. Add the non-spatial data table, and the spatial layer you are joining it to, as described earlier The new table will appear in the Layers panel, but not on the map Double-click the spatial layer to bring up the Properties dialog, and select the Joins tab In the Add Vector Join dialog, use the dropdowns to specify: Join layer: the layer you want to join to the current one Join field: the field in the target layer (the one you are joining to) that is going to be used for the join (this might be ID, for example, or name, or in the case below, neighbourhood) Click OK and OK again, then check the attribute table of the spatial layer - it will have an expanded number of columns to include the data from the non-spatial table Join definitionThe join definitionJoin Layers
The join you have just created is saved in memory, and is saved in the QGIS project - it does not affect the source data . It will therefore reflect, but it will be updated with the current data each time the project is loaded. You can edit the join after it has been created - for example to exclude fields from the joined data - in the same dialog you used to create it.Exporting Vector DataTo export a layer or part of a layer: RightExporting Vector DataAny of the vector formats you have been using can be exported into most other formats, including CSV and GeoPackage. Export Data
Exporting a joined layer
Note that If you export a layer with a join, the exported data will include the fields in the join - this is a way of creating a permanent new dataset from a joined layer, although from this point on it won’t be updated if the source layers change. |
Page Comparison
Manage space
Manage content
Integrations