QGIS配置¶

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

QGIS是高度可配置的。通过 Settings 菜单,它提供了不同的工具:

选项

options Some basic options for QGIS can be selected using the Options dialog. Select the menu option Settings ‣ options Options. You can modify the options according to your needs. Some of the changes may require a restart of QGIS before they will be effective.

下面介绍了可以自定义选项的选项卡。

注解

插件可以在选项对话框中嵌入其设置

虽然下面只显示核心设置,但请注意,此列表可以扩展为 installed plugins 在标准选项对话框中实现自己的选项。这样就避免了每个插件都有自己的配置对话框,并且只为它们添加了额外的菜单项…

常规设置

区域设置

  • 检查 checkbox Override system locale 如果要使用与系统不同的语言并在 Locale to use instead 组合框。
  • 提供了有关活动系统区域设置的信息。

应用

  • 选择 Style (QGIS restart required) selectString 在“氧气”、“窗户”、“Motif”、“CDE”、“Plastique”和“CleanLooks”之间进行选择;
  • 定义 UI theme selectString . 它可以是“默认”或“夜间映射”;
  • 定义 Icon size selectString
  • 定义 Font 及其 Size . 字体可以 radioButtonOn Qt default 或者自定义的;
  • 改变 Timeout for timed messages or dialogs selectString
  • checkbox Hide splash screen at startup;
  • checkbox Check QGIS version at startup to keep you informed if a newer version is released;
  • checkbox Modeless data source manager dialog to keep the data source manager dialog opened and allow interaction with QGIS interface while adding layers to project;
  • checkbox Use native color chooser dialogs (see 颜色选择器).

项目文件

  • Open project on launch selectString (choose between 'New', 'Most recent', 'Welcome Page', and 'Specific'). When choosing 'Specific' use the browseButton to define the project to use by default. The 'Welcome Page' displays a list of recent projects with screenshot.
  • checkbox Create new project from default project. You have the possibility to press on Set current project as default or on Reset default. You can browse through your files and define a directory where you find your user-defined project templates. This will be added to Project ‣ New From Template. If you first activate checkbox Create new project from default project and then save a project in the project templates folder.
  • checkbox Prompt to save project and data source changes when required to avoid losing changes you made.
  • checkbox Prompt for confirmation when a layer is to be removed
  • checkbox Warn when opening a project file saved with an older version of QGIS. You can always open projects created with older version of QGIS but once the project is saved, trying to open with older release may fail because of features not available in that version.
  • Enable macros selectString. This option was created to handle macros that are written to perform an action on project events. You can choose between 'Never', 'Ask', 'For this session only' and 'Always (not recommended)'.

系统设置

SVG路径

添加或移除 Path(s) to search for Scalable Vector Graphic (SVG) symbols . 这些SVG文件可以用来象征特征或装饰地图组成。

插件路径

添加或移除 Path(s) to search for additional C++ plugin libraries .

文档路径

添加或移除 Documentation Path(s) 用于qgis帮助。默认情况下,会添加与所用版本对应的官方在线用户手册的链接。但是,您可以添加其他链接并从上到下对其进行优先级排序:每次单击 Help 按钮在对话框中,选中最上面的链接,如果找不到对应的页面,则尝试下一个页面,依此类推。

注解

文档仅针对QGIS长期发行版(LTR)进行版本化和翻译,这意味着如果您正在运行定期发行版(如QGIS 3.0),帮助按钮将打开 testing 手册页,可能包含更新版本(3.2和3.4)或开发(3.1和3.3)中功能的描述。

QSettings

它帮助你 Reset user interface to default settings (restart required) 如果你做了什么 customization .

环境

系统环境变量现在可以在 Environment 组(参见图“环境变量”)。这对于平台(如Mac)很有用,因为在这些平台中,GUI应用程序不一定继承用户的shell环境。它还可用于设置和查看由处理工具箱(例如saga、grass)控制的外部工具集的环境变量,以及为源代码的特定部分打开调试输出。

  • checkbox Use custom variables (restart required - include separators). You can Add and Remove variables. Already-defined environment variables are displayed in Current environment variables, and it's possible to filter them by activating checkbox Show only QGIS-specific variables.
../../../_images/sys-env-options.png

QGIS中的系统环境变量

CRS设置

您可以选择 Default CRS for new projects 每次打开新项目时应用。然后,该坐标参考系可以被中的选定值覆盖。 Project ‣ Project properties ‣ CRS 标签。

新层的CRS

此区域允许您定义创建新层或加载没有CRS的层时要采取的操作。

  • radioButtonOn Prompt for CRS
  • radioButtonOff Use project CRS
  • radioButtonOff Use a default CRS

默认基准转换

在此组中,您可以控制将层重新投影到另一个CRS是否应:

  • 使用QGIS默认转换设置自动处理;
  • 和/或更多由您使用自定义首选项控制,例如:
    • checkbox Ask for datum transformation if several are available
    • 默认情况下要应用的数据转换的预定义列表。见 默认基准转换 了解更多详细信息。

注解

有关QGIS如何处理图层投影的更多信息,请阅读以下专用部分: 使用投影 .

../../../_images/crsdialog.png

QGIS中的CRS设置

数据源设置

功能属性和表

  • checkbox Open attribute table in a dock window
  • Copy features as 'Plain text, no geometry', 'Plain text, WKT geometry', or 'GeoJSON' when pasting features in other applications.
  • Attribute table behavior selectString: set filter on the attribute table at the opening. There are three possibilities: 'Show all features', 'Show selected features' and 'Show features visible on map'.
  • Default view: define the view mode of the attribute table at every opening. It can be 'Remember last view', 'Table view' or 'Form view'.
  • Attribute table row cache selectNumber. This row cache makes it possible to save the last loaded N attribute rows so that working with the attribute table will be quicker. The cache will be deleted when closing the attribute table.
  • Representation for NULL values. Here, you can define a value for data fields containing a NULL value.

小技巧

提高大数据属性表的开放性

当处理记录量大的层时,打开属性表可能会很慢,因为对话框请求层中的所有行。设置 Attribute table behaviorShow features visible on map 打开表格时,QGIS只请求当前地图画布中的功能,允许快速加载数据。

请注意,此属性表实例中的数据将始终绑定到其打开时使用的画布范围,这意味着选择 Show All Features 在这样的表中不会显示新功能。但是,您可以通过更改画布范围并选择 Show Features Visible On Map 属性表中的选项。

数据源处理

  • Scan for valid items in the browser dock selectString. You can choose between 'Check extension' and 'Check file contents'.
  • Scan for contents of compressed files (.zip) in browser dock selectString defines how detailed is the widget information at the bottom of the Browser panel when querying such files. 'No', 'Basic scan' and 'Full scan' are possible options.
  • Prompt for raster sublayers when opening. Some rasters support sublayers --- they are called subdatasets in GDAL. An example is netCDF files --- if there are many netCDF variables, GDAL sees every variable as a subdataset. The option allows you to control how to deal with sublayers when a file with sublayers is opened. You have the following choices:
    • “始终”:始终询问(是否存在现有子层)
    • “如果需要”:询问层是否没有带,但有子层
    • “从不”:从不提示,不会加载任何内容
    • “全部加载”:从不提示,但加载所有子层
  • checkbox Ignore shapefile encoding declaration. If a shapefile has encoding information, this will be ignored by QGIS.
  • checkbox Add PostGIS layers with double click and select in extended mode
  • checkbox Add Oracle layers with double click and select in extended mode
  • checkbox Execute expressions on server-side if possible
  • checkbox Evaluate default values defines whether default values from database provider should be calculated when digitizing the new feature (checked status) or when saving the changes.

隐藏浏览器路径

这个小部件列出了您选择隐藏的所有文件夹 Browser panel . 从列表中删除文件夹将使其在浏览器面板中可用。

../../../_images/options_data_sources.png

QGIS中的数据源设置

渲染设置

../../../_images/rendering_menu.png

“项目属性”对话框的“渲染”选项卡

呈现行为

  • unchecked By default new layers added to the map should be displayed: unchecking this option can be handy when loading multiple layers to avoid each new layer being rendered in the canvas and slow down the process
  • checkbox Use render caching where possible to speed up redraws
  • checkbox Render layers in parallel using many CPU cores
  • checkbox Max cores to use
  • Map update interval (default to 250 ms)
  • checkbox Enable feature simplification by default for newly added layers
  • Simplification threshold
  • Simplification algorithm: This option performs a local "on-the-fly" simplification on feature's and speeds up geometry rendering. It doesn't change the geometry fetched from the data providers. This is important when you have expressions that use the feature geometry (e.g. calculation of area) - it ensures that these calculations are done on the original geometry, not on the simplified one. For this purpose, QGIS provides three algorithms: 'Distance' (default), 'SnapToGrid' and 'Visvalingam'.
  • checkbox Simplify on provider side if possible: the geometries are simplified by the provider (PostGIS, Oracle...) and unlike the local-side simplification, geometry-based calculations may be affected
  • Maximum scale at which the layer should be simplified
  • doubleSpinBox Magnification level (see the magnifier)

注解

除了全局设置外,还可以从其 Layer properties ‣ Rendering 菜单。

渲染质量

  • checkbox Make lines appear less jagged at the expense of some drawing performance

曲线分割

  • Segmentation tolerance: this setting controls the way circular arcs are rendered. The smaller maximum angle (between the two consecutive vertices and the curve center, in degrees) or maximum difference (distance between the segment of the two vertices and the curve line, in map units), the more straight line segments will be used during rendering.
  • Tolerance type: it can be Maximum angle or Maximum difference between approximation and curve.

栅格

  • RGB band selection ,您可以定义红色、绿色和蓝色带的编号。

对比度增强

对比度增强选项可应用于 Single band grayMulti band color (byte/band)Multi band color (>byte/band) . 对于每个,您可以设置:

  • 这个 Algorithm 要使用,其值可以是“no stretch”、“stretch to minmax”、“stretch and clip to minmax”或“clip to minmax”
  • 这个 Limits (minimum/maximum) 使用“累计像素计数切割”、“最小/最大”、“平均值+/-标准偏差”等值。

对于栅格渲染,还可以定义以下选项:

  • Cumulative pixel count cut limits
  • Standard deviation multiplier

调试

  • checkbox Map canvas refresh to debug rendering duration in the Log Messages panel.

画布和图例设置

../../../_images/options_canvas_legend.png

画布和图例设置

这些属性允许您设置:

  • 默认映射外观(由项目属性覆盖)Selection colorBackground color .
  • Layer legend interaction:
    • Double click action in legend selectString. You can either 'Open layer properties', 'Open attribute table' or 'Open layer styling dock' with the double click.
    • checkbox Display classification attribute names in the Layers panel, e.g. when applying a categorized or rule-based renderer (see 符号学性质 for more information).
    • 这个 WMS getLegendGraphic Resolution
  • 这个 Delay 以毫秒为单位的层 map tips 显示

地图工具设置

此选项卡提供有关 Identify tool .

  • Search radius for identifying features and displaying map tips is a tolerance distance within which the identify tool will depict results as long as you click within this tolerance.
  • Highlight color allows you to choose with which color should features being identified be highlighted.
  • Buffer determines a buffer distance to be rendered from the outline of the identify highlight.
  • Minimum width determines how thick should the outline of a highlighted object be.

测量工具

  • 定义 Rubberband color 用于测量工具
  • 定义 Decimal places
  • checkbox Keep base unit to not automatically convert large numbers (e.g., meters to kilometers)
  • Preferred distance units radioButtonOn ('Meters', 'Kilometers', 'Feet', 'Yards', 'Miles', 'Nautical Miles', 'Degrees' or 'Map Units' )
  • Preferred area units radioButtonOn ('Square meters', 'Square kilometers', 'Square feet', 'Square yards', 'Square miles', 'Hectares', 'Acres', 'Square nautical miles', 'Square degrees' or 'Map Units')
  • Preferred angle units radioButtonOn ('Degrees', 'Radians', 'Gon/gradians', 'Minutes of arc', 'Seconds of arc' or 'Turns/revolutions')

平移和缩放

  • 定义一个 Zoom factor 用于缩放工具或滚轮鼠标

预定义比例

在这里,您可以找到一个预定义比例的列表。与 signPlussignMinus 按钮,您可以添加或删除您的个人秤。您还可以从/到导入或导出比例 .XML 文件。请注意,您仍然可以删除更改并重置为预定义列表。

../../../_images/options_map_tools.png

QGIS中的地图工具设置

颜色设置

此菜单允许您创建或更新整个应用程序中使用的调色板 color selector widget . 您可以选择:

  • Recent colors showing recently used colors
  • Standard colors, the default palette of colors
  • Project colors, a set of colors specific to the current project (see 默认样式属性 for more details)
  • New layer colors, a set of colors to use by default when new layers are added to QGIS
  • 或自定义调色板,您可以使用 ... “调色板”组合框旁边的按钮。

默认情况下, Recent colorsStandard colorsProject colors 无法删除调色板,并将其设置为显示在“颜色”按钮下拉列表中。由于 Show in Color Buttons 选择权。

对于任何调色板,可以使用框架旁边的一组工具来管理颜色列表,即:

  • signPlus Add or signMinus Remove color
  • editCopy Copy or editPaste Paste color
  • fileOpen Import or fileSave Export the set of colors from/to .gpl file.

双击列表中的颜色以在 Color Selector 对话框。您也可以通过双击 Label 列。

../../../_images/options_colors.png

颜色设置

数字化设置

此选项卡可帮助您在以下情况下配置常规设置: editing vector layer (属性和几何)。

功能创建

  • checkbox Suppress attribute form pop-up after feature creation: this choice can be overridden in each layer properties dialog.
  • checkbox Reuse last entered attribute values.
  • Validate geometries. Editing complex lines and polygons with many nodes can result in very slow rendering. This is because the default validation procedures in QGIS can take a lot of time. To speed up rendering, it is possible to select GEOS geometry validation (starting from GEOS 3.3) or to switch it off. GEOS geometry validation is much faster, but the disadvantage is that only the first geometry problem will be reported.
  • Default Z value to use when creating new 3D features.

橡皮筋

  • 定义橡皮圈 Line widthLine colorFill color .
  • Don't update rubberband during vertex editing.

抢购

  • checkbox Enable snapping by default
  • 定义 Default snap mode selectString ('vertex'、'vertex and segment'、'segment')
  • 定义 Default snapping tolerance 以地图单位或像素为单位
  • 定义 Search radius for vertex edits 以地图单位或像素为单位
  • Display main dialog as (restart required): set whether the Advanced Snapping dialog should be shown as 'Dialog' or 'Dock'.
  • Snapping marker color
  • checkbox Show snapping tooltips such as name of the layer whose feature you are about to snap. Helpful when multiple features overlap.
  • checkbox Enable snapping on invisible features

顶点标记

  • checkbox Show markers only for selected features
  • 定义顶点 Marker style selectString ('cross'(默认)、'semi-transparent circle'或'none')
  • 定义顶点 Marker size

曲线偏移工具

接下来的3个选项是指 offsetCurve Offset Curve 工具在 高级数字化 . 通过各种设置,可以影响线偏移的形状。这些选项可以从GEOS 3.3开始。

  • Join style: 'Round', 'Mitre' or 'Bevel'
  • Quadrant segments
  • Miter limit
../../../_images/options_digitizing.png

QGIS中的数字化设置

布局设置

合成默认值

您可以定义 Default font 用于 print layout .

网格外观

  • 定义 Grid style selectString ('solid'、'dots'、'crosses')
  • 定义 Grid color

网格和指南默认值

  • 定义 Grid spacing selectNumber
  • 定义 Grid offset selectNumber 对于X和Y
  • 定义 Snap tolerance selectNumber

布局路径

  • 定义 Path(s) to search for extra print templates :创建新布局模板时要使用的具有自定义布局模板的文件夹列表。
../../../_images/options_layouts.png

QGIS中的布局设置

GDAL设置

gdal是用于栅格文件的数据交换库。在这个选项卡中,您可以 Edit create optionsEdit Pyramids Options 栅格格式。您可以定义用于栅格格式的GDAL驱动程序,因为在某些情况下有多个GDAL驱动程序可用。

../../../_images/options_gdal.png

qgis中的gdal设置

变量设置

这个 Variables 选项卡列出全局级别的所有可用变量。

它还允许用户管理全局级变量。单击 signPlus 按钮添加新的自定义全局级别变量。同样,从列表中选择自定义全局级别变量,然后单击 signMinus 按钮将其移除。

有关中变量的详细信息 在变量中存储值 部分。

../../../_images/options_variables_global.png

QGIS中的变量设置

身份验证设置

Authentication 选项卡可以设置身份验证配置和管理PKI证书。见 认证系统 了解更多详细信息。

../../../_images/auth-editor-configs21.png

qgis中的身份验证设置

网络设置

一般

  • 定义 WMS search address 默认为 http://geopole.org/wms/search?search=\%1\&type=rss
  • 定义 Timeout for network requests (ms) -默认值为60000
  • 定义 Default expiration period for WMS Capabilities (hours) 默认值为24
  • 定义 Default expiration period for WMSC/WMTS tiles (hours) 默认值为24
  • 定义 Max retry in case of tile or feature request errors
  • 定义 User-Agent
../../../_images/proxy-settings.png

QGIS中的代理设置

缓存设置

定义 Directory 和A Size 用于缓存。还提供工具 automatically clear the connection authentication cache on SSL errors (recommanded) .

Web访问代理

  • checkbox Use proxy for web access
  • 设置 Proxy type selectString 根据您的需要,定义“主机”和“端口”。可用的代理类型包括:
    • Default Proxy: Proxy is determined based on system's proxy
    • Socks5Proxy: Generic proxy for any kind of connection. Supports TCP, UDP, binding to a port (incoming connections) and authentication.
    • HttpProxy: Implemented using the "CONNECT" command, supports only outgoing TCP connections; supports authentication.
    • HttpCachingProxy: Implemented using normal HTTP commands, it is useful only in the context of HTTP requests.
    • FtpCachingProxy: Implemented using an FTP proxy, it is useful only in the context of FTP requests.

代理的凭据是使用 authentication widget .

排除一些URL可以添加到代理设置下面的文本框中(参见图“网络”选项卡)。

If you need more detailed information about the different proxy settings, please refer to the manual of the underlying QT library documentation at https://doc.qt.io/qt-5.9/qnetworkproxy.html#ProxyType-enum

小技巧

使用代理

使用代理有时候很棘手。对上述代理类型进行“试错”,以检查它们在您的案例中是否成功,这很有用。

定位器设置

search The Locator tab allows to configure the Locator bar, a quick search widget available on the status bar that helps you perform searches anywhere in the application. It provides some default filters (with prefix) to use:

  • 项目层( l ):查找并选择 Layers 面板。
  • 项目布局( pl ):查找并打开打印布局。
  • 行动( . ):查找并执行QGIS操作;操作可以是QGIS中的任何工具或菜单,打开面板…
  • 活动层功能( f ):在当前活动层的任何字段中搜索匹配的属性,并缩放到所选功能。
  • 所有层中的功能( af ):在中搜索匹配的属性 display name 每一个 searchable layers 并缩放到所选功能。
  • 计算器(计算器) = ):允许计算任何QGIS表达式,如果有效,则提供将结果复制到剪贴板的选项。
  • 空间书签( b ):查找并缩放到书签范围。
  • 设置( set ):浏览并打开项目和应用程序范围的属性对话框。
  • 加工( a ):搜索并打开处理算法对话框。
  • 编辑所选功能( ef ):提供快速访问并运行兼容的 modify-in-place 在活动层上处理算法。

对于每个过滤器,您可以自定义过滤器,设置它是否在默认情况下启用。默认定位器过滤器集可以通过插件进行扩展,例如用于OSM提名搜索、直接数据库搜索、层目录搜索。

可以启动定位器搜索栏,按 Ctrl+K . 键入文本以执行搜索。默认情况下,返回所有已启用的定位器过滤器的结果,但您可以通过在文本前加上定位器过滤器前缀(即键入 l cad 将只返回其名称包含 cad . 根据项目类型,单击结果执行相应的操作。

搜索是使用线程处理的,因此无论是否安装了任何较慢的搜索筛选器,搜索结果总是尽可能快地可用。它们也会在每个过滤器遇到每个结果时立即出现,这意味着,例如,文件搜索过滤器将在扫描文件树时逐个显示结果。这样可以确保即使存在非常慢的搜索过滤器(例如使用在线服务的过滤器),用户界面也始终具有响应性。

小技巧

快速访问定位器配置

点击 search 状态栏上的定位器小部件内的图标,用于显示可以使用的过滤器列表和 Configure 打开 Locator 表中的 Settings ‣ Options... 菜单。

../../../_images/options_locator.png

QGIS中的定位器设置

高级设置

根据您的操作系统,与QGIS相关的所有设置(UI、工具、数据提供程序、默认值、插件选项…)都将保存:

  • nix in a text file: $HOME/.config/QGIS/QGIS2.conf
  • osx in the properties list file: $HOME/Library/Preferences/org.qgis.qgis.plist
  • win in the registry under: HKEY\CURRENT_USER\Software\QGIS\qgis

这个 Advanced 无论您的操作系统是什么,选项卡都为您提供了一个单独的位置,通过 Advanced Settings Editor . 在您保证要小心之后,这个小部件被填充了一个包含所有QGIS设置的树,您可以直接编辑这些设置。

警告

避免盲目使用高级选项卡设置

在自动应用更改的情况下,修改此对话框中的项目时要小心。在没有知识的情况下进行更改会以各种方式破坏您的QGIS安装。

../../../_images/options_advanced.png

QGIS中的高级设置选项卡

处理设置

这个 processing Processing 选项卡为您提供QGIS处理框架中使用的工具和数据提供程序的常规设置。更多信息,请访问 QGIS处理框架 .

../../../_images/options_processing.png

qgis中的“处理设置”选项卡

使用用户配置文件

这个 Settings ‣ User Profiles 菜单提供设置和访问用户配置文件的功能。用户配置文件是允许存储在单个文件夹中的统一应用程序配置:

默认情况下,QGIS安装包含一个名为 default . 但您可以创建任意多个用户配置文件:

  1. 单击 New profile... 条目。

  2. 系统将提示您提供配置文件名,并在下面创建同名文件夹 ~/<UserProfiles>/ 在哪里?

    • ~ represents the HOME directory, which on win Windows is usually something like C:\Users\(user).
    • <UserProfiles> 表示主配置文件文件夹,即:
      • nix .local/share/QGIS/QGIS3/profiles/
      • win AppData\Roaming\QGIS\QGIS3\profiles\
      • osx Library/Application Support/QGIS/QGIS3/profiles/

    用户配置文件文件夹可以使用 Open Active Profile Folder .

  3. 新的概要文件使用安装时干净且不变的配置打开了一个新的QGIS实例。然后可以设置自定义配置。

由于每个用户配置文件都包含独立的设置、插件和历史记录,因此它们对于不同的工作流、演示、同一台计算机的用户或测试设置等都非常有用,您可以通过在 Settings ‣ User Profiles 菜单。您还可以使用来自 command line .

除非更改,最后一次关闭的QGIS会话的配置文件将在以下QGIS会话中使用。

小技巧

在新的用户配置文件下运行qgis以检查错误持久性

当您在QGIS中遇到一些函数的奇怪行为时,请创建一个新的用户配置文件并再次运行这些命令。有时,错误与当前用户配置文件中的一些剩余部分相关,创建一个新的错误可能会在使用新的(干净的)配置文件重新启动QGIS时修复它们。

项目属性

在项目的“属性”窗口中 Project ‣ Project Properties ,可以设置特定于项目的选项。特定于项目的选项在 Options 上述对话框。

常规属性

General 选项卡 General settings 让你:

  • 查看项目文件的位置
  • 设置项目主页的文件夹(在 Project Home 浏览器中的项)。路径可以是相对于项目文件的文件夹(键入)或绝对路径。项目主页可用于存储数据和其他对项目有用的内容。
  • 在项目文件路径旁边为项目赋予标题
  • 选择要用于选定功能的颜色
  • 选择背景色:用于地图画布的颜色
  • 设置项目中层的路径应保存为绝对(完整)还是相对于项目文件位置。当可以移动或共享层和项目文件,或者从不同平台上的计算机访问项目时,您可能更喜欢相对路径。
  • 选择在项目呈现为地图图块时避免出现项目。请注意,选中此选项可能会导致性能下降。

计算面积和距离是地理信息系统的一个常见需求。但是,这些值实际上与基础投影设置相关。这个 Measurements 框架允许您控制这些参数。您确实可以选择:

  • 这个 Ellipsoid ,距离和面积计算完全基于此;它可以是:
    • None/Planimetric: returned values are in this case cartesian measurements.
    • Custom 一:您需要设置半长轴和半短轴的值。
    • 或预先确定的列表中的现有列表(Clarke 1866、Clarke 1880 IGN、New International 1967、WGS 84…)。
  • 这个 units for distance measurements 长度和周长以及 units for area measurements . 这些设置默认为qgis选项中设置的单位,但随后会覆盖当前项目的单位,用于:
    • 属性表字段更新栏
    • 现场计算器计算
    • 确定工具导出的长度、周长和面积值
    • 度量值对话框中显示的默认单位

这个 Coordinate display 允许您选择和自定义用于在状态栏中显示鼠标坐标和通过标识工具显示的导出坐标的单位格式。

最后,您可以设置 Project predefined scales 列表,它覆盖全局预定义的比例。

../../../_images/project_general.png

项目属性对话框的常规选项卡

原数据属性

这个 Metadata 选项卡允许定义详细的元数据,包括(在其他元数据中):作者、创建日期、语言、摘要、类别、关键字、联系人详细信息、链接、历史记录。还有一个验证功能,用于检查特定字段是否已填充,但这并不强制执行。见 vector layer metadata properties 了解一些细节。

CRS特性

这个 crs CRS 选项卡帮助您设置要在此项目中使用的坐标参考系。它可以是:

  • checkbox No projection (or unknown/non-Earth projection): this setting can be used to guess a layer CRS or when using QGIS for non earth uses like role-playing game maps, building mapping or microscopic stuff. In this case:
    • 渲染层时不进行重投影:仅使用原始坐标绘制功能。
    • 椭球体被锁定并强制 None/Planimetric .
    • 距离和面积单位以及坐标显示被锁定并强制为“未知单位”;所有测量均以未知地图单位进行,无法进行转换。
  • 或现有的坐标参考系 地理的, projected 或 用户定义的. 将显示地球上CRS范围的预览,以帮助您选择合适的范围。添加到项目中的层正在转换为此CRS,以便覆盖它们,而不管它们的原始CRS是什么。使用单位,椭球体设置是可用的和有意义的,您可以执行相应的计算。

这个 crs CRS 选项卡还可以通过配置要在当前项目中应用的基准转换首选项来帮助控制图层重投影设置。与往常一样,这些设置会覆盖任何相应的全局设置。见 默认基准转换 了解更多详细信息。

默认样式属性

这个 Default Styles 选项卡允许您控制当新图层没有现有图层时在项目中绘制新图层的方式。 .qml 样式定义。你可以:

  • 设置默认符号( MarkerLineFill )根据图层几何类型和默认值应用 Color Ramp
  • 应用默认值 Opacity 新层
  • checkbox Assign random colors to symbols, modifying the symbols fill colors, hence avoiding same rendering for all layers.
../../../_images/project_default_styles.png

默认样式选项卡

使用 styleManager Style Manager 按钮,还可以快速访问 Style Manager 对话并配置符号和颜色渐变。

还有一个附加部分,您可以在其中为正在运行的项目定义特定的颜色。像 global colors 你可以:

  • signPlus Add or signMinus Remove color
  • editCopy Copy or editPaste Paste color
  • fileOpen Import or fileSave Export the set of colors from/to .gpl file.

双击列表中的颜色以在 Color Selector 对话框。您也可以通过双击 Label 列。

这些颜色被识别为 Project colors 列为 color widgets .

小技巧

使用项目颜色快速分配和更新颜色小部件

项目颜色可以参考使用它们的标签,并且它们使用的颜色小部件绑定到它们。这意味着,不必为许多属性重复设置相同的颜色,为了避免繁琐的更新,您可以:

  1. 将颜色定义为项目颜色
  2. 使用 project_color('color_label') 颜色中的表达式 data defined override widget
  3. 更新颜色一次 Project colors 列表
  4. 这种变化无处不在。

数据源属性

Data Sources 选项卡,您可以:

  • unchecked Automatically create transaction groups where possible: When this mode is turned on, all (postgres) layers from the same database are synchronised in their edit state, i.e. when one layer is put into edit state, all are, when one layer is committed or one layer is rolled back, so are the others. Also, instead of buffering edit changes locally, they are directly sent to a transaction in the database which gets committed when the user clicks save layer. Note that you can (de)activate this option only if no layer is being edited in the project.
  • unchecked Evaluate default values on provider side: When adding new features in a PostgreSQL table, fields with default value constraint are evaluated and populated at the form opening, and not at the commit moment. This means that instead of an expression like nextval('serial'), the field in the Add Feature form will display expected value (e.g., 25).
  • unchecked Trust project when data source has no metadata: To speed up project loading by skipping data checks. Useful in QGIS Server context or in projects with huge database views/materialized views. The extent of layers will be read from the QGIS project file (instead of data sources) and when using the PostgreSQL provider the primary key unicity will not be checked for views and materialized views.
  • 配置 Layers Capabilities ,即:

    • 设置(或禁用)哪些层是 identifiable ,即将响应 identify tool . 默认情况下,层设置为可查询。
    • 设置层是否应显示为 read-only ,这意味着无论数据提供程序的功能如何,用户都无法对其进行编辑。虽然这是一个弱保护,但它仍然是一个快速和方便的配置,以避免最终用户在处理基于文件的层时修改数据。
    • 定义哪些层是 searchable ,也就是说,可以使用 locator widget . 默认情况下,层设置为可搜索。
    • 定义将哪些层定义为 required . 此列表中选中的层将受到保护,以防从项目中意外删除。

    这个 Layers Capabilities 表提供了一些方便的工具:

    • 选择多个单元格并按 Toggle Selection 让他们更改复选框状态;
    • unchecked Show spatial layers only, filtering out non-spatial layers from the layers list;
    • search Filter layers... and quickly find a particular layer to configure.

关系属性

这个 Relations 选项卡用于定义1:n关系。关系在“项目属性”对话框中定义。一旦一个层存在关系,表单视图中的一个新用户界面元素(例如,当识别一个特性并打开它的表单时)将列出相关的实体。这提供了一种强有力的表达方式,例如,管道或路段长度上的检查历史。您可以在第节中找到有关1:n关系支持的更多信息。 创建一个或多对多关系 .

变量属性

这个 Variables 选项卡列出项目级别的所有可用变量(包括所有全局变量)。此外,它还允许用户管理项目级变量。单击 signPlus 按钮添加新的自定义项目级变量。同样,从列表中选择一个自定义项目级变量,然后单击 signMinus 按钮将其移除。有关常规工具中变量用法的详细信息 在变量中存储值 部分。

宏属性

这个 Macros 选项卡用于编辑项目的python宏。目前,只有三个宏可用: openProject()saveProject()closeProject() .

../../../_images/macro.png

QGIS中的宏设置

QGIS服务器属性

选项卡 QGIS Server 允许您配置项目以便联机发布。在这里,您可以定义有关QGIS服务器WMS和WFS功能、范围和CRS限制的信息。有关更多信息,请参见 配置项目 随后。

定制

自定义对话框允许您(取消)激活qgis用户界面中的几乎所有元素。如果你想为你的终端用户提供一个“轻量”版本的QGIS,它只包含他们需要的图标、菜单或面板,那么这非常有用。

注解

在应用更改之前,需要重新启动QGIS。

../../../_images/customization.png

自定义对话框

滴答声 checkbox Enable customization 复选框是进行QGIS定制的第一步。这将启用工具栏和窗口小部件面板,从中可以取消选中,从而禁用某些GUI项。

可配置项可以是:

select Switch to catching widgets in main application ,您可以在qgis界面中单击要隐藏的项目,qgis会自动取消选中自定义对话框中的相应条目。

设置配置后,单击 ApplyOK 验证您的更改。此配置将成为QGIS在下次启动时默认使用的配置。

修改也可以保存在 .ini 文件使用 fileSave Save To File 按钮。这是一种在多个用户之间共享通用QGIS接口的简便方法。只需点击 fileOpen Load from File 从目标计算机导入 .ini 文件。你也可以跑步 command line tools 并为不同的用例保存各种设置。

小技巧

轻松恢复预定义的QGIS

可以通过以下方法之一恢复初始的QGIS GUI配置:

  • 不检查 checkbox Enable customization 在“自定义”对话框中选择或单击 selectAllTree Check All 按钮
  • 按压 Reset 按钮在 QSettings 框架下 Settings ‣ Options 菜单, System 标签
  • 使用以下命令行在命令提示下启动QGIS qgis --nocustomization
  • 设置为 false 价值 UI ‣ Customization ‣ Enabled 变量下 Settings ‣ Options 菜单, Advanced 选项卡(见 warning

在大多数情况下,您需要重新启动QGIS才能应用更改。

键盘快捷键

QGIS为许多功能提供默认的键盘快捷键。你可以在部分找到它们 菜单栏 . 此外,菜单选项 Settings ‣ keyboardShortcuts Keyboard Shortcuts... 允许您更改默认键盘快捷方式,并将新快捷方式添加到QGIS功能中。

../../../_images/shortcuts.png

定义快捷方式选项

配置非常简单。使用对话框顶部的搜索框查找特定操作,从列表中选择该操作并单击:

对于您希望自定义的任何其他工具,请按照上述步骤进行操作。完成配置后,只需 Close 应用更改的对话框。你也可以 Save 作为一个 .XML 文件和 Load 它们被安装到另一个QGIS装置中。

使用高级设置运行QGIS

我们已经看到了 launching QGIS 对于操作系统上的任何应用程序。但是,QGIS为更高级的用例提供了命令行选项。要获取选项列表,请输入 qgis --help 在命令行上,返回:

QGIS - 3.4.3-Madeira 'Madeira' (2f64a3c4e7)
QGIS is a user friendly Open Source Geographic Information System.
Usage: /usr/bin/qgis.bin [OPTION] [FILE]
  OPTION:
        [--snapshot filename]   emit snapshot of loaded datasets to given file
        [--width width] width of snapshot to emit
        [--height height]       height of snapshot to emit
        [--lang language]       use language for interface text (changes existing override)
        [--project projectfile] load the given QGIS project
        [--extent xmin,ymin,xmax,ymax]  set initial map extent
        [--nologo]      hide splash screen
        [--noversioncheck]      don't check for new version of QGIS at startup
        [--noplugins]   don't restore plugins on startup
        [--nocustomization]     don't apply GUI customization
        [--customizationfile path]      use the given ini file as GUI customization
        [--globalsettingsfile path]     use the given ini file as Global Settings (defaults)
        [--authdbdirectory path] use the given directory for authentication database
        [--code path]   run the given python file on load
        [--defaultui]   start by resetting user ui settings to default
        [--hide-browser]        hide the browser widget
        [--dxf-export filename.dxf]     emit dxf output of loaded datasets to given file
        [--dxf-extent xmin,ymin,xmax,ymax]      set extent to export to dxf
        [--dxf-symbology-mode none|symbollayer|feature] symbology mode for dxf output
        [--dxf-scale-denom scale]       scale for dxf output
        [--dxf-encoding encoding]       encoding to use for dxf output
        [--dxf-map-theme maptheme]      map theme to use for dxf output
        [--take-screenshots output_path]        take screen shots for the user documentation
        [--screenshots-categories categories]   specify the categories of screenshot to be used (see QgsAppScreenShots::Categories).
        [--profile name]        load a named profile from the user's profiles folder.
        [--profiles-path path]  path to store user profile folders. Will create profiles inside a {path}\profiles folder
        [--version-migration]   force the settings migration from older version if found
        [--openclprogramfolder]         path to the folder containing the sources for OpenCL programs.
        [--help]                this text
        [--]            treat all following arguments as FILEs

  FILE:
    Files specified on the command line can include rasters,
    vectors, and QGIS project files (.qgs and .qgz):
     1. Rasters - supported formats include GeoTiff, DEM
        and others supported by GDAL
     2. Vectors - supported formats include ESRI Shapefiles
        and others supported by OGR and PostgreSQL layers using
        the PostGIS extension

小技巧

使用命令行参数的示例

可以通过在命令行上指定一个或多个数据文件来启动QGIS。例如,假设您在 qgis_sample_data 目录中,可以使用向量层和栅格文件启动qgis,该文件设置为在启动时使用以下命令加载: qgis ./raster/landcover.img ./gml/lakes.gml

--snapshot option

此选项允许您从当前视图创建PNG格式的快照。当您有许多项目并且希望从数据中生成快照,或者需要使用更新的数据创建同一项目的快照时,这一点非常有用。

目前,它生成一个800x600像素的PNG文件。可以使用 --width--height 争论。文件名可以添加到 --snapshot . 例如::

qgis --snapshot my_image.png --width 1000 --height 600 --project my_project.qgs

--lang option

基于您的区域设置,QGIS选择正确的本地化。如果要更改语言,可以指定语言代码。例如, qgis --lang it 在意大利本地化中启动qgis。

--project option

也可以使用现有的项目文件启动QGIS。只需添加命令行选项 --project 接下来是项目名称和QGIS,将打开给定文件中的所有层。

--extent option

要从特定的映射范围开始,请使用此选项。您需要按以下顺序添加范围的边界框,用逗号分隔:

--extent xmin,ymin,xmax,ymax

当与 --project 在所需范围内打开特定项目的选项。

--nologo option

此选项在启动QGIS时隐藏启动屏幕。

--noversioncheck option

启动时跳过搜索新版本的qgis。

--noplugins option

如果在启动插件时遇到问题,可以使用此选项避免在启动时加载插件。之后,插件管理器仍然可以使用它们。

--nocustomization option

使用此选项,任何现有 GUI customization 不会在启动时应用。这意味着任何隐藏的按钮、菜单项、工具栏等都将在QGIS启动时显示。这不是永久性的改变。如果在没有此选项的情况下启动QGIS,将再次应用自定义。

此选项对于临时允许访问自定义删除的工具很有用。

--customizationfile

使用此选项,您可以定义一个UI自定义文件,该文件将在启动时使用。

--globalsettingsfile option

使用此选项,可以指定全局设置文件的路径( .ini ,也称为默认设置。指定文件中的设置将替换原始的内联默认设置,但用户配置文件的设置将设置在这些设置之上。

目前,无法指定要写入设置的文件;因此,可以创建原始设置文件的副本、重命名并对其进行调整。

设置 qgis_global_setting.ini 网络共享文件夹的文件路径,允许系统管理员仅通过编辑一个文件来更改多台计算机中的全局设置和默认值。

--authdbdirectory option

此选项类似于 --globalsettingsfile ,但定义将存储和加载身份验证数据库的目录的路径。

--code option

此选项可用于在QGIS启动后直接运行给定的python文件。

例如,当您有一个名为 load_alaska.py 内容如下:

from qgis.utils import iface
raster_file = "/home/gisadmin/Documents/qgis_sample_data/raster/landcover.img"
layer_name = "Alaska"
iface.addRasterLayer(raster_file, layer_name)

假设您在文件所在的目录中 load_alaska.py 定位后,可以启动qgis,加载栅格文件 landcover.img 并使用以下命令将层命名为“alaska”:

qgis --code load_alaska.py

--defaultui option

载重, permanently resets 默认设置的用户界面(UI)。此选项将恢复面板和工具栏的可见性、位置和大小。除非再次更改,否则在以下会话中将使用默认的UI设置。

请注意,此选项对 GUI customization . 即使使用 --defaultui 选择权。也见 --nocustomization 选择权。

--hide-browser option

加载时,隐藏 Browser 用户界面的面板。可以通过右键单击工具栏中的空间或使用 View ‣ PanelsSettings ‣ Panels 在里面 kde Linux KDE)。

除非再次启用,否则浏览器面板将在以下会话中保持隐藏状态。

--dxf-* option

这些选项可用于将QGIS项目导出到DXF文件中。有几种选择:

--take-screenshots option

为用户文档截图。可与一起使用 --screenshots-categories 要筛选应创建哪些类别/部分文档截图(请参见qgsappscreenshots::categories)。

--profile option

使用用户配置文件文件夹中的特定配置文件加载QGIS。除非更改,所选配置文件将在以下QGIS会话中使用。

--profiles-path option

使用此选项,可以选择加载和保存配置文件的路径(用户设置)。它在 {{path}}\profiles 文件夹,其中包括设置、已安装的插件、处理模型和脚本等。

例如,此选项允许您在闪存驱动器中携带所有插件和设置,或者,例如,使用文件共享服务在不同计算机之间共享设置。

--version-migration option

如果找到旧版本的设置(E.G.,则 .qgis2 文件夹来自qgis 2.18),此选项将把它们导入到默认的qgis配置文件中。

--openclprogramfolder option

使用此选项,您可以为OpenCL程序指定另一个路径。这对于开发人员来说很有用,因为在测试程序的新版本时,不需要替换现有版本。