7. QGIS GUI

The QGIS graphical user interface (GUI) is shown in the figure below (the numbers 1 through 5 in yellow circles indicate important elements of the QGIS GUI, and are discussed below).

../../../_images/startup.png

Рис. 7.1 QGIS GUI with Alaska sample data

Примечание

Внешний вид элементов интерфейса (заголовки окон и т.п.) может отличаться, в зависисмости от операционной системы и менеджера окон.

The main QGIS GUI (Рис. 7.1) consists of five components / component types:

  1. Menu Bar

  2. Toolbars

  3. Panels

  4. Map View

  5. Status Bar

Scroll down for detailed explanations of these.

7.2. Panels and Toolbars

From the View menu (or kde Settings), you can switch QGIS widgets (Panels ►) and toolbars (Toolbars ►) on and off. To (de)activate any of them, right-click the menu bar or toolbar and choose the item you want. Panels and toolbars can be moved and placed wherever you like within the QGIS interface. The list can also be extended with the activation of Core or external plugins.

7.2.1. Панели инструментов

The toolbars provide access to most of the functions in the menus, plus additional tools for interacting with the map. Each toolbar item has pop-up help available. Hover your mouse over the item and a short description of the tool’s purpose will be displayed.

Every toolbar can be moved around according to your needs. Additionally, they can be switched off using the right mouse button context menu, or by holding the mouse over the toolbars.

../../../_images/toolbars1.png

Рис. 7.2 The Toolbars menu

Совет

Восстановление панелей инструментов

If you have accidentally hidden a toolbar, you can get it back using View ► Toolbars ► (or kde Settings ► Toolbars ►). If, for some reason, a toolbar (or any other widget) totally disappears from the interface, you’ll find tips to get it back at restoring initial GUI.

7.2.2. Panels

QGIS provides many panels. Panels are special widgets that you can interact with (selecting options, checking boxes, filling values…) to perform more complex tasks.

../../../_images/panels.png

Рис. 7.3 The Panels menu

Below is a list of the default panels provided by QGIS:

7.3. Область карты

7.3.1. Exploring the map view

The map view (also called Map canvas) is the «business end» of QGIS — maps are displayed in this area, in 2D. The map displayed in this window will reflect the rendering (symbology, labeling, visibilities…) you applied to the layers you have loaded. It also depends on the layers and the project’s Coordinate Reference System (CRS).

When you add a layer (see e.g. Opening Data), QGIS automatically looks for its CRS. If a different CRS is set by default for the project (see Project Coordinate Reference Systems) then the layer extent is «on-the-fly» translated to that CRS, and the map view is zoomed to that extent if you start with a blank QGIS project. If there are already layers in the project, no map canvas resize is performed, so only features falling within the current map canvas extent will be visible.

Click on the map view and you should be able to interact with it:

  • it can be panned, shifting the display to another region of the map: this is performed using the pan Pan Map tool, the arrow keys, moving the mouse while any of the Space key, the middle mouse button or the mouse wheel is held down.

  • it can be zoomed in and out, with the dedicated zoomIn Zoom In and zoomIn Zoom Out tools. Hold the Alt key to switch from one tool to the other. Zooming is also performed by rolling the wheel forward to zoom in and backwards to zoom out. The zoom is centered on the mouse cursor position.

    You can customize the Zoom factor under the Settings ► Options ► Map tools menu.

  • it can be zoomed to the full extent of all loaded layers (zoomFullExtent Zoom Full), to a layer extent (zoomToLayer Zoom to Layer) or to the extent of selected features (zoomToSelected Zoom to Selection)

  • you can navigate back/forward through the canvas view history with the zoomLastZoom Last and zoomNextZoom Next buttons or using the back/forward mouse buttons.

Right-click over the map and you should be able to editCopy Copy coordinates of the clicked point in the map CRS, in WGS84 or in a custom CRS. The copied information can then be pasted in an expression, a script, text editor or spreadsheet…

By default, QGIS opens a single map view (called «main map»), which is tightly bound to the Layers panel; the main map automatically reflects the changes you do in the Layers panel area. But it is also possible to open additional map views whose content could diverge from the Layers panel current state. They can be of 2D or 3D type, show different scale or extent, or display a different set of the loaded layers thanks to map themes.

7.3.2. Setting additional map views

To add a new map view, go to View ► newMap New Map View. A new floating widget, mimicking the main map view’s rendering, is added to QGIS. You can add as many map views as you need. They can be kept floating, placed side by side or stacked on top of each other.

../../../_images/map_views.png

Рис. 7.4 Multiple map views with different settings

At the top of an additional map canvas, there’s a toolbar with the following capabilities:

  • zoomFullExtent Zoom Full, zoomToSelected Zoom to Selection and zoomToLayer Zoom to Layer to navigate within the view

  • showMapTheme Set View Theme to select the map theme to display in the map view. If set to (none), the view will follow the Layers panel changes.

  • options View settings to configure the map view:

    • radioButtonOn Synchronize view center with main map: syncs the center of the map views without changing the scale. This allows you to have an overview style or magnified map which follows the main canvas center.

    • radioButtonOff Synchronize view to selection: same as zoom to selection

    • Scale

    • Rotation

    • Magnification

    • unchecked Synchronize scale with the main map scale. A Scale factor can then be applied, allowing you to have a view which is e.g. always 2x the scale of the main canvas.

    • checkbox Show annotations

    • checkbox Show cursor position

    • unchecked Show main canvas extent

    • checkbox Show labels: allows to hide labels regardless they are set in the displayed layers“ properties

    • Change map CRS…

    • Rename view…

7.3.3. Exporting the map view

Maps you make can be layout and exported to various formats using the advanced capabilities of the print layout or report. It’s also possible to directly export the current rendering, without a layout. This quick «screenshot» of the map view has some convenient features.

To export the map canvas with the current rendering:

  1. Go to Project ► Import/Export

  2. Depending on your output format, select either

    • saveMapAsImage Export Map to Image…

    • or saveAsPDF Export Map to PDF…

The two tools provide you with a common set of options. In the dialog that opens:

../../../_images/saveMapAsImage.png

Рис. 7.5 The Save Map as Image dialog

  1. Choose the Extent to export: it can be the current view extent (the default), the extent of a layer or a custom extent drawn over the map canvas. Coordinates of the selected area are displayed and manually editable.

  2. Enter the Scale of the map or select it from the predefined scales: changing the scale will resize the extent to export (from the center).

  3. Set the Resolution of the output

  4. Control the Output width and Output height in pixels of the image: based by default on the current resolution and extent, they can be customized and will resize the map extent (from the center). The size ratio can be locked, which may be particularly convenient when drawing the extent on the canvas.

  5. checkbox Draw active decorations: in use decorations (scale bar, title, grid, north arrow…) are exported with the map

  6. checkbox Draw annotations to export any annotation

  7. checkbox Append georeference information (embedded or via world file): depending on the output format, a world file of the same name (with extension PNGW for PNG images, JPGW for JPG, …) is saved in the same folder as your image. The PDF format embeds the information in the PDF file.

  8. When exporting to PDF, more options are available in the Save map as PDF… dialog:

    ../../../_images/saveMapAsPDF.png

    Рис. 7.6 The Save Map as PDF dialog

    • checkbox Export RDF metadata of the document such as the title, author, date, description…

    • unchecked Create Geospatial PDF (GeoPDF): Generate a georeferenced PDF file (requires GDAL version 3 or later). You can:

      • Choose the GeoPDF Format

      • checkbox Include vector feature information in the GeoPDF file: will include all the geometry and attribute information from features visible within the map in the output GeoPDF file.

      Примечание

      Since QGIS 3.10, with GDAL 3 a GeoPDF file can also be used as a data source. For more on GeoPDF support in QGIS, see https://north-road.com/2019/09/03/qgis-3-10-loves-geopdf/.

    • Rasterize map

    • checkbox Simplify geometries to reduce output file size: Geometries will be simplified while exporting the map by removing vertices that are not discernably different at the export resolution (e.g. if the export resolution is 300 dpi, vertices that are less than 1/600 inch apart will be removed). This can reduce the size and complexity of the export file (very large files can fail to load in other applications).

    • Set the Text export: controls whether text labels are exported as proper text objects (Always export texts as text objects) or as paths only (Always export texts as paths). If they are exported as text objects then they can be edited in external applications (e.g. Inkscape) as normal text. BUT the side effect is that the rendering quality is decreased, AND there are issues with rendering when certain text settings like buffers are in place. That’s why exporting as paths is recommended.

  9. Click Save to select file location, name and format.

    When exporting to image, it’s also possible to Copy to clipboard the expected result of the above settings and paste the map in another application such as LibreOffice, GIMP…

7.4. 3D Map View

3D visualization support is offered through the 3D map view. You create and open a 3D map view via View ► new3DMap New 3D Map View. A floating QGIS panel will appear. The panel can be docked.

To begin with, the 3D map view has the same extent and view as the 2D main map canvas. A set of navigation tools are available to turn the view into 3D.

../../../_images/3dmapview.png

Рис. 7.7 The 3D Map View dialog

The following tools are provided at the top of the 3D map view panel:

  • pan Camera control: moves the view, keeping the same angle and direction of the camera

  • zoomFullExtent Zoom Full: resizes the view to the whole layers“ extent

  • 3dNavigation Toggle on-screen notification: shows/hides the navigation widget (that is meant to ease controlling of the map view)

  • identify Identify: returns information on the clicked point of the terrain or the clicked 3D feature(s) – More details at Identifying Features

  • measure Measurement line: measures the horizontal distance between points

  • play Animations: shows/hides the animation player widget

  • saveMapAsImage Save as image…: exports the current view to an image file format

  • 3d Export 3D Scene…: exports the current view as a 3D scene (.obj file), allowing post-processing in applications like Blender… The terrain and vector features are exported as 3D objects. The export settings, overriding the layers properties or map view configuration, include:

    • Scene name and destination Folder

    • Terrain resolution

    • Terrain texture resolution

    • Model scale

    • checkbox Smooth edges

    • checkbox Export normals

    • checkbox Export textures

  • showMapTheme Set View Theme: Allows you to select the set of layers to display in the map view from predefined map themes.

  • options Configure the map view settings

7.4.2. Creating an animation

An animation is based on a set of keyframes - camera positions at particular times. To create an animation:

  1. Toggle on the play Animations tool, displaying the animation player widget

  2. Click the signPlus Add keyframe button and enter a Keyframe time in seconds. The Keyframe combo box now displays the time set.

  3. Using the navigation tools, move the camera to the position to associate with the current keyframe time.

  4. Repeat the previous steps to add as many keyframes (with time and position) as necessary.

  5. Click the play button to preview the animation. QGIS will generate scenes using the camera positions/rotations at set times, and interpolating them in between these keyframes. Various Interpolation modes for animations are available (eg, linear, inQuad, outQuad, inCirc… – more details at https://doc.qt.io/qt-5/qeasingcurve.html#EasingFunction-typedef).

    The animation can also be previewed by moving the time slider. Keeping the refresh Repeat button pressed will repeatedly run the animation while clicking play stops a running animation.

It is possible to browse the different views of the camera, using the Keyframe list. Whenever a time is active, changing the map view will automatically update the associated position. You can also symbologyEdit Edit keyframe (time only) or signMinus Remove keyframe.

Click fileSave Export animation frames to generate a series of images representing the scene. Other than the filename Template and the Output directory, you can set the number of Frames per second, the Output width and Output height.

7.4.3. Scene Configuration

The 3D map view opens with some default settings you can customize. To do so, click the options Configure… button at the top of the 3D canvas panel to open the 3D configuration window.

../../../_images/3dmapconfiguration.png

Рис. 7.8 The 3D Map Configuration dialog

In the 3D Configuration window there are various options to fine-tune the 3D scene:

7.4.3.1. Terrain

  • Terrain: Before diving into the details, it is worth noting that the terrain in a 3D view is represented by a hierarchy of terrain tiles and as the camera moves closer to the terrain, existing tiles that do not have sufficient details are replaced by smaller tiles with more details. Each tile has mesh geometry derived from the elevation raster layer and texture from 2D map layers.

    • The elevation terrain Type can be:

    • Elevation: Raster or mesh layer to be used for generation of the terrain. The raster layer must contain a band that represents elevation. For a mesh layer, the Z values of the vertices are used.

    • Vertical scale: Scale factor for vertical axis. Increasing the scale will exaggerate the height of the landforms.

    • Tile resolution: How many samples from the terrain raster layer to use for each tile. A value of 16px means that the geometry of each tile will consist of 16x16 elevation samples. Higher numbers create more detailed terrain tiles at the expense of increased rendering complexity.

    • Skirt height: Sometimes it is possible to see small cracks between tiles of the terrain. Raising this value will add vertical walls («skirts») around terrain tiles to hide the cracks.

  • When a mesh layer is used as terrain, you can configure the Triangles settings (wireframe display, smooth triangles) and the Rendering colors settings (as uniform or depending on terrain level). More details in the Mesh layer properties section.

  • unchecked Terrain shading: Allows you to choose how the terrain should be rendered:

    • Shading disabled - terrain color is determined only from map texture

    • Shading enabled - terrain color is determined using Phong’s shading model, taking into account map texture, the terrain normal vector, scene light(s) and the terrain material’s Ambient and Specular colors and Shininess

7.4.3.2. Lights

From the Lights tab, press the signPlus menu to add

  • up to eight Point lights: emits light in all directions, like a sphere of light filling an area. Objects closer to the light will be brighter, and objects further away will be darker. A point light has a set position (X, Y and Z), a Color, an Intensity and an Attenuation

  • up to four Directional lights: mimics the lighting that you would get from a giant flash light very far away from your objects, always centered and that never dies off (e.g. the sun). It emits parallel light rays in a single direction but the light reaches out into infinity. A directional light can be rotated given an Azimuth, have an Altitude, a Color and an Intensity.

../../../_images/3dmapconfiguration_lights.png

Рис. 7.9 The 3D Map Lights Configuration dialog

7.4.3.3. Shadow

Check unchecked Show shadow to display shadow within your scene, given:

  • a Directional light

  • a Shadow rendering maximum distance: to avoid rendering shadow of too distant objects, particularly when the camera looks up along the horizon

  • a Shadow bias: to avoid self-shadowing effects that could make some areas darker than others, due to differences between map sizes. The lower the better

  • a Shadow map resolution: to make shadows look sharper. It may result in less performance if the resolution parameter is too high.

7.4.3.4. Camera & Skybox

  • Camera’s Field of view: allowing to create panoramic scenes. Default value is 45°.

  • Check unchecked Show skybox to enable skybox rendering in the scene. The skybox type can be:

    • Panoramic texture, with a single file providing sight on 360°

    • Distinct faces, with a texture file for each of the six sides of a box containing the scene

    Texture files can be files on the disk, remote URLs or embedded in the project (more details).

7.4.3.5. Advanced

  • Map tile resolution: Width and height of the 2D map images used as textures for the terrain tiles. 256px means that each tile will be rendered into an image of 256x256 pixels. Higher numbers create more detailed terrain tiles at the expense of increased rendering complexity.

  • Max. screen error: Determines the threshold for swapping terrain tiles with more detailed ones (and vice versa) - i.e. how soon the 3D view will use higher quality tiles. Lower numbers mean more details in the scene at the expense of increased rendering complexity.

  • Max. ground error: The resolution of the terrain tiles at which dividing tiles into more detailed ones will stop (splitting them would not introduce any extra detail anyway). This value limits the depth of the hierarchy of tiles: lower values make the hierarchy deep, increasing rendering complexity.

  • Zoom levels: Shows the number of zoom levels (depends on the map tile resolution and max. ground error).

  • unchecked Show labels: Toggles map labels on/off

  • unchecked Show map tile info: Include border and tile numbers for the terrain tiles (useful for troubleshooting terrain issues)

  • unchecked Show bounding boxes: Show 3D bounding boxes of the terrain tiles (useful for troubleshooting terrain issues)

  • unchecked Show camera’s view center

  • unchecked Show light sources: shows a sphere at light source origins, allowing easier repositioning and placement of light sources relative to the scene contents

7.4.4. 3D vector layers

A vector layer with elevation values can be shown in the 3D map view by checking Enable 3D Renderer in the 3D View section of the vector layer properties. A number of options are available for controlling the rendering of the 3D vector layer.

7.5. Строка состояния

The status bar provides you with general information about the map view and processed or available actions, and offers you tools to manage the map view.

7.5.1. Locator bar

On the left side of the status bar, the locator bar, a quick search widget, helps you find and run any feature or options in QGIS:

  1. Click in the text widget to activate the locator search bar or press Ctrl+K.

  2. Type a text associated with the item you are looking for (name, tag, keyword, …). By default, results are returned for the enabled locator filters, but you can limit the search to a certain scope by prefixing your text with the locator filters prefix, ie. typing l cad will return only the layers whose name contains cad.

    The filter can also be selected with a double-click in the menu that shows when accessing the locator widget.

  3. Click on a result to execute the corresponding action, depending on the type of item.

Совет

Limit the lookup to one field of the active layer

By default, a search with the «active layer features» filter (f) runs through the whole attribute table of the layer. You can limit the search to a particular field using the @ prefix. E.g., f @name sal or @name sal returns only the features whose «name» attribute contains „sal“. Text autocompletion is active when writing and the suggestion can be applied using Tab key.

Searching is handled using threads, so that results always become available as quickly as possible, even if slow search filters are installed. They also appear as soon as they are encountered by a filter, which means that e.g. a file search filter will show results one by one as the file tree is scanned. This ensures that the UI is always responsive, even if a very slow search filter is present (e.g. one which uses an online service).

Совет

Quick access to the locator’s configurations

Click on the search icon inside the locator widget on the status bar to display the list of filters you can use and a Configure entry that opens the Locator tab of the Settings ► Options… menu.

7.5.2. Reporting actions

In the area next to the locator bar, a summary of actions you’ve carried out will be shown when needed (such as selecting features in a layer, removing layer) or a long description of the tool you are hovering over (not available for all tools).

In case of lengthy operations, such as gathering of statistics in raster layers, executing Processing algorithms or rendering several layers in the map view, a progress bar is displayed in the status bar.

7.5.3. Control the map canvas

The tracking Coordinate option shows the current position of the mouse, following it while moving across the map view. You can set the units (and precision) in the Project ► Properties… ► General tab. Click on the small button at the left of the textbox to toggle between the Coordinate option and the extents Extents option that displays the coordinates of the current bottom-left and top-right corners of the map view in map units.

Next to the coordinate display you will find the Scale display. It shows the scale of the map view. There is a scale selector, which allows you to choose between predefined and custom scales.

On the right side of the scale display, press the lockedGray button to lock the scale to use the magnifier to zoom in or out. The magnifier allows you to zoom in to a map without altering the map scale, making it easier to tweak the positions of labels and symbols accurately. The magnification level is expressed as a percentage. If the Magnifier has a level of 100%, then the current map is not magnified. Additionally, a default magnification value can be defined within Settings ► Options ► Rendering ► Rendering behavior, which is very useful for high-resolution screens to enlarge small symbols.

To the right of the magnifier tool you can define a current clockwise rotation for your map view in degrees.

On the right side of the status bar, there is a small checkbox which can be used temporarily to prevent layers being rendered to the map view (see section Рендеринг).

To the right of the render functions, you find the projectionEnabled EPSG:code button showing the current project CRS. Clicking on this opens the Project Properties dialog and lets you apply another CRS to the map view.

Совет

Calculating the Correct Scale of Your Map Canvas

When you start QGIS, the default CRS is WGS 84 (EPSG 4326) and units are degrees. This means that QGIS will interpret any coordinate in your layer as specified in degrees. To get correct scale values, you can either manually change this setting in the General tab under Project ► Properties… (e.g. to meters), or you can use the projectionEnabled EPSG:code icon seen above. In the latter case, the units are set to what the project projection specifies (e.g., +units=us-ft).

Note that CRS choice on startup can be set in Settings ► Options ► CRS.

7.5.4. Messaging

The messageLog Messages button next to it opens the Log Messages Panel which has information on underlying processes (QGIS startup, plugins loading, processing tools…)

Depending on the Plugin Manager settings, the status bar can sometimes show icons to the right to inform you about the availability of new (pluginNew) or upgradeable (pluginUpgrade) plugins. Click the icon to open the Plugin Manager dialog.