Skip to content

Latest commit

 

History

History
713 lines (628 loc) · 59.9 KB

File metadata and controls

713 lines (628 loc) · 59.9 KB
.. index:: Browser panel

The Browser panel

The QGIS Browser panel is a great tool for browsing, searching, inspecting, copying and loading QGIS resources. Only resources that QGIS knows how to handle are shown in the browser.

Using the Browser panel you can locate, inspect and add data, as described in :ref:`browser_panel`. In addition, the Browser panel supports drag and drop of many QGIS resources, such as project files, Python scripts, Processing scripts and Processing models.

Python scripts, Processing scripts and Processing models can also be opened for editing in an external editor and the graphical modeller.

You can drag and drop layers from the :guilabel:`Layers` panel to the :guilabel:`Browser` panel, for instance into a GeoPackage or a PostgreSQL database.

img/browser_panel.png

The Browser panel

The browser panel (:numref:`figure_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.

In :menuselection:`Settings --> Interface Customization` it is possible to disable resources. If you, for instance, would not like to show Python scripts in the browser, you can uncheck the :menuselection:`Browser --> py` entry, and if you want to get rid of your home folder in the browser, you can uncheck the :menuselection:`Browser --> special:Home` entry.

A filter (filterMap Filter Browser) can be used for searching based on entry names (both leaf entries and node entries in the hierarchy). Using the options Options pull-down menu next to the filter text field, you can

The Properties widget, showing useful information about some entries / resources, can be enabled / disabled using the metadata Enable/disable properties widget button. When enabled, it opens at the bottom of the browser panel, as shown in :numref:`figure_properties_widget`.

img/browser_p_properties_w.png

The properties widget

A second browser panel can be opened by activating the :guilabel:`Browser (2)` panel in :menuselection:`View --> Panels`. Having two browser panels can be useful when copying layers between resources that are locationed deep down in different branches of the browser hierarchy.

A lot can be accomplished in the Browser panel

  • Add vector, raster and mesh layers to your map by double-clicking, dragging onto the map canvas or clicking the addLayer Add Selected Layers button (after selecting layers)
  • Run Python scripts (including Processing algorithms) by double-clicking or dragging onto the map canvas
  • Run models by double-clicking or dragging onto the map canvas
  • :guilabel:`Extract Symbols...` from QGIS Project files using the context menu
  • Open files with their default applications (:guilabel:`Open <file type> Externally...` in the context menu). Examples: HTML files, spreadsheets, images, PDFs, text files, ...
  • Copy entries
  • Rename and delete (multiple) layers (context menu: :menuselection:`Manage -->`)
  • Open a file explorer window and directly select the file :guilabel:`Show in Files`

Resource specific actions are listed for the different resource groups sorted under the top-level entries listed below.

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 Home, the context menu allows you to :guilabel:`Rename Favorite...` and :guilabel:`Remove Favorite`.

This is where you will find your :ref:`spatial bookmarks <sec_bookmarks>`, divided into :guilabel:`Project Bookmarks` and :guilabel:`User Bookmarks`.

available actions for spatial bookmarks
Level Contextual menu
:guilabel:`Spatial Bookmarks` :guilabel:`New Spatial Bookmark…`
:guilabel:`Show the Spatial Bookmark Manager`
:guilabel:`Import Spatial Bookmarks…`
:guilabel:`Export Spatial Bookmarks…`

Bookmark group

(:guilabel:`Project Bookmarks` and :guilabel:`User Bookmarks`)

:guilabel:`New Spatial Bookmark…`
:guilabel:`Import Spatial Bookmarks…`
:guilabel:`Export Spatial Bookmarks…`
Individual bookmark :guilabel:`Zoom to Bookmark`
:guilabel:`Edit Spatial Bookmark…`
:guilabel:`Delete Spatial Bookmark`

Available once the project file has been saved, the :guilabel:`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 :guilabel:`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 :menuselection:`Project --> Properties... --> General --> Project home` option, or by right-clicking on the :guilabel:`Project Home` item of the Browser panel and selecting :guilabel:`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.

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

They are mainly:

  • The :guilabel:`Home` folder, pointing to the current user home folder
  • on Unix-based machines, the root :guilabel:`/` folder
  • the connected drives, either local or network. Depending on the OS, they are directly listed (eg, C:\, D:\) or through the /Volumes entry.

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

Available actions for plain layer files
Level and Context menu Types of layers

addRasterLayer Raster

(:ref:`Reference <raster_properties_dialog>`)

addOgrLayer Vector

(:ref:`Reference <vector_properties_dialog>`)

addPointCloudLayer Point clouds

(:ref:`Reference <working_with_point_clouds>`)

addMeshLayer Mesh

(:ref:`Reference <label_meshdata>`)

File
:guilabel:`Delete File <dataset name>` checkbox checkbox    
:guilabel:`Show in Files` checkbox checkbox checkbox checkbox
:menuselection:`Manage` checkbox checkbox checkbox checkbox
:guilabel:`File Properties…` checkbox checkbox checkbox checkbox
:guilabel:`Open <file type> Externally…` checkbox      
Layer
:guilabel:`Add Layer to Project` checkbox checkbox checkbox checkbox
:menuselection:`Export Layer` checkbox checkbox    
:guilabel:`Layer Properties…` checkbox checkbox checkbox checkbox
:guilabel:`Open with Data Source Manager…` checkbox checkbox    
:guilabel:`Execute SQL…`   checkbox    

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.

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
Create a :guilabel:`New Connection…` to an existing database checkbox checkbox checkbox checkbox checkbox checkbox
:guilabel:`Create Database…` checkbox checkbox        
:guilabel:`Create Database and Layer…` checkbox          
:guilabel:`Save Connections…` details to a file     checkbox checkbox checkbox  
:guilabel:`Load Connections…`     checkbox checkbox checkbox  
Connection / Database
:guilabel:`Refresh` a connection     checkbox checkbox checkbox checkbox
:guilabel:`Edit Connection…` settings     checkbox checkbox checkbox checkbox
:guilabel:`Duplicate Connection`     checkbox checkbox checkbox checkbox
:guilabel:`Remove Connection…` checkbox checkbox checkbox checkbox checkbox checkbox
:guilabel:`Import Vector Layer…` checkbox checkbox checkbox checkbox checkbox  
:menuselection:`New Field Domain --> New Range Domain` checkbox          
:menuselection:`New Field Domain --> New Coded Values Domain` checkbox          
:menuselection:`New Field Domain --> New Glob Domain` checkbox          
:guilabel:`New Relationship...` checkbox          
:guilabel:`Delete <database_name>` checkbox checkbox        
:guilabel:`Compact Database (VACUUM)` checkbox          
Create a :guilabel:`New Schema…`     checkbox checkbox checkbox  
Create a :guilabel:`New Table…` checkbox checkbox checkbox checkbox    
:guilabel:`Execute SQL…` query checkbox checkbox checkbox checkbox    
Schema
:guilabel:`Refresh` a schema     checkbox checkbox checkbox  
:menuselection:`Schema Operations --> Rename Schema…`     checkbox checkbox checkbox  
:menuselection:`Schema Operations --> Delete Schema…`     checkbox checkbox checkbox  
:menuselection:`Project --> Save Current Project`     checkbox      
:menuselection:`Project --> Import Projects…`     checkbox      
Create a :guilabel:`New Table…`     checkbox checkbox    
:guilabel:`Execute SQL…` query     checkbox checkbox    
Table / Layer
:menuselection:`Table Operations --> Rename Table…`     checkbox checkbox checkbox  
:menuselection:`Table Operations --> Truncate Table…`     checkbox   checkbox  
:guilabel:`Execute SQL…` query checkbox checkbox checkbox      
:menuselection:`Export Layer --> To file…` checkbox checkbox checkbox checkbox checkbox  
:menuselection:`Manage --> Rename Layer <layer_name>…` checkbox checkbox     checkbox  
:menuselection:`Manage --> Delete Layer <layer_name>…` checkbox checkbox checkbox checkbox checkbox  
:menuselection:`Manage --> Delete Selected Layers` checkbox checkbox checkbox checkbox checkbox  
:menuselection:`Manage --> Add Layer to Project` checkbox checkbox checkbox checkbox checkbox  
:menuselection:`Manage --> Add Selected Layers to Project` checkbox checkbox checkbox checkbox checkbox  
:menuselection:`Manage --> Move to Another Schema`     checkbox   checkbox  
:menuselection:`Manage --> Create Spatial Index` checkbox checkbox checkbox   checkbox checkbox
:menuselection:`Manage --> Set Comment…`     checkbox      
:menuselection:`Manage --> Delete Spatial Index` checkbox checkbox checkbox   checkbox checkbox
Open :guilabel:`Layer Properties…` dialog checkbox checkbox checkbox checkbox checkbox  
Open :guilabel:`File Properties…` dialog checkbox          
:guilabel:`Open with Data Source Manager` checkbox checkbox        
QGIS project
:guilabel:`Open Project…` checkbox   checkbox      
:guilabel:`Extract Symbols…` checkbox   checkbox      
:guilabel:`Export Project to File…`     checkbox      
:guilabel:`Rename Project…`     checkbox      
:guilabel:`Delete Project…`     checkbox      
:guilabel:`Duplicate Project…`     checkbox      
:guilabel:`Move Project to Schema…`     checkbox      
Fields
:guilabel:`Add New Field…` checkbox checkbox checkbox checkbox    
Field
:guilabel:`Set Field Domain` checkbox          
:guilabel:`Rename Field` ([2]) checkbox   checkbox   checkbox  
:guilabel:`Set Alias…` checkbox          
:guilabel:`Set Comment…` checkbox   checkbox      
:guilabel:`Delete Field…` checkbox checkbox checkbox checkbox    
[1]The different entries may also be available for some GDAL supported vector file formats such as ESRI File Geodatabase, FlatGeobuf, GeoParquet, NetCDF, ... when compatible.
[2]For PostgreSQL connections: only supported with ALTER TABLE privilege.
Importing vector layers into databases using Browser panel

QGIS allows you to import vector layers directly into a database from the :guilabel:`Browser` panel. This provides a simple way to transfer datasets into supported database formats without using dbManager DB Manager (see :ref:`dbmanager`).

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 :guilabel:`Import Vector Layer...` from the context menu.

Note

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.

img/importvector_dialog.png

Import Vector Layer dialog

To add a layer using :guilabel:`Import Vector Layer...` follow these steps:

  1. Add :guilabel:`Source layer`: the layer to import, chosen from the current QGIS project. To import only selected features of the source layer use the checkbox :guilabel:`Selected features only` option.

  2. Set the :guilabel:`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 :guilabel:`Replace destination table (if exists)` to overwrite an existing table.

  3. Define the :guilabel:`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 :ref:`CRS selector <crs_selector>`.

  4. Configure the :guilabel:`Attributes`:

    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 remove a field from the destination table.
    • arrowUp Move selected field up or arrowDown Move selected field down to reorder fields.
    • clearText Reset all fields to clear all fields and start from scratch.
    • settings Convert All Fields To Lowercase or settings Convert All Fields To Uppercase, to change the case of all field names.
  5. Optionally, apply a spatial filter with :ref:`Filter by Extent <extent_selector>`. This restricts the import to features within a defined bounding box.

  6. Optionally, apply an attribute filter with :ref:`Feature filter <expression_builder>`. This allows you to use an expression to select which features are imported.

Available actions for web services (1)
Level and Context menu Type of services

wms

WMS / WMTS

(:ref:`Reference <ogc-wms-servers>`)

xyz

XYZ Tiles

(:ref:`Reference <xyz_tile>`)

wcs

WCS

(:ref:`Reference <ogc-wcs>`)

wfs

WFS / OGC API - Features

(:ref:`Reference <ogc-wfs>`)

afs

ArcGIS REST Servers

(:ref:`Reference <arcgis_rest>`)

Top menu
Create a :guilabel:`New Connection…` checkbox checkbox checkbox checkbox checkbox
:guilabel:`Save Connections…` details to a file checkbox checkbox checkbox checkbox checkbox
:guilabel:`Load Connections…` checkbox checkbox checkbox checkbox checkbox
Connection
:guilabel:`Refresh` connection checkbox checkbox checkbox checkbox checkbox
:guilabel:`Edit Connection…` settings checkbox checkbox checkbox checkbox checkbox
:guilabel:`Duplicate Connection` checkbox checkbox checkbox checkbox checkbox
:guilabel:`Remove Connection…` checkbox checkbox checkbox checkbox checkbox
:guilabel:`View Service Info` in Web browser         checkbox
Table / Layer
:menuselection:`Export Layer --> To File…` checkbox checkbox checkbox checkbox checkbox
:guilabel:`Add Layer to Project` checkbox checkbox checkbox checkbox  
:guilabel:`Add Vector Layer (FeatureServer) to Project`         checkbox
:guilabel:`Add Raster Layer (MapServer) to Project`         checkbox
:guilabel:`Add Raster with All MapServer Layers`         checkbox
:guilabel:`Add Filtered Layer to Project…`         checkbox
Open :guilabel:`Layer properties…` dialog checkbox checkbox checkbox checkbox checkbox
:guilabel:`View Service Info` in Web browser         checkbox
Available actions for web services (2)
Level and Context menu Type of services

vectorTileLayer

Vector Tiles

(:ref:`Reference <vector_tiles>`)

tiledSceneLayer

Scene

(:ref:`Reference <3d_tiles>`)

cloud

Cloud

(:ref:`Reference <cloud_connections>`)

sensor

SensorThings

(:ref:`Reference <sensor_things>`)

stac

STAC

(:ref:`Reference <stac>`)

Top menu
Create a :guilabel:`New Connection…`   checkbox checkbox checkbox checkbox
Create a :guilabel:`New Generic Connection…` checkbox        
Create a :guilabel:`New ArcGIS Vector Tile Service Connection…` checkbox        
:guilabel:`Save Connections…` details to a file checkbox checkbox checkbox checkbox checkbox
:guilabel:`Load Connections…` checkbox checkbox checkbox checkbox checkbox
Connection
:guilabel:`Edit Connection…` settings checkbox checkbox checkbox checkbox checkbox
:guilabel:`Duplicate Connection` checkbox checkbox checkbox checkbox  
:guilabel:`Delete Connection…` checkbox checkbox checkbox checkbox checkbox
:guilabel:`Refresh`         checkbox
:guilabel:`Details…`         checkbox
Table / Layer
:menuselection:`Export Layer --> To File…`       checkbox  
:guilabel:`Add Layer to Project` checkbox checkbox   checkbox  
Open :guilabel:`Layer properties…` dialog checkbox checkbox   checkbox  
:guilabel:`Refresh`         checkbox
:guilabel:`Download assets…`         checkbox
:guilabel:`Details…`         checkbox
Available actions for various supported files
File type Context menu
QGIS Layer Definition (.qlr) :menuselection:`Export Layer --> To File…`
:menuselection:`Add Layer to Project`
:menuselection:`Layer Properties…`
Processing Model (.model3) :menuselection:`Run Model…`
:menuselection:`Edit Model…`
Print Composer Template (.qpt) :menuselection:`New Layout from Template`
Python script (.py) :menuselection:`Run Script…`
:menuselection:`Open in External Editor`