4. The Browser panel

The QGIS Browser panel is a great tool for browsing, searching, inspecting, copying and loading QGIS resources. It is available as:

  • a Data Source Manager tab, enabled pressing the dataSourceManager Open Data Source Manager button (Ctrl+L);

  • as a QGIS panel you can open from the menu View ► Panels (or kde Settings ► Panels) or by pressing Ctrl+2.

../../../_images/browser_panel1.png

Fig. 4.1 The Browser panel

A second browser panel can be opened by activating the Browser (2) panel in View ► Panels. Having two browser panels can be useful when copying layers between resources that are located deep down in different branches of the browser hierarchy.

4.1. Exploring the Interface

4.1.1. The Toolbar

At the top of the Browser panel, you find some buttons that help you:

  • addLayer Add Selected Layers: you can also add data to the map canvas by selecting Add selected layer(s) from the layer’s context menu;

  • refresh Refresh the browser tree;

  • filterMap Filter Browser to search for specific data. Enter a search word or wildcard and the browser will filter the tree to only show paths to matching DB tables, filenames or folders. Using the options Options pull-down menu next to the filter text field, you can:

    • make the comparison Case Sensitive or not

    • set the Filter pattern syntax to one of:

      • Normal: show items containing the search text

      • Wildcard(s): fine tune the search using the ? and/or * characters to specify the position of the search text

      • Regular expression: use full capabilities of regular expression to find specific data.

  • collapseTree Collapse All the whole tree;

  • metadata Enable/disable properties widget: when toggled on, a new widget is added at the bottom of the panel showing, if applicable, metadata for the selected item.

    ../../../_images/browser_p_properties_w.png

    Fig. 4.2 The properties widget

4.1.2. The Entries

The main part of the Browser panel is organised as an expandable hierarchy with some fixed top-level entries that organise the resources handled by the browser. Node entries are expanded by clicking on browserExpand to the left of the entry name. A branch is collapsed by clicking on browserCollapse. The collapseTree Collapse All button collapses all top-level entries. Top level entries include:

  1. Favorites where you can place shortcuts to often used locations

  2. Spatial Bookmarks where you can store often used map extents (see Bookmarking extents on the map)

  3. Project Home: for a quick access to the folder in which (most of) the data related to your project are stored. The default value is the directory where your project file resides.

  4. Home directory in the file system and the filesystem root directory.

  5. Connected local or network drives

  6. Then comes a number of container / database types and service protocols, depending on your platform and underlying libraries:

    Table 4.1 Database and service entries in Browser panel

    Label

    References

    geoPackage GeoPackage

    Database entries, Creating a new GeoPackage layer

    spatialite SpatiaLite

    Database entries, Creating a new SpatiaLite layer, SpatiaLite Layers

    postgis PostgreSQL

    Database entries, Connecting to PostgreSQL

    hana SAP HANA

    Database entries, Connecting to SAP HANA

    stac STAC

    Tiles and Web Services, STAC (SpatioTemporal Asset Catalogs)

    mssql MS SQL Server

    Database entries, Connecting to MS SQL Server

    oracle Oracle

    Database entries, Connecting to Oracle Spatial

    wms WMS/WMTS

    Tiles and Web Services, WMS/WMTS Client

    cloud Cloud

    Tiles and Web Services, Using Cloud Connections

    tiledSceneLayer Scenes

    Tiles and Web Services, Using 3D tiled scene services

    sensor SensorThings

    Tiles and Web Services, SensorThings

    vectorTileLayer Vector Tiles

    Tiles and Web Services, Using Vector Tiles services

    xyz XYZ Tiles

    Tiles and Web Services, Using XYZ Tile services

    wcs WCS

    Tiles and Web Services, WCS Client

    wfs WFS/OGC API-Features

    Tiles and Web Services, WFS and WFS-T Client

    afs ArcGIS REST Servers

    Tiles and Web Services, Using ArcGIS REST Servers

You can customize the list of displayed items by disabling some of them in the Settings ► Interface Customization dialog. If you, for instance, would not like to show Python scripts in the browser, you can uncheck the Browser ► py entry, and if you want to get rid of your home folder in the browser, you can uncheck the Browser ► special:Home entry. Read Customization for more details.

4.2. Browser panel top-level entries

Many types of resources can be found in the Browser tree. They can be GIS layers (vector, raster, mesh, point cloud, …), QGIS project files or templates, layer styles, bookmark extents, Processing scripts and models, Python scripts, various file types (images, pdf, xml, …). The resources can be stored as plain files on disk, tables of database, or served through a web service. The Browser panel generally supports double-clicking those resources or drag-and-dropping them across entries within the browser, between the browser and the Layers panel and from the browser to the map canvas. The result of the drag and drop depends on the type of resource and its destination; it can load a layer or a project, copy a resource, execute a script or a model, …

Most of the elements in the Browser panel also have actions assigned through their contextual menu. The actions vary depending on the item you right-clicked over. Resource specific actions are listed for the different resource groups sorted under the top-level entries listed below.

4.2.1. Favorites

Often used file system locations can be tagged as favorites. The ones you have tagged will appear here.

In addition to the operations described under common folders and drives, the context menu allows you to Rename Favorite… and Remove Favorite.

4.2.2. Spatial Bookmarks

This is where you will find your spatial bookmarks, divided into Project Bookmarks and User Bookmarks.

Table 4.2 available actions for spatial bookmarks

Level

Contextual menu

Spatial Bookmarks

New Spatial Bookmark…

Show the Spatial Bookmark Manager

Import Spatial Bookmarks…

Export Spatial Bookmarks…

Bookmark group

(Project Bookmarks and User Bookmarks)

New Spatial Bookmark…

Import Spatial Bookmarks…

Export Spatial Bookmarks…

Individual bookmark

Zoom to Bookmark

Edit Spatial Bookmark…

Delete Spatial Bookmark

4.2.3. Project Home

Available once the project file has been saved, the Project home entry is a folder containing data and other contents (scripts, models, text, …) that may be used within the current project. Displayed in the Browser panel, it allows you to quickly access data and other files of the project.

It defaults to the project file folder but can be changed through the Project ► Properties… ► General ► Project home option, or by right-clicking on the Project Home item of the Browser panel and selecting Set project home…. Customizing that folder is especially useful in contexts where QGIS projects are not stored in the root folder of an organisational ‘project’, along with datasets.

4.2.4. Drives and file system

The next items of the Browser panel depend on the OS in use and concern the top level entries of its file system. They are mainly:

  • The Home folder, pointing to the current user home folder

  • on Unix-based machines, the root / folder

  • the connected drives, either local or network. Depending on the OS, they are directly listed (e.g., C:\, D:\) or through the /Volumes entry.

From the contextual menu of each of these folders or drives, you can:

  • Refresh the files and folders of the entry

  • create a New ► subitem that is a Directory…, GeoPackage…, ESRI Shapefile… or ESRI FileGeodatabase… format dataset

  • Hide from Browser: hides the selected directory or drive from the panel. The list of hidden folders can be found in Settings ► Options ► Data sources ► Hidden folders and the folders can be recovered individually. They also can be recovered from the contextual menu of their parent folder using the Hidden Items ► entry.

  • Set color…: customize the folder icon color, aiding in rapid browser navigation of complex folder structures

  • enable Scanning:

    • checkbox Monitor for changes: allows to manually control whether a particular directory should be monitored and automatically updated. This setting applies to the selected directory and all subdirectories. This means that you can manually opt-in to monitoring of network drives if you know there’s no issue, or manually opt-out of monitoring of large directories which you don’t want monitored for other reasons. By default, remote or network drives are not automatically monitored.

    • unchecked Fast scan this directory

  • Open Directory…: opens the directory in your file manager

  • Open in Terminal…: opens the directory in a terminal window

  • inspect the Properties… or the parent Directory Properties…

Note

The abovementioned contextual menu items are also available from any directory in the browser, regardless of its location.

Under the directories, interaction with files may differ depending on whether it is a QGIS project file, it is of a data format supported or not by QGIS, it is a plain file or a data container, …

4.2.4.1. Project files

Project files can be dragged and dropped from the browser to the map canvas to open the project or to a database (e.g., GeoPackage, PostgreSQL, …) for storage. Further operations can be done through their contextual menu:

  • Open project

  • Extract symbols…: opens the Style manager dialog filled with all the symbols (marker, text, label, material, 3D symbol, …). It is then possible to select items and share them with other contexts.

  • Manage ► Rename <project_file>…

  • Manage ► Delete <project_file>…

  • Show in files: Opens the folder containing the project file in the Operating System file explorer

  • File properties…

Project files stored in directories can be expanded in the Browser`panel, showing the full layer tree (including groups) within that project. Layers of a project can be loaded from the browser to the active project through double-click or drag and drop to map canvas or :guilabel:`Layers panel. They can also be dropped onto a database and imported within. Their contextual menu allows to Export Layer ► To File…, Add Layer to Project and preview Layer Properties….

4.2.4.2. Layer files

For leaf entries that can act as layers in a QGIS project, the contextual menu will present some of the following entries.

Table 4.3 Available actions for plain layer files

Level and Contextual menu

Types of layers

addRasterLayer Raster

(Reference)

addOgrLayer Vector

(Reference)

addPointCloudLayer Point clouds

(Reference)

addMeshLayer Mesh

(Reference)

Open <file type> Externally…

checkbox

checkbox

Execute SQL…

checkbox

Export Layer ► To File…

checkbox

checkbox

Add Layer to Project

checkbox

checkbox

checkbox

checkbox

Add Selected Layers to Project

checkbox

checkbox

checkbox

checkbox

Layer Properties…

checkbox

checkbox

checkbox

checkbox

Open with Data Source Manager…

checkbox

checkbox

Manage ► Rename <file_name>

checkbox

checkbox

checkbox

checkbox

Manage ► Delete <file_name>

checkbox

checkbox

checkbox

checkbox

Manage ► Delete Selected Files

checkbox

checkbox

checkbox

checkbox

Show in Files

checkbox

checkbox

checkbox

checkbox

File Properties…

checkbox

checkbox

checkbox

checkbox

Some notes about opening options:

  • Open <file type> Externally… allows to open files (HTML files, spreadsheets, images, PDFs, text files, …) with their default applications

  • Use Open with Data Source Manager… to directly open and configure the data source in the Data Source Manager using the URI of your data source. This simplifies the process of adding a layer from the Browser by allowing you to set specific opening options for the data source. It is currently available for vector (including the dedicated GeoPackage entry), raster, and SpatiaLite data sources.

4.2.4.3. Other specific supported file types

Table 4.4 Available actions for various supported files

File type

Context menu

QGIS Layer Definition (.qlr)

Export Layer ► To File…

Add Layer to Project

Layer Properties…

Processing Model (.model3)

Run Model…

Edit Model…

Print Composer Template (.qpt)

New Layout from Template

Python script (.py)

Run Script…

Open in External Editor

4.2.4.4. Properties of Browser items

For files and directories in the Browser panel, dedicated File properties… and Directory properties… tools in their contextual menu open their properties dialog using the Operating System.

For items in the Browser panel that can be used as layers in QGIS, the Layer properties… contextual menu entry opens a dialog with detailed information to better understand the dataset. These details can also be displayed automatically at the bottom of the Browser panel if the metadata Enable/disable properties widget button in its top toolbar is activated.

  • Metadata: similar to what you find in the Information tab of the layer properties dialog after you load the layer in QGIS. Metadata groups Information from provider (if possible, Path will be a hyperlink to the source), Identification, Extent, Access, Fields (for vector layers), Bands (for raster layers), Contacts, Links (for vector layers), References (for raster layers), History.

  • Preview: helps spatially visualize the data you can pan and zoom.

  • Attributes: shows the attribute table, for vector sources.

4.2.5. Database entries

Depending on your OS and installed drivers, you might have access to different database types to use in QGIS. Below are listed the different entries of contextual menu at each level of the dataset tree.

Table 4.5 Available actions for database entries

Level and Context menu

Type of database

geoPackage

GeoPackage ([1])

spatialite

SpatiaLite

postgis

PostgreSQL

hana

SAP HANA

mssql

MS SQL Server

oracle

Oracle

Top menu (provider)

Create a New Connection… to an existing database

checkbox

checkbox

checkbox

checkbox

checkbox

checkbox

Create Database…

checkbox

checkbox

Create Database and Layer…

checkbox

Save Connections… details to a file

checkbox

checkbox

checkbox

Load Connections…

checkbox

checkbox

checkbox

Connection / Database

Refresh a connection

checkbox

checkbox

checkbox

checkbox

Edit Connection… settings

checkbox

checkbox

checkbox

checkbox

Duplicate Connection

checkbox

checkbox

checkbox

checkbox

Remove Connection…

checkbox

checkbox

checkbox

checkbox

checkbox

checkbox

Import Vector Layer…

checkbox

checkbox

checkbox

checkbox

checkbox

New Field Domain ► New Range Domain

checkbox

New Field Domain ► New Coded Values Domain

checkbox

New Field Domain ► New Glob Domain

checkbox

New Relationship…

checkbox

Delete <database_name>

checkbox

checkbox

Compact Database (VACUUM)

checkbox

checkbox

Create a New Schema…

checkbox

checkbox

checkbox

Create a New Table…

checkbox

checkbox

checkbox

checkbox

Execute SQL… query

checkbox

checkbox

checkbox

checkbox

Schema

Refresh a schema

checkbox

checkbox

checkbox

Schema Operations ► Rename Schema…

checkbox

checkbox

checkbox

Schema Operations ► Delete Schema…

checkbox

checkbox

checkbox

Project ► Save Current Project As…

checkbox

Project ► Import Projects…

checkbox

Project ► Enable Projects Versioning…

checkbox

Create a New Table…

checkbox

checkbox

Execute SQL… query

checkbox

checkbox

Table / Layer

Table Operations ► Rename Table…

checkbox

checkbox

checkbox

Table Operations ► Truncate Table…

checkbox

checkbox

New Table…

checkbox

checkbox

checkbox

Execute SQL… query

checkbox

checkbox

checkbox

Compact Database (VACUUM)

checkbox

checkbox

Export Layer ► To file…

checkbox

checkbox

checkbox

checkbox

checkbox

Manage ► Rename Layer <layer_name>…

checkbox

checkbox

checkbox

Manage ► Delete Layer <layer_name>…

checkbox

checkbox

checkbox

checkbox

checkbox

Manage ► Delete Selected Layers

checkbox

checkbox

checkbox

checkbox

checkbox

Manage ► Move to Another Schema

checkbox

checkbox

Manage ► Create Spatial Index

checkbox

checkbox

checkbox

checkbox

checkbox

Manage ► Set Comment…

checkbox

Manage ► Delete Spatial Index

checkbox

checkbox

checkbox

checkbox

checkbox

Add Layer to Project

checkbox

checkbox

checkbox

checkbox

checkbox

Add Selected Layers to Project

checkbox

checkbox

checkbox

checkbox

checkbox

Open Layer Properties… dialog

checkbox

checkbox

checkbox

checkbox

checkbox

Open File Properties… dialog

checkbox

Open with Data Source Manager

checkbox

checkbox

QGIS project

Export Project to File…

checkbox

Rename Project…

checkbox

Delete Project…

checkbox

Duplicate Project…

checkbox

Move Project to Schema…

checkbox

Set Comment…

checkbox

Enable Projects Versioning…

checkbox

Show Project Versions…

checkbox

Open Project

checkbox

checkbox

Extract Symbols…

checkbox

checkbox

Fields

Add New Field…

checkbox

checkbox

checkbox

checkbox

Field

Set Field Domain

checkbox

Rename Field ([2])

checkbox

checkbox

checkbox

Set Alias…

checkbox

Set Comment…

checkbox

checkbox

Delete Field…

checkbox

checkbox

checkbox

checkbox

Field Domains

New Field Domain ► New Range Domain…

checkbox

New Field Domain ► New Coded Values Domain…

checkbox

New Field Domain ► New Glob Domain…

checkbox

Field Domain

Edit Field Domain…

checkbox

Delete Field Domain…

checkbox

4.2.5.1. Importing vector layers into databases using Browser panel

QGIS provides easy ways to transfer vector layers directly to supported database formats using the Browser panel. You can start the import in two ways:

  • Drag and drop a single vector layer from the Browser panel or from the Project into a database connection or schema item.

  • Right-click on a database connection or schema item and choose Import Vector Layer… from the context menu.

This triggers the Import Vector Layer dialog for further customisation. When multiple layers are dragged into a database, they are imported immediately without further options. All imports run in the background, so the QGIS interface remains responsive during the process.

../../../_images/importvector_dialog.png

Fig. 4.3 Import Vector Layer dialog

You can then fill the following options:

  • Source for defining input layer

    • Source layer: the vector layer to import, chosen from the current project layers or the layer dropped onto the database entry.

    • To import only selected features of the source layer taken from the active project, use the checkbox Selected features only option.

  • Output for defining the destination table

    • Schema: when supported by the database, the schema in which to import the layer. It should already exist in the database, or create it in the database and use the refresh Refresh schemas button to update the list.

    • Table name: the name of the destination table in the database. By default, it is taken from the source layer name but can be modified. You can also use the checkbox Replace destination table (if exists) to overwrite an existing table.

  • Options for handling the data

    • Primary key: when supported by the database, sets the primary key name for the created table. Defaults to the source layer primary key name, or a default provider-specific name if the source layer does not have a primary key. It is also possible to use a custom name and define the new field in the Attributes group below.

    • checkbox Geometry column: for spatially enabled layer and when supported by the database, this represents the naming for the geometry column. Defaults to the source layer geometry column name, or a default provider-specific name if the source layer does not have a named geometry column.

    • Output CRS: the coordinate reference system of the destination table. By default, it is the CRS of the source layer, but it can be changed using the CRS selector.

    • Comment: when supported by the database, a description of the destination table

  • Attributes: allows you to modify the dataset (fields and values) as you want. By default, the widget is populated with fields in the source layer with their properties. You can adjust each of them:

    • Source expression: allows to use QGIS expressions to feed fields with calculated values. By default, no modification is applied to the input values.

    • Name: name of the field in the destination table.

    • Type: field data type (integer, text, real, etc.).

    • Length and Precision: length and precision of the field, where applicable.

    • Constraints: rules to enforce on the field values (e.g. NOT NULL, UNIQUE, DEFAULT). Support depends on the destination database.

    • Alias: an alternate display name for the field.

    • Comment: a description or note attached to the field.

    You can use buttons on the right side to:

    • newAttribute Add new field to add a new field to the destination table.

    • deleteAttribute Delete selected field to avoid adding a field to the destination table.

    • arrowUp Move selected field up or arrowDown Move selected field down to reorder fields.

    • clearText Reset all fields to clear any customization to the fields.

    • settings Convert All Fields To Lowercase or settings Convert All Fields To Uppercase, to change the case of all field names.

  • Optionally, apply a spatial filter with Filter by Extent. This restricts the import to features within a defined bounding box.

  • Optionally, apply an attribute filter with Feature filter. This allows you to use an expression to select which features are imported.

4.2.6. Tiles and Web Services

Table 4.6 Available actions for web services (1)

Level and Context menu

Type of services

wms

WMS / WMTS

(Reference)

xyz

XYZ Tiles

(Reference)

wcs

WCS

(Reference)

wfs

WFS / OGC API - Features

(Reference)

afs

ArcGIS REST Servers

(Reference)

Top menu

Create a New Connection…

checkbox

checkbox

checkbox

checkbox

checkbox

Save Connections… details to a file

checkbox

checkbox

checkbox

checkbox

checkbox

Load Connections…

checkbox

checkbox

checkbox

checkbox

checkbox

Connection

Refresh connection

checkbox

checkbox

checkbox

checkbox

checkbox

Edit Connection… settings

checkbox

checkbox

checkbox

checkbox

checkbox

Duplicate Connection

checkbox

checkbox

checkbox

checkbox

checkbox

Remove Connection…

checkbox

checkbox

checkbox

checkbox

checkbox

View Service Info in Web browser

checkbox

Table / Layer

Export Layer ► To File…

checkbox

checkbox

checkbox

checkbox

checkbox

Add Layer to Project

checkbox

checkbox

checkbox

checkbox

Add Vector Layer (FeatureServer) to Project

checkbox

Add Raster Layer (MapServer) to Project

checkbox

Add Raster with All MapServer Layers

checkbox

Add Filtered Layer to Project…

checkbox

Open Layer properties… dialog

checkbox

checkbox

checkbox

checkbox

checkbox

View Service Info in Web browser

checkbox

Table 4.7 Available actions for web services (2)

Level and Context menu

Type of services

vectorTileLayer

Vector Tiles

(Reference)

tiledSceneLayer

Scene

(Reference)

cloud

Cloud

(Reference)

sensor

SensorThings

(Reference)

stac

STAC

(Reference)

Top menu

Create a New Connection…

checkbox

checkbox

checkbox

checkbox

Create a New Generic Connection…

checkbox

Create a New ArcGIS Vector Tile Service Connection…

checkbox

Save Connections… details to a file

checkbox

checkbox

checkbox

checkbox

checkbox

Load Connections…

checkbox

checkbox

checkbox

checkbox

checkbox

Connection

Edit Connection… settings

checkbox

checkbox

checkbox

checkbox

checkbox

Duplicate Connection

checkbox

checkbox

checkbox

checkbox

Delete Connection…

checkbox

checkbox

checkbox

checkbox

checkbox

Refresh

checkbox

checkbox

Details…

checkbox

Table / Layer

Export Layer ► To File…

checkbox

Add Layer to Project

checkbox

checkbox

checkbox

Open Layer properties… dialog

checkbox

checkbox

checkbox

Refresh

checkbox

Download assets…

checkbox

Details…

checkbox