【译】QGIS培训手册-样式(2)

3.2.5. moderate 跟我做:缩放可视性Follow Along: Scale-Based Visibility

有时候你会发现,在给定的比例尺下,某些图层的表现会不太好。例如,各大洲的数据集可能不会有详细信息,当缩放到街道一级时就会不准确。当发生这种情况时,我们需要能够隐藏在不恰当的尺度下的数据集。(Sometimes you will find that a layer is not suitable for a given scale. For example, a dataset of all the continents may have low detail, and not be very accurate at street level. When that happens, you want to be able to hide the dataset at inappropriate scales.)

在本例中,我们要在把建筑物在缩放到小尺度时隐藏起来。如下图所示…(In our case, we may decide to hide the buildings from view at small scales. This map, for example …)

../../../_images/buildings_small_scale.png

……在这种尺度下,建筑物缩成一团很难辨认。(… is not very useful. The buildings are hard to distinguish at that scale.)

开启依赖于地图比例尺的可见性:(To enable scale-based rendering:)

  • 打开 buildings  图层的 图层属性 对话框。(Open the Layer Properties dialog for the buildings layer.)
  • 激活 通用 标签。(Activate the General tab.)
  • 勾选依赖于地图比例尺的可见性前面的复选框:(Enable scale-based rendering by clicking on the checkbox labeled Scale dependent visibility:)

../../../_images/scale_dependent_visibility.png

  • 将 Maximum的值调整到 1:10,000。(Change the Maximum value to 1:10,000.)
  • 点击确定。(Click OK.)

通过放大和缩小你的地图来检查效果,建筑物层会随着缩小和放大而消失和再现。(Test the effects of this by zooming in and out in your map, noting when the buildings layer disappears and reappears.)

Note

你可以使用鼠标滚轮来放大或缩小画面,或者,你可以通过缩放工具来缩放到某个范围:You can use your mouse wheel to zoom in increments. Alternatively, use the zoom tools to zoom to a window:

mActionZoomInmActionZoomOut

3.2.6. moderate跟我做:添加符号图层 Follow Along: Adding Symbol Layers

现在,你知道如何更改图层的简单符号了, 下一步是创建更复杂的符号系统。QGIS 允许你使用符号图层执行此操作。【译者注:所谓符号图层就是打开图层属性后,在“样式”tab下面有个框,框下班有加减号的图标等,在QGIS2.8等版本中,这个框的上面已经没有“Symbol layers”等字样了】(Now that you know how to change simple symbology for layers, the next step is to create more complex symbology. QGIS allows you to do this using symbol layers.)

  • 回到 landuse 层的样式属性面板中(通过在符号图层中点击简单填充)。(Go back to the landuse layer’s symbol properties panel (by clicking Simple fill in theSymbol layers panel).)

在此例中,当前的样式并没有边框。(即采用了不显示画笔的样式)In this example, the current symbol has no outline (i.e., it uses the No Pen border style).

选择符号图层面板中的填充,然后点击添加符号图层按钮。Select the Fill in the Symbol layers panel. Then click the Add symbol layer button:

../../../_images/add_symbol_layer_button.png

  • 点击它,画面会变为如下所示:(Click on it and the dialog will change to look somewhat like this:)

../../../_images/new_symbol_layer.png

(可能它的颜色会略有不同,但我们马上就会更改它了。)(It may appear somewhat different in color, for example, but you’re going to change that anyway.)

现在有第二个符号图层了。这个图层为简单填充(纯色),所以他会完全将之前的图层盖住。而且,它还有我们不想显示的实线边框样式。所以,我们要对它进行改造。(Now there’s a second symbol layer. Being a solid color, it will of course completely hide the previous kind of symbol. Plus, it has a Solid Line border style, which we don’t want. Clearly this symbol has to be changed.)

Note

记住不要把地图图层和符号图层弄混了。地图图层是一个已加载到地图中的矢量 (或栅格)数据。符号图层是用来表示一个图层符号样式的一部分。本课程将通常将地图图层称为图层,但符号图层将始终会用符号图层来称呼,以防止混淆。It’s important not to get confused between a map layer and a symbol layer. A map layer is a vector (or raster) that has been loaded into the map. A symbol layer is part of the symbol used to represent a map layer. This course will usually refer to a map layer as just a layer, but a symbol layer will always be called a symbol layer, to prevent confusion.

当新建的简单填充的层被选中后:With the new Simple Fill layer selected:

  • 将边界样式像之前那样设置为不显示画笔。(Set the border style to No Pen, as before.)
  • 将填充样式改为除实线填充【译者注:QGIS2.8中此处显示为实现填充,但不准确,应该是实物填充之类的?】或没有画笔之外的其他样式:(Change the fill style to something other than Solid or No brush. For example:)

../../../_images/new_fill_settings.png

  • 点击确定。现在你可以看到你的结果和并按需要调整它们。(Click OK. Now you can see your results and tweak them as needed.)

你甚至可以添加多个额外符号图层,并用这种方式为你的图层创建一种纹理。(You can even add multiple extra symbol layers and create a kind of texture for your layer that way.)

../../../_images/multiple_symbol_layers.png

这很有趣,但是对于制作一张地图来说,颜色太花哨了。(It’s fun! But it probably has too many colors to use in a real map…)

3.2.7. moderate Try Yourself

  • 现在用上面的方法为建筑物图层创建一个简单,但又不杂乱的纹理吧。记住如果需要的话要放大,否则建筑物显示不出来哦。(Remembering to zoom in if necessary, create a simple, but not distracting texture for thebuildings layer using the methods above.)

Check your results

《【译】QGIS培训手册-样式(2)》有一个想法

发表评论

电子邮件地址不会被公开。 必填项已用*标注

填写验证码: *