` `
As part of an Open Source Software ecosystem, QGIS is built upon different libraries that, combined with its own providers, offer capabilities to read and often write a lot of formats:
As of the date of this document, more than 80 vector and 140 raster formats are supported by the GDAL/OGR and QGIS native providers.
Note
Not all of the listed formats may work in QGIS for various reasons. For example, some require external proprietary libraries, or the GDAL/OGR installation of your OS may not have been built to support the format you want to use. To have a list of available formats, run the command line ogrinfo --formats (for vector) or check settings ‣ Options ‣ GDAL menu (for raster) in QGIS.
QGIS Browser is one of the main panels of QGIS that lets you quickly and easily add your data to projects. It helps you navigate in your filesystem and manage geodata, regardless the type of layer (raster, vector, table), or the datasource format (plain or compressed files, database, web services).
To add a layer into a project:
Note
You can also add a layer or open a QGIS project directly from the Browser panel by double-clicking its name or by drag-and-drop into the map canvas.
Once a file is loaded, you can zoom around it using the map navigation tools. To change the style of a layer, open the Layer Properties dialog by double clicking on the layer name or by right-clicking on the name in the legend and choosing Properties from the context menu. See section Style Properties for more information on setting symbology of vector layers.
At the top of the Browser panel, you find some icons that help you to:
Right-click an item in the browser tree helps you to:
You can also import files into databases or copy tables from one schema/database to another one with a simple drag-and-drop. There is a second browser panel available to avoid long scrolling while dragging. Just select the file and drag-and-drop from one panel to the other.
Tip
Add layers to QGIS by simple drag-and-drop from your OS file browser
You can also add file(s) to the project by drag-and-dropping them from your operating system file browser to the Layers Panel or the map canvas.
The DB Manager Plugin is another one of the main and native tools to integrate and manage spatial database formats supported by QGIS (PostGIS, SpatiaLite, GeoPackage, Oracle Spatial, MSSQL, DB2, Virtual layers) in one user interface. It can be activated from the Plugins ‣ Manage and Install Plugins... menu.
The DB Manager Plugin provides several features:
More information on DB Manager capabilities are exposed in Módulo Gestor BD.
Beside Browser Panel and DB Manager, the main tools provided by QGIS to add layers regardless the format, you’ll also find tools that are specific to data providers.
Note
Some external plugins also propose tools to open specific format files in QGIS.
To load a layer from a file, you can:
for vector data (like Shapefile, Mapinfo or dxf layer), click on Add Vector Layer toolbar button, select the Layer ‣ Add Layer ‣ Add Vector Layer menu option or press Ctrl+Shift+V. This will bring up a new window (see figure_vector_add) from which you can check File and click on [Browse]. You can also specify the encoding for the file if desired.
for raster layers, click on the Add Raster Layer icon, select the Layer ‣ Add Layer ‣ Add Raster Layer menu option or type Ctrl+Shift+R.
That will bring up a standard open file dialog (see figure_vector_open), which allows you to navigate the file system and load a shapefile, a geotiff or other supported data source. The selection box Filter allows you to preselect some supported file formats. Only the formats that have been well tested appear in the list. Other untested formats can be loaded by selecting All files (*.*).
Selecting a file from the list and clicking [Open] loads it into QGIS. More than one layer can be loaded at the same time by holding down the Ctrl or Shift key and clicking on multiple items in the dialog. Figure_vector_loaded shows QGIS after loading the alaska.shp file.
Note
Because some formats like MapInfo (e.g., .tab) or Autocad (.dxf) allow mixing different types of geometry in a single file, loading such format in QGIS opens a dialog to select geometries to use in order to have one geometry per layer.
Using the Add Vector Layer tool:
You can also load specific formats like ArcInfo Binary Coverage, UK. National Transfer Format, as well as the raw TIGER format of the US Census Bureau or OpenfileGDB. To do that, you’d need to select Directory as Source type. In this case a directory can be selected in the dialog after pressing [Browse].
With the Database source type you can select an existing database connection or create one to the selected database type. Available database types are ODBC, OGDI Vectors, Esri Personal Geodatabase, MySQL as well as PostgreSQL or MSSQL.
Pressing the [New] button opens the Create a New OGR Database Connection dialog whose parameters are among the ones you can find in Creating a stored Connection. Pressing [Open] you can select from the available tables for example of the PostGIS enabled database.
The last source type, Protocol, enables to open data from the web using for example GeoJSON or CouchDB format. After selecting the type you have to fill URI of the source.
Tip
Load layers and projects from mounted external drives on macOS
On macOS, portable drives that are mounted beside the primary hard drive do not show up as expected under File ‣ Open Project. We are working on a more macOS-native open/save dialog to fix this. As a workaround, you can type /Volumes in the File name box and press Enter. Then you can navigate to external drives and network mounts.
Delimited text file (e.g. .csv, .txt) can be loaded in QGIS using the tools described above. However, loaded this way, it’ll show up like a simple table data. Sometimes, delimited text files can contain geometric data you’d want to visualize; this is what the Add Delimited Text Layer is designed for.
Click the toolbar icon Add Delimited Text Layer in the Manage layers toolbar to open the Create a Layer from a Delimited Text File dialog, as shown in figure_delimited_text.
First, select the file to import (e.g., qgis_sample_data/csv/elevp.csv) by clicking on the [Browse] button. Once the file is selected, QGIS attempts to parse the file with the most recently used delimiter. To enable QGIS to properly parse the file, it is important to select the correct delimiter. You can specify a delimiter by activating:
Once the file is parsed, set Geometry definition to Point coordinates and choose the X and Y fields from the dropdown lists. If the coordinates are defined as degrees/minutes/seconds, activate the DMS coordinates checkbox.
Finally, enter a layer name (e.g., elevp), as shown in figure_delimited_text. To add the layer to the map, click [OK]. The delimited text file now behaves as any other map layer in QGIS.
There is also a helper option that allows you to trim leading and trailing spaces from fields — Trim fields. Also, it is possible to Discard empty fields. If necessary, you can force a comma to be the decimal separator by activating Decimal separator is comma.
If spatial information is represented by WKT, activate the Well Known Text option and select the field with the WKT definition for point, line or polygon objects. If the file contains non-spatial data, activate No geometry (attribute only table) and it will be loaded as an ordinal table.
Additionally, you can enable:
DXF and DWG files can be added to QGIS by simple drag-and-drop from the common Browser Panel. You’ll be prompted to select the sublayers you’d like to add to the project. Layers are added with random style properties.
Note
DXF files containing several geometry types (point, line and/or polygon), the name of the layer will be made from <filename.dxf> entities <geometry type>.
To keep the dxf/dwg structure and its symbology in QGIS, you may want to use the dedicated Project ‣ DWG/DXF Import... tool. Indeed, the DWG/DXF Import dialog allows you to import into GeoPackage database any element of the drawing file.
In the dialog, you have to:
After the .dwg or .dxf data is imported into the GeoPackage database the frame in the lower half of the dialog is populated with the list of layers from the imported file. There you can select which layers to add to the QGIS project:
In recent years, the OpenStreetMap project has gained popularity because in many countries no free geodata such as digital road maps are available. The objective of the OSM project is to create a free editable map of the world from GPS data, aerial photography or local knowledge. To support this objective, QGIS provides support for OSM data.
Using the Browser Panel, you can load a .osm file to the map canvas, in which case you’ll get a dialog to select sublayers based on the geometry type. The loaded layers will contain all the data of that geometry type in the file and keep the osm file data structure.
To avoid working with a such complex data structure, and be able to select only features you need based on their tags, QGIS provides a core and fully integrated OpenStreetMap import tool:
Loading GPS data in QGIS can be done using the core plugin: GPS Tools. Instructions are described in Section Módulo GPS.
Working with GRASS vector data is described in Section Integração GRASS SIG.
The first time you load data from a SpatiaLite database, begin by:
This will bring up a window that will allow you either to connect to a SpatiaLite database already known to QGIS, which you can choose from the drop-down menu, or to define a new connection to a new database. To define a new connection, click on [New] and use the file browser to point to your SpatiaLite database, which is a file with a .sqlite extension.
QGIS also supports editable views in SpatiaLite.
QGIS proposes two custom formats you can load in the application using their own loading tool:
With QGIS you can have access to different types of OGC web services (WM(T)S, WFS(-T), CSW ...). Thanks to QGIS Server, you can also publish these services. Description of these capabilities and how-to are provided in chapter Trabalhando com dados OGC.