通用工具¶

Docs in progress for 'QGIS testing'. Visit https://docs.qgis.org/3.4 for QGIS 3.4 docs and translations.

上下文帮助

每当需要特定主题的帮助时,可以通过 Help 大多数对话框中都有按钮——请注意,第三方插件可以指向专用网页。

面板

默认情况下,qgis提供了许多要使用的面板。其中一些面板在下面进行了描述,而其他面板可能在文档的不同部分中找到。QGIS提供的默认面板的完整列表可通过 View ‣ Panels ‣ 菜单和中提到的 面板 .

图层面板

这个 Layers 面板(也称为 map legend )列出项目中的所有层,并帮助您管理它们的可见性。您可以通过按来显示或隐藏它 Ctrl+1 . 可以在图例中选择并向上或向下拖动层,以更改Z顺序。Z排序意味着在图例顶部附近列出的图层将绘制在图例下方列出的图层上。

注解

z排序行为可以由 Layer Order 面板。

在“层”面板的顶部,工具栏允许您:

  • symbology Open the layer styling dock (F7): toggle the layer styling panel on and off.
  • addGroup Add new group
  • showMapTheme Manage Map Themes: control visibility of layers and arrange them in different map themes.
  • filterMap Filter Legend by Map Content: only the layers that are set visible and whose features intersect the current map canvas have their style rendered in the layers panel. Otherwise, a generic NULL symbol is applied to the layer. Based on the layer symbology, this is a convenient way to identify which kind of features from which layers cover your area of interest.
  • expressionFilter Filter Legend by Expression: apply an expression to remove styles from the selected layer tree that have no feature satisfying the condition. This can be used to highlight features that are within a given area/feature of another layer. From the drop-down list, you can edit and clear the expression currently applied.
  • expandTree Expand All or collapseTree Collapse All layers and groups in the layers panel.
  • removeLayer Remove Layer/Group currently selected.
../../../_images/layer_toolbar.png

图层面板中的图层工具栏

注解

管理图层面板的工具也可用于打印布局中的地图和图例项。

配置地图主题

这个 showMapTheme Manage Map Themes 下拉按钮提供对快捷方式的访问,以便在 Layers 小组:

  • showAllLayers Show All Layers
  • hideAllLayers Hide All Layers
  • showSelectedLayers Show Selected Layers
  • hideSelectedLayers Hide Selected Layers
  • hideDeselectedLayers Hide Deselected Layers

除了对层可见性的简单控制之外, showMapTheme Manage Map Themes 菜单允许您配置 Map Themes 在图例中,从一个地图主题切换到另一个。地图主题是 snapshot 记录的当前地图图例:

  • 层在中设置为可见 Layers 面板
  • and for each visible layer:
    • style 应用于层
    • 样式的可见类,即在 Layers panel . 这适用于 symbologies 除了单一符号渲染
    • 层节点及其所在组的折叠/展开状态

要创建地图主题:

  1. 选中要显示的层

  2. 像往常一样配置层属性(符号、图表、标签…)

  3. 展开 Style ‣ 菜单在底部并点击 Add... 将设置存储为 a new style embedded in the project

    注解

    地图主题不记得属性的当前详细信息:只保存对样式名的引用,因此每当启用此样式时对图层应用修改(例如更改符号呈现),地图主题都会用新信息更新。

  4. 根据需要对其他层重复前面的步骤

  5. 如果适用,展开或折叠组或可见层节点 Layers 面板

  6. 点击 showMapTheme Manage Map Themes 面板顶部的按钮,以及 Add Theme...

  7. 输入地图主题的名称并单击 OK

新主题列在 showMapTheme 下拉菜单。

您可以根据需要创建任意多个地图主题:每当地图图例中的当前组合(可见图层、活动样式、地图图例节点)与上面定义的任何现有地图主题内容不匹配时,单击 Add Theme... 创建新的地图主题,或使用 Replace Theme ‣ 更新当前地图主题。使用 Remove Current Theme 按钮删除活动主题。

地图主题有助于在不同的预配置组合之间快速切换:在列表中选择一个地图主题以恢复其组合。所有配置的主题也可在打印版面中访问,允许您基于特定主题创建地图版面(请参见 主要性能

图层面板上下文菜单概述

在工具栏的底部,“图层”面板的主要组件是框架,列出添加到项目中的矢量或栅格图层,可以选择按组组织。根据在面板中选择的项目,右键单击将显示下面显示的一组专用选项。

期权 矢量层 栅格层
zoomToLayer Zoom to Layer/Group checkbox checkbox checkbox
zoomToLayer Zoom to Selection checkbox
inOverview Show in Overview checkbox checkbox
Show Feature Count checkbox
Copy Layer/Group checkbox checkbox checkbox
Rename Layer/Group checkbox checkbox checkbox
zoomActual Zoom to Native Resolution (100%) checkbox
Stretch Using Current Extent checkbox
dbManager Update SQL Layer... checkbox
addGroup Add Group checkbox
duplicateLayer Duplicate Layer checkbox checkbox
removeLayer Remove Layer/Group... checkbox checkbox checkbox
Move Out of Group checkbox checkbox
Move to Top checkbox checkbox checkbox
Check and all its Parents checkbox checkbox
Group Selected checkbox checkbox
openTable Open Attribute Table checkbox
toggleEditing Toggle Editing checkbox
allEdits Current Edits ‣ checkbox
Filter... checkbox
Set Layer Scale Visibility... checkbox checkbox
Zoom to Visible Scale checkbox checkbox
Set CRS ‣ checkbox checkbox
  • Set Layer/Group CRS...
checkbox checkbox checkbox
  • Set Project CRS from Layer
checkbox checkbox
Set Group WMS Data... checkbox
unchecked Mutually Exclusive Group checkbox
Check and all its children (Ctrl-click) checkbox
Uncheck and all its children (Ctrl-click) checkbox
Make Permanent checkbox
Export ‣ checkbox checkbox checkbox
  • Save As...
checkbox
  • Save Features As...
checkbox
  • Save Selected Features As...
checkbox
  • Save As Layer Definition File...
checkbox checkbox checkbox
  • Save As QGIS Layer Style File...
checkbox checkbox
Styles ‣ checkbox checkbox
  • Copy Style
checkbox checkbox
  • Paste Style
checkbox checkbox checkbox
  • Add...
checkbox checkbox
  • Rename Current...
checkbox checkbox
Properties... checkbox checkbox

表:图层面板项中的上下文菜单

对于草矢量层, toggleEditing Toggle editing 不可用。见节 数字化和编辑草地矢量层 有关编辑草地矢量层的信息。

与组和层交互

“图例”窗口中的图层可以分组。有两种方法可以做到这一点:

  1. folder 用于添加新组的图标。键入组的名称,然后按 Enter . 现在单击现有层并将其拖到组上。
  2. 选择一些图层,在“图例”窗口中单击鼠标右键,然后选择 Group Selected . 所选图层将自动放置在新组中。

若要将层移出组,请将其拖出,或右键单击该层并选择 Move Out of Group :层从组中移动并放置在其上方。组也可以嵌套在其他组中。如果图层放置在嵌套组中, Move Out of Group 将层移出所有嵌套组。

要将组或层移动到“层”面板的顶部,请将其拖到顶部,或选择 Move to Top . 如果在嵌套在组中的层上使用此选项,则该层将移动到其当前组的顶部。

组的复选框将显示或隐藏组中的所有层,只需单击一次。

启用 Mutually Exclusive Group 选项意味着您可以使一个组同时只有一个层可见。每当组中的某个层设置为可见时,其他层将被切换为不可见。

通过按住 Ctrl 键,同时单击其他层。然后可以同时将所有选定的层移动到新组。

您也可以同时删除多个层或组,方法是使用 Ctrl 按键,然后按 Ctrl+D :将从层列表中删除所有选定的层或组。

有关使用指示器图标的层和组的详细信息

在某些情况下,图标显示在 Layers 面板以提供有关层/组的更多信息。这些符号是:

  • toggleEditing to indicate that the layer is in edit mode and you can modify the data
  • editableEdits to indicate that the layer being edited has some unsaved changes
  • indicatorFilter to indicate a filter applied to the layer. Hover over the icon to see the filter expression and double-click to update the setting
  • indicatorEmbedded to identify an embedded group or layer and the path to their original project file
  • indicatorMemory to remind you that the layer is a temporary scratch layer and its content will be discarded when you close this project. To avoid data loss and make the layer permanent, click the icon to store the layer in any of the OGR vector formats supported by QGIS.

编辑矢量图层样式

在“层”面板中,您可以使用快捷方式快速轻松地更改层渲染。右键单击向量层并选择 Styles ‣ 为了:

  • styles 当前应用于层。如果为图层定义了许多样式,则可以从一个样式切换到另一个样式,并且图层渲染将在地图画布上自动更新。
  • 复制当前样式,并在适用时从另一层粘贴复制的样式
  • 重命名当前样式、添加新样式(实际上是当前样式的副本)或删除当前样式(当有多个样式可用时)。

注解

前面的选项也可用于栅格图层。

无论矢量层中的特征是否都具有相同的唯一符号,或者它们被分类(在这种情况下,该层显示在树结构中,每个类都作为子项),以下选项在层级别或类级别都可用:

  • Edit Symbol... to open the 符号选择器 dialog to change any properties of the layer or feature symbol (symbol, size, color...). Double-clicking on a feature also opens the Symbol Selector dialog.
  • 颜色选择器 with a Color Wheel from which you can click a color to update the symbol fill color automatically. For convenience, Recent colors are available at the bottom of the color wheel.
  • showAllLayers Show All Items and hideAllLayers Hide All Items to toggle on or off the visibility of all the classes of features. This avoids (un)checking items one by one.

小技巧

快速共享层样式

从上下文菜单中,复制一个图层的样式并将其粘贴到一组或一组图层中:该样式应用于与原始图层具有相同类型(矢量/栅格)的所有图层,对于矢量图层,该样式具有相同的几何体类型(点、线或多边形)。

图层样式面板

这个 Layer Styling 面板(也可用 Ctrl+3 )是实现 Layer Properties 对话框。它提供了一种快速而简单的方法来定义一个层的渲染和行为,并且可以在不打开层属性对话框的情况下可视化其效果。

除了避免阻塞(或“模式”)层属性对话框,层样式面板还避免将屏幕与对话框混淆,并包含大多数样式功能(颜色选择器、效果属性、规则编辑、标签替换…):例如,单击层样式面板内的颜色按钮会导致颜色选择器对话框在图层样式面板内部打开,而不是作为单独的对话框打开。

从图层面板中当前图层的下拉列表中,选择一个项目,然后:

  • 设置栅格层 symbology Symbologytransparency TransparencyrasterHistogram Histogram 性质。这些选项与 栅格属性对话框 .
  • 设置矢量层 symbology Symbology3d 3D Viewlabeling Labels 性质。这些选项与 矢量属性对话框 .
  • 管理中的关联样式 stylePreset Style Manager (更多详细信息,请访问 管理自定义样式
  • history History 在当前项目中应用于图层样式的更改:因此,可以通过在列表中选择并单击来取消或恢复到任何状态。 Apply .

该面板的另一个强大功能是 checkbox Live update 复选框。勾选此选项可立即在地图画布上呈现更改:您不再需要单击 Apply 按钮。

../../../_images/layer_styling.png

从图层样式面板定义图层符号

小技巧

向图层样式面板添加自定义选项卡

使用 PyQGIS ,可以在“图层样式”面板中设置新选项卡来管理图层特性。示例请参见https://nathanw.net/2016/06/29/qgis-style-dock-part-2-plugin-panels/。

层顺序面板

默认情况下,在qgis地图画布上显示的图层按照其在 Layers 面板:面板中的A层越高,它在地图视图中的位置就越高(因此,越明显)。

您可以定义与“图层”面板中的顺序无关的图层的绘图顺序, Layer Order 面板已在中启用 View ‣ Panels ‣ 菜单或带 Ctrl+9 . 检查 checkbox Control rendering order 在图层列表下面,根据需要重新组织面板中的图层。此顺序将成为应用于地图画布的顺序。例如,在图“图层顺序”中,您可以看到 airports 功能显示在 alaska 多边形,尽管这些层在“层”面板中各自放置。

不检查 checkbox Control rendering order 将恢复为默认行为。

../../../_images/layer_order.png

定义独立于图例的图层顺序

概览面板

这个 Overview 面板 Ctrl+8 )显示具有部分图层的完整范围视图的地图。使用 Show in Overview 选项从 Layer 菜单或在层上下文菜单中。在视图中,红色矩形显示当前地图画布范围,帮助您快速确定当前查看的整个地图的哪个区域。如果单击并拖动概述框架中的红色矩形,主地图视图范围将相应更新。

请注意,即使地图概述中使用的图层已设置为标签,也不会将标签呈现到地图概述中。

日志消息面板

在加载或处理某些操作时,可以使用 messageLog Log Messages Panel . 它可以使用底部状态栏中最右边的图标激活。

撤消/重做面板

对于正在编辑的每个层, Undo/RedoCtrl+5 )面板显示执行的操作列表,通过选择上面列出的操作,可以快速撤消一组操作。更多细节 Undo and Redo edits .

统计汇总面板

这个 Statistics 面板 Ctrl+6 )提供任何向量层的汇总信息。此面板允许您选择:

  • 计算统计信息的向量层
  • 要使用的列,或 expression expression
  • 使用对话框右下角的下拉按钮返回的统计信息。根据字段(或表达式的值)类型,可用的统计信息包括:
统计 整数 浮标 日期
伯爵 checkbox checkbox checkbox checkbox
非重复计数 checkbox     checkbox
计数缺少值 checkbox     checkbox
  checkbox checkbox  
平均值   checkbox checkbox checkbox
标准偏差   checkbox checkbox  
样品标准差   checkbox checkbox  
极小值 checkbox checkbox checkbox checkbox
极大值 checkbox checkbox checkbox checkbox
范围   checkbox checkbox checkbox
少数   checkbox checkbox  
多数   checkbox checkbox  
品种   checkbox checkbox  
第一四分位数   checkbox checkbox  
第三分位数   checkbox checkbox  
四分位数间距   checkbox checkbox  
最小长度 checkbox      
最大长度 checkbox      

表:每个字段类型的可用统计信息

统计汇总可以是:

  • 返回整个层或 checkbox selected features only
  • 使用重新计算 draw 当基础数据源更改时(例如,新的或删除的功能/字段、属性修改)按钮
  • editCopy copied to the clipboard and pasted as a table in another application
../../../_images/statistical_summary.png

显示域的统计信息

嵌套项目

有时,您希望在不同的项目中保留一些层,但使用相同的样式。您可以创建 default style 对于这些层,或者将它们嵌入到另一个项目中,以节省时间和精力。

从现有项目中嵌入层和组比样式具有一些优势:

如果要将其他项目文件中的内容嵌入到项目中,请选择 Layer ‣ Embed Layers and Groups

  1. 单击 browseButton 寻找项目:你可以看到项目的内容(参见图“嵌入”对话框)
  2. 按住 Ctrl (或) osx Cmd )并单击要检索的层和组
  3. 点击 OK

选定的层和组嵌入到 Layers 面板并显示在地图画布上。安 indicatorEmbedded 图标添加到其名称旁边以供识别,悬停在其上会显示一个具有原始项目文件路径的工具提示。

../../../_images/embed_dialog.png

选择要嵌入的层和组

与任何其他层一样,通过右键单击该层并单击,可以从项目中删除嵌入层。 removeLayer Remove .

小技巧

更改嵌入层的呈现方式

除非在原始项目文件中进行更改,否则无法更改嵌入层的渲染。但是,右键单击一个层并选择 Duplicate 创建一个完全具有功能且不依赖于原始项目的图层。然后可以安全地删除链接层。

使用地图画布

致使

默认情况下,每当刷新地图画布时,qgis将渲染所有可见层。触发地图画布刷新的事件包括:

  • 添加层
  • 平移或缩放
  • 调整qgis窗口的大小
  • 更改一个或多个图层的可见性

QGIS允许您以多种方式控制渲染过程。

比例相关渲染

比例相关渲染允许您指定层(栅格或矢量)可见的最小和最大比例。若要设置与比例相关的渲染,请打开 Properties 通过双击图例中的层进行对话。上 Rendering 标签,滴答声 checkbox Scale dependent visibility 然后进入 Minimum (exclusive)Maximum (inclusive) 比例值。

还可以从“层”面板激活层上的比例相关可见性。在图层上单击鼠标右键,然后在上下文菜单中选择 Set Layer Scale Visibility .

这个 mapIdentification Set to current canvas scale 按钮允许您使用当前地图画布比例作为范围可见性的边界。

注解

当一个图层由于地图比例超出其可见性比例范围而未在地图画布中渲染时,该图层在“图层”面板和新选项中变灰。 Zoom to Visible Scale 显示在层上下文菜单中。选择它,地图将缩放到层的最近可见性比例。

控制地图渲染

可以通过多种方式控制地图渲染,如下所述。

暂停渲染

要暂停渲染,请单击 checkbox Render 状态栏右下角的复选框。什么时候? checkbox Render 如果未选中,则qgis不会根据本节中描述的任何事件重新绘制画布。 致使 . 您可能希望暂停渲染的示例包括:

  • 在绘制之前添加许多层并对其进行符号化
  • 在绘图前添加一个或多个大图层并设置比例相关性
  • 在绘图前添加一个或多个大图层并缩放到特定视图
  • 以上任意组合

检查 checkbox Render 复选框启用渲染并立即刷新地图画布。

设置图层添加选项

可以设置一个选项来始终加载新图层而不绘制它们。这意味着图层将被添加到地图中,但其在图例中的可见性复选框在默认情况下将不选中。要设置此选项,请选择菜单选项 Settings ‣ Options 然后点击 Rendering 标签。取消检查 checkbox By default new layers added to the map should be displayed . 默认情况下,随后添加到地图的任何图层都将关闭(不可见)。

停止渲染

要停止绘制地图,请按 Esc 关键。这将停止刷新地图画布并保留部分绘制的地图。按压之间可能需要一点时间 Esc 停止绘制地图。

注解

当前无法停止渲染---这在qt4端口中被禁用,因为用户界面(ui)问题和崩溃。

影响渲染质量

qgis可以选择影响地图的渲染质量。选择菜单选项 Settings ‣ Options ,点击 Rendering 选项卡并选择或取消选择 checkbox Make lines appear less jagged at the expense of some drawing performance .

加快渲染速度

有些设置允许您提高渲染速度。使用打开“QGIS选项”对话框 Settings ‣ OptionsRendering 选项卡并选择或取消选择以下复选框:

  • checkbox Use render caching where possible to speed up redraws.
  • checkbox Render layers in parallel using many CPU cores and then set the checkbox Max cores to use.
  • 地图在背景中渲染到单独的图像上,每个图像 checkbox Map Update interval ,将获取此(非屏幕)图像中的内容以更新可见屏幕表示。但是,如果渲染完成的速度比此持续时间快,则会立即显示。
  • checkbox Enable Feature simplification by default for newly added layers ,可以简化要素的几何图形(节点较少),从而使其显示更快。请注意,这可能导致呈现不一致。

缩放与平移

QGIS提供了缩放和平移感兴趣区域的工具。

除了使用 pan panzoomIn zoom-in / zoomOut zoom-out 图标在工具栏上用鼠标,也可以用鼠标滚轮、空格键和箭头键导航。一 Zoom factor 可以设置在 Settings ‣ options Options ‣ Map tools 用于定义缩放时的缩放行为的菜单。

用鼠标滚轮

您可以按下鼠标滚轮在主窗口内平移(在MacOS上,您可能需要按住 cmd 关键)。您可以滚动鼠标滚轮来放大和缩小地图;鼠标光标位置将是所关注的缩放区域的中心。压低 Ctrl 当滚动鼠标滚轮时,会产生更精细的缩放效果。

用箭头键

使用箭头键可以平移地图。将鼠标光标放在地图区域内,单击箭头键向上、向下、向左和向右平移。

也可以使用空格键使鼠标暂时移动以平移地图。这个 PgUpPgDown 键盘上的键将导致地图显示按照缩放系数设置放大或缩小。紧迫的 Ctrl++Ctrl+- 还可以在地图画布上立即执行放大/缩小操作。

当某些地图工具处于活动状态(标识、测量…)时,可以通过按住来执行缩放。 Shift 在地图上拖动一个矩形以缩放到该区域。这对选择工具没有启用(因为它们使用 Shift 用于添加到所选内容)或编辑工具。

空间书签

空间书签允许您“书签”地理位置并稍后返回。默认情况下,书签保存在计算机上,这意味着它们可以从同一计算机中的任何项目中使用。如果希望将书签存储在项目文件中( .qgs )然后您可以通过选择 In Project 复选框。

创建书签

要创建书签:

  1. 缩放或平移到感兴趣的区域。
  2. 选择菜单选项 View ‣ New Bookmark 或按 Ctrl+B . 这个 Spatial Bookmarks 面板将打开新创建的书签。
  3. 输入书签的描述性名称(最多255个字符)。
  4. 检查 In Project 如果要将书签保存在项目文件中,请选择框。
  5. 出版社 Enter 要添加书签或单击其他位置。

请注意,您可以有多个同名书签。

使用书签

要使用或管理书签,请选择 View ‣ Show Bookmarks 或按 Ctrl+7 . 这个 Spatial Bookmarks 面板允许您:

  • 缩放到书签:选择所需的书签,然后单击 Zoom To Bookmark . 您也可以通过双击书签来缩放到书签。
  • 删除书签:选择书签并单击 Delete Bookmark . 确认您的选择。
  • 导入或导出书签:要在计算机之间共享或传输书签,可以使用 Import/Export Bookmarks 下拉菜单将所有书签导出到 .xml 文件或从此类文件导入书签。

您也可以通过在 locator .

装饰品

装饰包括网格、版权标签、北箭头、比例尺和布局范围。它们被用来通过添加制图元素来“装饰”地图。

网格

transformed Grid allows you to add a coordinate grid and coordinate annotations to the map canvas.

  1. 选择 View ‣ Decorations ‣ Grid 打开对话框。

    ../../../_images/grid_dialog.png

    网格对话框

  2. 滴答声 checkbox Enable grid 并根据地图画布中加载的图层设置网格定义。

  3. 滴答声 checkbox Draw annotations 并根据地图画布中加载的图层设置注释定义。

  4. 点击 Apply 验证其外观是否如预期,或 OK 如果你满意的话。

北箭头

northArrow North Arrow adds a north arrow on the map canvas, with options for style and placement.

要添加北箭头:

  1. 选择 View ‣ Decorations ‣ North Arrow 打开对话框。

    ../../../_images/north_arrow_dialog.png

    “北箭头”对话框

  2. 确保 checkbox Enable north arrow 被检查

  3. 或者更改颜色和大小,或者选择自定义SVG。

  4. 可选择更改角度或选择 Automatic 让QGIS确定方向

  5. 从“位置”组合框中选择位置(可选)

  6. 也可以通过设置水平和/或垂直来调整箭头的位置 Margin from (Canvas) Edge. 这些值可以是 MillimetersPixels 或设置为 Percentage 地图画布的宽度或高度。

  7. 点击 Apply 验证其外观是否如预期,以及 OK 如果你满意的话。

刻度尺

scaleBar Scale Bar adds a simple scale bar to the map canvas. You can control the style and placement, as well as the labelling of the bar.

QGIS仅支持以与地图框架相同的单位显示比例。因此,如果项目CRS的单位是米,则不能以英尺为单位创建比例尺。同样,如果使用十进制度数,则无法创建刻度条以米为单位显示距离。

要添加比例尺:

  1. 选择 View ‣ Decorations ‣ Scale Bar 打开对话框

    ../../../_images/scale_bar_dialog.png

    “比例尺”对话框

  2. 确保 checkbox Enable scale bar 被检查

  3. 从中选择样式 Scale bar style selectString 组合框

  4. 选择 Color of bar selectColor 通过选择填充颜色(默认:黑色)和轮廓颜色(默认:白色)。单击颜色输入右侧的向下箭头,可以使比例尺填充和轮廓不透明。

  5. 从中选择刻度条的字体 Font of bar selectString 组合框

  6. 设置 Size of bar selectNumber

  7. 可选检查 checkbox Automatically snap to round number on resize 显示易于读取的值

  8. 从中选择位置 Placement selectString 组合框

  9. 您可以通过设置水平和/或垂直来调整项目的位置。 Margin from (Canvas) Edge. 这些值可以是 MillimetersPixels 或设置为 Percentage 地图画布的宽度或高度。

  10. 点击 Apply 验证其外观是否如预期,或 OK 如果你满意的话。

布局范围

addMap Layout Extents adds the extents of map item(s) in print layout(s) to the canvas. When enabled, the extents of all map items within all print layouts are shown using a lightly dotted border labeled with the name of the print layout and map item. You can control the style and labeling of the displayed layout extents. This decoration is useful when you are tweaking the positioning of map elements such as labels, and need to know the actual visible region of print layouts.

../../../_images/decoration_layoutextents_example.png

带有两个打印布局的QGIS项目中显示的布局范围示例。名为“Sights”的打印布局包含两个地图项,而另一个打印布局包含一个地图项。

要添加布局范围,请执行以下操作:

  1. 选择 View ‣ Decorations ‣ Layout Extents 打开对话框

    ../../../_images/decoration_layoutextents.png

    布局范围对话框

  2. 确保 checkbox Show layout extents 被检查

  3. 可以选择更改范围的符号和标签

  4. 点击 Apply 验证其外观是否如预期,以及 OK 如果你满意的话

小技巧

装饰设置

保存QGIS项目文件时,对栅格、北箭头、比例尺、版权和布局范围所做的任何更改都将保存在项目中,并在下次加载项目时还原。

注释工具

注释是添加到地图画布并显示在气球中的信息。这些信息可以是不同类型的,并且使用中的相应工具添加注释。 Attributes Toolbar

  • textAnnotation Text Annotation for custom formatted text
  • htmlAnnotation HTML Annotation to place the content of an html file
  • svgAnnotation SVG Annotation to add an SVG symbol
  • formAnnotation Form Annotation: useful to display attributes of a vector layer in a customized ui file (see figure_custom_annotation). This is similar to the custom attribute forms, but displayed in an annotation item. Also see this video https://youtu.be/0pDBuSbQ02o?t=2m25s from Tim Sutton for more information.
../../../_images/custom_annotation.png

自定义Qt设计器注释窗体

要添加注释,请选择相应的工具并单击地图画布。将添加一个空气球。双击它,将打开一个对话框,其中包含各种选项。对于所有注释类型,此对话框几乎相同:

  • 在顶部,一个文件选择器,用于填充 htmlsvgui 文件取决于批注类型。对于文本注释,可以在文本框中输入消息,并使用普通字体工具设置其呈现。
  • checkbox Fixed map position: when unchecked, the balloon placement is based on a screen position (instead of the map), meaning that it's always shown regardless the map canvas extent.
  • Linked layer: associates the annotation with a map layer, making it visible only when that layer is visible.
  • Map marker: using QGIS symbols, sets the symbol to display at the balloon anchor position (shown only when Fixed map position is checked).
  • Frame style: sets the frame background color, transparency, stroke color or width of the balloon using QGIS symbols.
  • Contents margins: sets interior margins of the annotation frame.
../../../_images/annotation.png

注释文本对话框

启用注释工具时,可以选择注释。然后可以按地图位置(通过拖动地图标记)或仅移动气球来移动它们。这个 annotation Move Annotation 工具还允许您在地图画布上移动气球。

要删除注释,请选择它,然后按 DelBackspace 按钮,或双击并按 Delete 属性对话框中的按钮。

注解

如果你按 Ctrl+T 而一个 Annotation 工具(移动注释、文本注释、表单注释)处于活动状态,项目的可见性状态将反转。

小技巧

用注释布局地图

可以使用以下方法将地图中的注释打印或导出为各种格式:

  • 地图画布导出工具 Project 菜单
  • print layout, in which case you need to check Draw map canvas items in the corresponding map item properties

测量

一般信息

QGIS提供了四种几何测量方法:

  • 交互式测量工具 measure
  • 测量 calculateField Field Calculator
  • 导出的测量值 识别特征 工具
  • 矢量分析工具: Vector ‣ Geometry Tools ‣ Export/Add Geometry Columns

在投影坐标系(如UTM)和未投影数据内进行测量工作。前三个测量工具的行为与全局项目设置相同:

  • 与大多数其他地理信息系统不同,默认的测量指标是椭圆体,使用中定义的椭圆体。 Project ‣ Properties... ‣ General . 当为项目定义地理坐标系和投影坐标系时,这是正确的。
  • 如果要使用笛卡尔数学计算投影/平面面积或距离,则必须将测量椭球设置为“无/平面”。( Project ‣ Properties... ‣ CRS )但是,如果为数据和项目定义了地理(即未投影)CRS,则面积和距离测量将是椭圆形的。

然而,无论是识别工具还是现场计算器都不会在测量前将数据转换为项目CRS。如果要实现这一点,必须使用向量分析工具: Vector ‣ Geometry Tools ‣ Add Geometry Attributes... . 这里的测量是平面测量,除非您选择椭圆测量。

交互式测量长度、面积和角度

单击 measure 属性工具栏中开始测量的图标。图标附近的向下箭头在 measure 长度, measureArea 区域或 measureAngle 角度。对话框中使用的默认单位是 Project ‣ Properties... ‣ General 菜单。

注解

配置测量工具

测量长度或面积时,单击 Configuration 小部件底部的按钮打开 Settings ‣ Options ‣ Map Tools 菜单,您可以在其中选择橡胶和颜色、测量精度和单位行为。您也可以选择首选的度量单位或角度单位,但请记住,这些值在当前项目中由在 Project ‣ Properties... ‣ General 菜单,以及在测量小部件中进行的选择。

所有测量模块都使用来自数字化模块的捕捉设置(参见第节 设置捕捉公差和搜索半径 )因此,如果要精确地沿直线特征或围绕多边形特征测量,请首先设置其图层捕捉公差。现在,使用测量工具时,每个鼠标单击(在公差设置内)都将捕捉到该层。

默认情况下, measure Measure Line 根据定义的椭球测量给定点之间的实际距离。然后,该工具允许您单击地图上的点。每个段长度以及总长度都显示在“度量”窗口中。要停止测量,请单击鼠标右键。

请注意,在使用测量工具(“米”、“公里”、“英尺”、“码”、“英里”、“海里”、“厘米”、“毫米”、“度”、“地图单位”)时,可以使用“总计”附近的下拉列表以交互方式更改测量单位。在创建新项目或打开另一个项目之前,此单元一直保留在小部件中。

这个 Info 对话框中的部分说明如何根据可用的CRS设置进行计算。

../../../_images/measure_line.png

测量距离

measureArea Measure Area: Areas can also be measured. In the measure window, the accumulated area size appears. Right-click to stop drawing. The Info section is also available as well as the ability to switch between different area units ('Square meters', 'Square kilometers', 'Square feet', 'Square yards', 'Square miles', 'Hectares', 'Acres', 'Square centimeters', 'Square millimeters', 'Square nautical miles', 'Square degrees', 'Map units').

../../../_images/measure_area.png

测量面积

measureAngle Measure Angle: You can also measure angles. The cursor becomes cross-shaped. Click to draw the first segment of the angle you wish to measure, then move the cursor to draw the desired angle. The measurement is displayed in a pop-up dialog.

../../../_images/measure_angle.png

测量角

与功能交互

选择功能

QGIS提供了几个工具来选择地图画布上的特征。选择工具在 View ‣ Select 菜单或在 Attributes toolbar .

注解

选择工具用于当前活动层。

在地图画布上手动选择

要使用鼠标选择一个或多个功能,可以使用以下工具之一:

  • selectRectangle Select Features by area or single click
  • selectPolygon Select Features by Polygon
  • selectFreehand Select Features by Freehand
  • selectRadius Select Features by Radius

注解

以外 selectPolygon Select Features by Polygon ,这些手动选择工具允许您通过单击选择地图画布上的功能。

注解

使用 selectPolygon Select Features by Polygon 工具使用现有多边形选择重叠特征。在多边形中单击鼠标右键,然后从显示包含单击点的所有多边形列表的上下文菜单中选择该多边形。将选择活动层中的所有重叠特征。

使用时 selectRectangle Select Feature(s) 持有工具 ShiftCtrl 切换是否选择某个功能(即添加到当前选择或从中删除)。

对于其他工具,按住可执行不同的行为:

  • Shift: add features to the current selection
  • Ctrl: substract features from the current selection
  • Ctrl+Shift: intersect with current selection, ie only keep overlapping features from the current selection
  • Alt: select features that are totally within the selection shape. Combined with Shift or Ctrl keys, you can add or substract features to/from the current selection.

自动选择

其他选择工具,也可从 Attribute table ,根据功能的属性或其选择状态执行选择(请注意,属性表和地图画布显示相同的信息,因此如果在属性表中选择一个功能,它也将在地图画布上被选择):

  • expressionSelect Select By Expression... select features using expression dialog
  • formSelect Select Features By Value... or press F3
  • deselectAll Deselect Features from All Layers or press Ctrl+Shift+A to deselect all selected features in all layers
  • selectAll Select All Features or press Ctrl+A to select all features in the current layer
  • invertSelection Invert Feature Selection to invert the selection in the current layer

例如,如果您想查找属于自治区的区域, regions.shp 在qgis示例数据中,可以使用 expressionSelect Select features using an Expression 偶像。然后,展开 Fields and Values 分组并选择要查询的字段。双击字段“type_2”,然后单击 All Unique 在显示的面板中。从列表中,选择并双击“borough”。在 Expression 字段,写入以下查询:

"TYPE_2"  =  'Borough'

在“表达式生成器”对话框中,还可以使用 Function list ‣ Recent (Selection) 进行您以前使用过的选择。对话框会记住最后使用的20个表达式。见 表达 更多信息和示例。

小技巧

将所选内容保存到新文件中

用户可以将所选功能保存到 New Temporary Scratch Layer 或A New Vector Layer 使用 Edit ‣ Copy FeaturesEdit ‣ Paste Features as 以所需格式。

按值选择功能

此选择工具打开层的功能窗体,允许用户选择每个字段要查找的值、搜索是否区分大小写以及应使用的操作。该工具还具有自动完成功能,自动用现有值填充搜索框。

../../../_images/select_by_value.png

使用窗体对话框筛选/选择功能

每个字段旁边都有一个下拉列表,其中包含控制搜索行为的选项:

字段搜索选项 数字的 日期
Exclude Field from the search checkbox checkbox checkbox
Equal to (=) checkbox checkbox checkbox
Not equal to (≠) checkbox checkbox checkbox
Greater than (>)   checkbox checkbox
Less than (<)   checkbox checkbox
Greater than or equal to (≥)   checkbox checkbox
Less than or equal to (≤)   checkbox checkbox
Between (inclusive)   checkbox checkbox
Not between (inclusive)   checkbox checkbox
Contains checkbox    
Does not contain checkbox    
Is missing (null) checkbox checkbox checkbox
Is not missing (not null) checkbox checkbox checkbox
Starts with checkbox    
Ends with checkbox    

对于字符串比较,也可以使用 checkbox Case sensitive 选择权。

设置所有搜索选项后,单击 Select features 选择匹配的功能。下拉选项包括:

  • Select features
  • Add to current selection
  • Filter current selection
  • Remove from current current selection

您还可以使用清除所有搜索选项 Reset form 按钮。

设置条件后,您还可以:

  • Zoom to features on the map canvas without the need of a preselection
  • Flash features, highlighting the matching features. This is a handy way to identify a feature without selection or using the Identify tool. Note that the flash does not alter the map canvas extent and would be visible only if the feature is within the bounds of the current map canvas.

识别特征

Identify工具允许您与地图画布交互,并在弹出窗口中获取有关功能的信息。要识别功能,请使用:

  • View ‣ Identify Features
  • Ctrl+Shift+I (or osx Cmd+Shift+I),
  • identify Identify Features icon on the Attributes toolbar

使用识别特征工具

QGIS提供了几种方法来识别 identify Identify Features 工具:

  • left click identifies features according to the selection mode and the selection mask set in the Identify Results panel
  • right click with Identify Feature(s) as selection mode set in the Identify Results panel fetches all snapped features from all visible layers. This opens a context menu, allowing the user to choose more precisely the features to identify or the action to execute on them.
  • right click with Identify Features by Polygon as selection mode in the Identify Results panel identifies the features that overlap with the chosen existing polygon, according to the selection mask set in the Identify Results panel

小技巧

使用标识功能工具过滤要查询的层

Layer Capabilities 在里面 Project ‣ Properties... ‣ Data Sources ,取消选中 Identifiable 层旁边的列,以避免在使用 identify Identify Features 工具处于除 当前图层. 这是一种仅从您感兴趣的层返回特性的简便方法。

如果单击功能,则 Identify Results 对话框将列出有关单击的功能的信息。默认视图是一个树视图,其中第一个项是层的名称,其子项是其标识的特征。每个特性都由字段名及其值描述。这个字段是 Layer Properties ‣ Display . 关于该特性的所有其他信息如下。

功能信息

可以自定义“标识结果”对话框以显示自定义字段,但默认情况下,它将显示以下信息:

  • 特征 display name
  • Actions: Actions can be added to the identify feature windows. The action is run by clicking on the action label. By default, only one action is added, namely View feature form for editing. You can define more actions in the layer's properties dialog (see 动作属性).
  • Derived: This information is calculated or derived from other information. It includes:
    • 有关特征几何图形的常规信息:
      • 根据几何类型,用层的crs单位对长度、周长或面积进行笛卡尔测量。
      • 取决于几何图形类型以及是否在“项目属性”对话框中为 Measurements ,使用指定单位的长度、周长或面积的椭圆体值
      • 特征中几何图形零件的数量和单击的零件的数量
      • 功能中的顶点数
    • 使用项目属性协调信息 Coordinates display
      • X and Y coordinate values of the point clicked
      • 距单击点最近的顶点的数目
      • X and Y coordinate values of the closest vertex (and Z`/`M if applicable)
      • 如果单击曲线段,也会显示该段的半径。
  • Data attributes: This is the list of attribute fields and values for the feature that has been clicked.

注解

功能属性中的链接可从 Identify Results 并将在默认Web浏览器中打开。

../../../_images/identify_features.png

确定结果对话框

“标识结果”对话框

在窗口的顶部,您有一些工具:

  • formView Open Form of the current feature
  • expandTree Expand tree
  • collapseTree Collapse tree
  • expandNewTree Expand New Results by Default to define whether the next identified feature's information should be collapsed or expanded
  • deselectAll Clear Results
  • editCopy Copy selected feature to clipboard
  • filePrint Print selected HTML response
  • 用于获取要标识的功能的选择模式:

    • identifyByRectangle Identify Features by area or single click
    • identifyByPolygon Identify Features by Polygon
    • identifyByFreehand Identify Features by Freehand
    • identifyByRadius Identify Features by Radius

    注解

    使用时 identifyByPolygon Identify Features by Polygon ,可以在任何现有多边形上单击鼠标右键,并使用它来标识另一层中的重叠特征。

在窗口的底部是 ModeView 组合框。 Mode 定义应从中标识层功能:

  • Current layer: only features from the selected layer are identified. The layer need not be visible in the canvas.
  • Top down, stop at first: only features from the upper visible layer.
  • Top down: all features from the visible layers. The results are shown in the panel.
  • Layer selection: opens a context menu where the user selects the layer to identify features from, similar to a right-click. Only the chosen features will be shown in the result panel.

这个 View 可以设置为 Tree, Table 或 图. 只能为栅格图层设置“表”和“图形”视图。

识别工具允许您 checkbox Auto open form . 如果选中,则每次识别单个功能时,都会打开一个显示其属性的表单。这是一种快速编辑功能属性的简便方法。

其他功能可以在已标识项的上下文菜单中找到。例如,从上下文菜单可以:

  • 查看功能表
  • 缩放到特征
  • 复制特征:复制所有特征几何图形和属性
  • 切换特征选择:将已标识的特征添加到选择中
  • 复制属性值:仅复制单击的属性值
  • 复制特征属性:复制特征的属性
  • 清除结果:删除窗口中的结果
  • 清除突出显示:删除地图上突出显示的功能
  • 突出所有
  • 高亮层
  • 激活层:选择要激活的层
  • 图层特性:打开图层特性窗口
  • 展开所有
  • 全部坍塌

保存并共享层属性

管理自定义样式

将矢量层添加到地图画布时,QGIS默认使用随机符号/颜色来渲染其功能。但是,可以在 Project ‣ Properties... ‣ Default styles 将根据几何类型应用于每个新添加的层。

不过,大多数时候,您更希望有一个自定义的、更复杂的样式,可以自动或手动应用到层(只需很少的工作)。您可以通过使用 Style 图层属性对话框底部的菜单。此菜单提供创建、加载和管理样式的功能。

样式存储图层属性对话框中设置的任何信息,以呈现或与矢量图层的图层(包括符号、标签、字段和表单定义、操作、图表…)交互,或栅格的像素(带或颜色呈现、透明度、金字塔、柱状图…)。

../../../_images/style_combobox.png

“矢量图层样式”组合框选项

默认情况下,应用于加载层的样式命名为 default . 一旦您为您的层获得了理想和适当的渲染,您可以通过单击 selectString Style 组合框和选择:

  • Rename Current: The active style is renamed and updated with the current options
  • Add: A new style is created using the current options. By default, it will be saved in the QGIS project file. See below to save the style in another file or a database
  • Remove: Delete unwanted style, in case you have more than one style defined for the layer.

在样式下拉列表的底部,可以看到选中活动样式的图层的样式集。

请注意,每次验证“图层属性”对话框时,活动样式都会随着所做的更改而更新。

可以为一个图层创建任意多个样式,但一次只能激活一个样式。与 Map Themes 这提供了一种快速而强大的方法来管理复杂的项目,而无需复制地图图例中的任何层。

注解

考虑到无论何时对图层属性应用修改,更改都存储在活动样式中,请始终确保编辑的样式正确,以避免错误地更改 map theme .

小技巧

从层上下文菜单管理样式

右键单击 Layers 用于添加、重命名或删除图层样式的面板。

在文件或数据库中存储样式

而样式创建自 Style 组合框默认保存在项目内部,可以在项目中逐层复制和粘贴,也可以在项目外部保存它们,以便可以在其他项目中加载它们。

另存为文本文件

点击 selectString Style ‣ Save Style ,您可以将样式另存为:

  • QGIS图层样式文件( .qml
  • SLD文件(SLD文件) .sld ),仅适用于矢量层

用于基于文件的格式层( .shp.tab …… Save as Default 生成一个 .qml 层的文件(同名)。SLD可以从任何类型的渲染器(单符号、分类、分级或基于规则)中导出,但导入SLD时,将创建单符号或基于规则的渲染器。这意味着分类或分级样式将转换为基于规则的样式。如果要保留这些渲染器,则必须使用qml格式。另一方面,有时使用这种简单的方式将样式转换为基于规则的样式非常方便。

保存到数据库

如果层数据源是数据库提供程序,那么向量层样式也可以存储在数据库中。支持的格式有Postgis、Geopackage、Spatialite、MSSQL和Oracle。图层样式保存在表格中(命名为 layer_styles )在数据库中。点击 Save Style... ‣ Save in database 然后填写对话框以定义样式名,添加说明,以及 .ui 文件(如果适用),并检查样式是否应为默认样式。

可以为数据库中的单个表保存多个样式。但是,每个表只能有一个默认样式。默认样式可以保存在图层数据库或QGIS本地数据库中,也可以保存在 ~/.qgis2/ 目录(qgis存储其本地设置的位置)。

../../../_images/save_style_database.png

在数据库对话框中保存样式

小技巧

在数据库之间共享样式文件

只有当层来自这样的数据库时,才能将样式保存在数据库中。不能混合数据库(例如Oracle中的层和MSSQL中的样式)。如果希望在数据库之间共享样式,请改用纯文本文件。

注解

您可能会遇到恢复 layer_styles 来自PostgreSQL数据库备份的表。跟随 qgis层样式表和数据库备份 解决这个问题。

加载方式

在QGIS中加载图层时,如果此图层已经存在默认样式,则QGIS将使用此样式加载图层。阿尔索 Style ‣ Restore Default 查找并加载该文件,替换层的当前样式。

Style ‣ Load Style helps you apply any saved style to a layer. While text-file styles (.sld or .qml) can be applied to any layer whatever its format, loading styles stored in a database is only possible if the layer is from the same database or the style is stored in the QGIS local database.

这个 Database Styles Manager 对话框显示与数据库中找到的图层相关的样式列表,以及保存在其中的所有其他样式,以及名称和说明。

小技巧

在项目中快速共享层样式

也可以在项目中共享图层样式,而无需导入文件或数据库样式:右键单击 Layers Panel 而且,从 Styles 组合框,复制图层的样式并将其粘贴到一组或一组图层中:该样式应用于与原始图层类型相同(矢量与栅格)的所有图层,如果是矢量图层,则具有相同的几何类型(点、线或多边形)。

在变量中存储值

在QGIS中,可以使用变量来存储可在表达式中使用的有用的循环值(例如项目标题或用户全名)。变量可以在应用程序的全局级别、项目级别、层级别、布局级别和布局项级别定义。就像CSS层叠规则一样,变量也可以被覆盖——例如,项目级变量将覆盖用相同名称设置的任何应用程序全局级变量。可以使用这些变量生成文本字符串或其他自定义表达式 @ 变量名前的字符。例如,在“打印布局”中,使用以下内容创建标签:

This map was made using QGIS [% @qgis_version %]. The project file for this
map is: [% @project_path %]

将按如下方式呈现标签:

This map was made using QGIS 3.4.4-Madeira. The project file for this map is:
/gis/qgis-user-conference-2019.qgs

除此之外 preset read-only variables ,您可以为上面提到的任何级别定义自己的自定义变量。你可以管理:

为了与可编辑变量区分,只读变量名和值以斜体显示。另一方面,被低级变量覆盖的高级变量被删除。

../../../_images/options_variables.png

项目级别的变量编辑器

注解

您可以阅读更多关于变量的内容,并在nyall-dawson's中找到一些例子。 Exploring variables in QGIS 2.12, part 1part 2part 3 博客文章。

认证

QGIS具有安全存储/检索认证凭证的功能。用户可以将凭证安全地保存到身份验证配置中,这些配置存储在可移植数据库中,可以应用到服务器或数据库连接,并且可以被项目或设置文件中的ID令牌安全地引用。有关详细信息,请参阅 认证系统 .

在初始化身份验证系统及其可移植数据库时,需要设置主密码。

公用控件

在qgis中,有一些选项需要经常使用。为了方便起见,QGIS为您提供了下面介绍的特殊小部件。

颜色选择器

颜色对话框

这个 Select Color 每当您单击 selectColor 图标选择颜色。此对话框的功能取决于 Use native color chooser dialogs 中的参数复选框 Settings ‣ Options... ‣ General . 选中后,所使用的颜色对话框是运行QGIS的操作系统的本机对话框。否则,将使用QGIS自定义颜色选择器。

“自定义颜色选择器”对话框有四个不同的选项卡,允许您按 colorBox Color rampcolorWheel Color wheelcolorSwatches Color swatchescolorPicker Color picker . 使用前两个选项卡,您可以浏览到所有可能的颜色组合,并将您的选择应用到项目。

../../../_images/color_selector_ramp.png

颜色选择器渐变选项卡

colorSwatches Color swatches 选项卡,您可以从颜色调色板列表中进行选择(请参见 颜色设置 详情请参阅。除了所有 Recent colors 调色板可以用 signPlus Add current colorsignMinus Remove selected color 框架底部的按钮。

这个 ... “调色板”组合框旁边的按钮还提供以下几个选项:

  • 复制、粘贴、导入或导出颜色
  • 创建、导入或删除调色板
  • 使用将自定义调色板添加到颜色选择器小部件 Show in Color Buttons 项目(参见图“颜色选择器”)。
../../../_images/color_selector_recent_colors.png

颜色选择器样本选项卡

另一种选择是使用 colorPicker Color picker 它允许您从qgis用户界面的任何部分的鼠标光标下或甚至从另一个应用程序中采样颜色:在选项卡处于活动状态时按空格键,将鼠标移到所需颜色上并单击它或再次按空格键。您也可以单击 Sample Color 按钮激活选取器。

无论使用何种方法,所选颜色始终通过颜色滑块来描述 HSV (色调、饱和度、值)和 RGB (红、绿、蓝)值。颜色也可以在 HTML notation .

修改颜色很简单,只需单击颜色控制盘或渐变或任何颜色参数滑块即可。您可以使用旁边的数字显示框调整这些参数,也可以将鼠标滚轮滚动到相应的滑块上。您也可以用HTML表示法键入颜色。最后,有一个 Opacity 滑块设置透明度级别。

该对话框还提供了 Old 颜色(应用于对象)和 Current 一个(正在选择)。使用拖放或按 atlasNext Add color to swatch 按钮,这些颜色中的任何一种都可以保存在一个插槽中,以便于访问。

小技巧

快速修改颜色

将颜色选择器小部件拖放到另一个小部件上以应用其颜色。

颜色下拉快捷方式

单击右侧的下拉箭头 selectColor 颜色按钮,显示用于快速选择颜色的小部件。此快捷方式提供访问:

  • 从中选择颜色的色轮
  • 用于更改颜色不透明度的alpha滑块
  • 以前设置为的调色板 Show in Color Buttons
  • 复制当前颜色并将其粘贴到另一个小部件中
  • 从计算机显示器上的任意位置选择颜色
  • 从“颜色选择器”对话框中选择颜色
../../../_images/quick_color_selector.png

快速颜色选择器菜单

颜色渐变下拉快捷方式

颜色渐变是将一组颜色应用于一个或多个功能的实用方法。他们的创造在 色彩映射表 部分。至于颜色,按 selectColorRamp “颜色渐变”按钮打开相应的“颜色渐变类型”对话框,允许您更改其属性。

../../../_images/color_ramp_brewer.png

自定义ColorBrewer渐变

按钮右侧的下拉菜单可以快速访问更广泛的颜色渐变和选项:

  • Invert Color Ramp
  • 预览 gradientcatalog: cpt-city 颜色渐变标记为 FavoritesStyle Manager 对话
  • All Color Ramps to access the compatible color ramps database
  • Create New Color Ramp... of any supported type that could be used in the current widget (note that this color ramp will not be available elsewhere unless you save it in the library)
  • Edit Color Ramp..., the same as clicking the whole color ramp button
  • Save Color Ramp..., to save the current color ramp with its customizations in the style library
../../../_images/quick_colorramp_selector.png

快速颜色渐变选择小部件

混合模式

QGIS为特殊渲染效果提供了不同的选项,这些工具您以前可能只从图形程序中了解。混合模式可以应用于图层和功能,也可以应用于打印布局项目:

  • Normal: This is the standard blend mode, which uses the alpha channel of the top pixel to blend with the pixel beneath it. The colors aren't mixed.
  • Lighten: This selects the maximum of each component from the foreground and background pixels. Be aware that the results tend to be jagged and harsh.
  • Screen: Light pixels from the source are painted over the destination, while dark pixels are not. This mode is most useful for mixing the texture of one item with another item (such as using a hillshade to texture another layer).
  • Dodge: Brighten and saturate underlying pixels based on the lightness of the top pixel. Brighter top pixels cause the saturation and brightness of the underlying pixels to increase. This works best if the top pixels aren't too bright. Otherwise the effect is too extreme.
  • Addition: Adds pixel values of one item to the other. In case of values above the maximum value (in the case of RGB), white is displayed. This mode is suitable for highlighting features.
  • Darken: Retains the lowest values of each component of the foreground and background pixels. Like lighten, the results tend to be jagged and harsh.
  • Multiply: Pixel values of the top item are multiplied with the corresponding values for the bottom item. The results are darker.
  • Burn: Darker colors in the top item cause the underlying items to darken. Burn can be used to tweak and colorize underlying layers.
  • Overlay: Combines multiply and screen blending modes. Light parts become lighter and dark parts become darker.
  • Soft light: Very similar to overlay, but instead of using multiply/screen it uses color burn/dodge. This is supposed to emulate shining a soft light onto an image.
  • Hard light: Hard light is also very similar to the overlay mode. It's supposed to emulate projecting a very intense light onto an image.
  • Difference: Subtracts the top pixel from the bottom pixel, or the other way around, in order always to get a positive value. Blending with black produces no change, as the difference with all colors is zero.
  • Subtract: Subtracts pixel values of one item from the other. In the case of negative values, black is displayed.

数据定义的覆盖设置

在“矢量图层属性”对话框中的许多选项或打印布局中的设置旁边,您将找到 dataDefined Data defined override 偶像。使用 expressions 基于层属性或项设置、预构建或自定义函数以及 variables ,此工具允许您设置参数的动态值。启用后,此小部件返回的值将应用于参数,而不考虑其正常值(复选框、文本框、滑块…)。

数据定义的覆盖小部件

点击 dataDefined Data defined override 图标显示以下条目:

  • Description... that indicates if the option is enabled, which input is expected, the valid input type and the current definition. Hovering over the widget also pops up this information.
  • Store data in the project: a button allowing the property to be stored using to the 辅助存储属性 mechanism.
  • Field type: an entry to select from the layer's fields that match the valid input type.
  • 要列出的条目 Variable 可用。
  • Edit... button to create or edit the expression to apply, using the Expression String Builder dialog. To help you correctly fill in the expression, a reminder of the expected output's format is provided in the dialog.
  • Paste and Copy buttons.
  • Clear button to remove the setup.
  • 对于数字和颜色属性, Assistant... 重新缩放特性数据应用于特性的方式(详细信息 below

小技巧

使用右键单击(取消)激活数据覆盖

正确设置数据定义的覆盖选项后,图标为黄色。 dataDefineOndataDefineExpressionOn . 如果它坏了,图标是红色的 dataDefineErrordataDefineExpressionError .

您可以启用或禁用配置的 dataDefined data-defined override 只需用鼠标右键单击该小部件即可。

使用数据定义的助手界面

dataDefined Data-defined override 按钮与数字或颜色参数关联,它具有 Assistant... 选项,允许您更改数据如何应用于每个功能的参数。助手允许您:

  • 定义 Input 数据,即:
    • 使用字段列表框或 expression Set column expression 函数(见) 表达
    • 要表示的值的范围:可以手动输入值或使用 draw Fetch value range from layer 按钮,用所选属性或应用于数据的表达式返回的最小值和最大值自动填充这些字段
  • unchecked Apply transform curve: by default, output values (see below for setting) are applied to input features following a linear scale. You can override this logic: enable the transform option, click on the graphic to add break point(s) and drag the point(s) to apply a custom distribution.
  • 定义 Output 值:选项根据要定义的参数而变化。您可以全局设置:
    • 应用于所选属性的最小值和最大值(如果是颜色设置,则需要提供 color ramp
    • 这个 Scale method 代表,可以是 弗兰纳里, 指数的, Surface 或*半径* *
    • 这个 Exponent 用于数据缩放
    • 输出值或 color 用空值表示功能

当与属性兼容时,将在对话框的右侧显示实时更新预览,以帮助您控制值的缩放。

../../../_images/varying_size_assistant.png

数据定义的大小助手

上面的“可变大小助手”中显示的值将使用::设置“数据定义的覆盖”大小:

coalesce(scale_exp(Importance, 1, 20, 2, 10, 0.57), 1)