3. 矢量数据

GentleLogo

目标:

理解地理信息系统中使用的矢量数据模型。

关键词:

矢量、点、折线、面、折点、几何图形、比例、数据质量、符号系统、数据源

3.1. 概述

Vector data provide a way to represent real world features within the GIS environment. A feature is anything you can see on the landscape. Imagine you are standing on the top of a hill. Looking down you can see houses, roads, trees, rivers, and so on (see 图 3.28). Each one of these things would be a feature when we represent them in a GIS Application. Vector features have attributes, which consist of text or numerical information that describe the features.

../../_images/landscape.jpg

图 3.28 俯瞰风景,你可以看到主要的特征,如道路、房屋和树木。

矢量要素的形状使用表示 geometry 。几何由一个或多个相互连接的几何组成 vertices 。顶点用来描述空间中的位置 XY 并且可选地 Z 轴心。其顶点带有 Z 轴通常被称为 2.5D 因为它们描述了每个顶点的高度或深度,但不是两者都描述。

When a feature's geometry consists of only a single vertex, it is referred to as a point feature (see illustration 图 3.29). Where the geometry consists of two or more vertices and the first and last vertex are not equal, a polyline feature is formed (see illustration 图 3.30). Where three or more vertices are present, and the last vertex is equal to the first, an enclosed polygon feature is formed (see illustration 图 3.31).

../../_images/point_feature.png

图 3.29 点要素由其X、Y和可选的Z坐标来描述。点属性描述点,例如,如果它是树或灯柱。

../../_images/polyline_feature.png

图 3.30 多段线是一系列连接的顶点。每个顶点都有一个X、Y(和可选的Z)坐标。属性描述多段线。

../../_images/polygon_feature.png

图 3.31 像多段线一样,多边形是一系列顶点。但是,在多边形中,第一个和最后一个顶点始终位于同一位置。

Looking back at the picture of a landscape we showed you further up, you should be able to see the different types of features in the way that a GIS represents them now (see illustration 图 3.32).

../../_images/landscape_geometry.jpg

图 3.32 我们将在地理信息系统中呈现它们的景观要素。河流(蓝色)和道路(绿色)可以表示为线,树木表示为点(红色),房屋表示为多边形(白色)。

3.2. 详细介绍点要素

在讨论点要素时,我们需要意识到的第一件事是,我们在地理信息系统中描述的点是一个观点问题,通常取决于比例。以城市为例,我们来看看。如果您有一张小比例地图(覆盖大片区域),则使用点要素来表示城市可能是有意义的。然而,当您放大地图,朝着更大的比例移动时,将城市边界显示为多边形更有意义。

当您选择使用点来表示要素时,主要取决于比例(您与要素的距离有多远)、便利性(创建点要素比面要素花费更少的时间和精力)以及要素的类型(某些东西,如电线杆,存储为面没有意义)。

As we show in illustration 图 3.29, a point feature has an X, Y and optionally, Z value. The X and Y values will depend on the Coordinate Reference System (CRS) being used. We are going to go into more detail about Coordinate Reference Systems in a later tutorial. For now let's simply say that a CRS is a way to accurately describe where a particular place is on the earth's surface. One of the most common reference systems is Longitude and Latitude. Lines of Longitude run from the North Pole to the South Pole. Lines of Latitude run from the East to West. You can describe precisely where you are at any place on the earth by giving someone your Longitude (X) and Latitude (Y). If you make a similar measurement for a tree or a telephone pole and marked it on a map, you will have created a point feature.

由于我们知道地球不是平坦的,因此向点要素添加Z值通常很有用。这描述了你的海拔有多高。

3.3. 详细介绍多段线要素

Where a point feature is a single vertex, a polyline has two or more vertices. The polyline is a continuous path drawn through each vertex, as shown in 图 3.30. When two vertices are joined, a line is created. When more than two are joined, they form a 'line of lines', or polyline.

多段线用于显示 linear features 如道路、河流、等高线、人行道、飞行路线等。有时,除了多段线的基本几何图形外,我们还对多段线有特殊规则。例如,轮廓线可以相接(例如,在悬崖面上),但不应相互交叉。同样,用于存储道路网络的多段线应在交叉点处连接。在某些GIS应用程序中,您可以为要素类型(例如道路)设置这些特殊规则,并且GIS将确保这些折线始终符合这些规则。

If a curved polyline has very large distances between vertices, it may appear angular or jagged, depending on the scale at which it is viewed (see 图 3.33). Because of this it is important that polylines are digitised (captured into the computer) with distances between vertices that are small enough for the scale at which you want to use the data.

../../_images/jagged_polyline.png

图 3.33 以较小比例(左侧1:20,000)查看的多段线可能会显示为平滑和弯曲。放大到较大比例(向右1:500)时,多段线可能看起来非常成角度。

这个 attributes 描述多段线的属性或特征。例如,道路多段线可能具有属性,这些属性描述它是铺着碎石还是柏油路面、它有多少车道、它是否是单行道等等。GIS可以使用这些属性以适当的颜色或线条样式符号化折线要素。

3.4. 面要素详细信息

面要素包括 enclosed areas 比如水坝、岛屿、国境线等等。与多段线要素类似,多边形是从一系列用连续直线连接的顶点创建的。但是,因为一个多边形总是描述一个封闭区域,所以第一个和最后一个顶点应该始终位于同一位置!多边形通常具有 shared geometry -与相邻多边形共有的边界。许多地理信息系统应用程序能够确保相邻多边形的边界完全重合。我们将在 拓扑学 本教程后面的主题。

与点和折线一样,面具有 attributes 。这些属性描述每个多边形。例如,大坝可能具有深度和水质属性。

3.5. 层中的矢量数据

既然我们已经描述了什么是矢量数据,让我们来看看如何在GIS环境中管理和使用矢量数据。大多数GIS应用程序将矢量要素分组到 layers 。层中的要素具有相同的几何类型(例如,它们都将是点)和相同类型的属性(例如,有关树对于Trees层是什么物种的信息)。例如,如果你已经记录了学校所有人行道的位置,它们通常会一起存储在计算机硬盘上,并在地理信息系统中作为一个单独的层显示。这很方便,因为它允许您通过单击鼠标在您的GIS应用程序中隐藏或显示该层的所有功能。

3.6. 编辑矢量数据

该GIS应用程序将允许您创建和修改图层中的几何数据-这一过程称为 digitising -我们将在后面的教程中更详细地介绍。如果某个层包含面(例如农场大坝),则GIS应用程序将仅允许您在该层中创建新的面。同样,如果您想要更改要素的形状,应用程序只允许您在更改后的形状正确的情况下执行此操作。例如,它不允许您以只有一个顶点的方式编辑一条线-请记住,在上面讨论的线中,所有线都必须至少有两个顶点。

创建和编辑矢量数据是GIS的一项重要功能,因为它是您可以为您感兴趣的事物创建个人数据的主要方式之一。比方说,你正在监测一条河流的污染。您可以使用地理信息系统将雨水渠的所有排水口数字化(作为点要素)。您还可以数字化河流本身(作为多段线要素)。最后,你可以获取河道沿线的PH值读数,并将读数的位置数字化(作为点图层)。

除了创建您自己的数据之外,还有许多免费的矢量数据可供您获取和使用。例如,您可以获得出现在1:50,000张地图图纸上的矢量数据,这些数据来自总司:测量和测绘。

3.7. 比例尺和矢量数据

Map scale is an important issue to consider when working with vector data in a GIS. When data is captured, it is usually digitised from existing maps, or by taking information from surveyor records and global positioning system devices. Maps have different scales, so if you import vector data from a map into a GIS environment (for example by digitising paper maps), the digital vector data will have the same scale issues as the original map. This effect can be seen in illustrations 图 3.34 and 图 3.35. Many issues can arise from making a poor choice of map scale. For example using the vector data in illustration 图 3.34 to plan a wetland conservation area could result in important parts of the wetland being left out of the reserve! On the other hand if you are trying to create a regional map, using data captured at 1:1000 000 might be just fine and will save you a lot of time and effort capturing the data.

../../_images/small_scale.png

图 3.34 从小比例尺(1:1000,000)地图数字化的矢量数据(红线)。

../../_images/large_scale.png

图 3.35 从大比例尺(1:50000)地图数字化的矢量数据(绿线)。

3.8. 符号学

When you add vector layers to the map view in a GIS application, they will be drawn with random colours and basic symbols. One of the great advantages of using a GIS is that you can create personalised maps very easily. The GIS program will let you choose colours to suite the feature type (e.g. you can tell it to draw a water bodies vector layer in blue). The GIS will also let you adjust the symbol used. So if you have a trees point layer, you can show each tree position with a small picture of a tree, rather than the basic circle marker that the GIS uses when you first load the layer (see illustrations 图 3.36, 图 3.37 and 图 3.38).

../../_images/symbology_settings.png

图 3.36 在GIS中,您可以使用面板(类似于上面的面板)来调整应如何绘制图层中的要素。

../../_images/symbology_generic.png

图 3.37 第一次加载层(例如上面的Trees层)时,GIS应用程序将为其提供一个通用符号。

../../_images/symbology_custom.png

图 3.38 在进行调整后,很容易看到我们的点代表树。

符号系统是一项强大的功能,使地图栩栩如生,使您的地理信息系统中的数据更容易理解。在接下来的主题中 (矢量属性数据 )我们将更深入地探讨符号系统如何帮助用户理解矢量数据。

3.9. 我们可以对地理信息系统中的矢量数据做些什么?

在最简单的层面上,我们可以在GIS应用程序中使用矢量数据,其方式与使用普通地形图的方式大致相同。当你开始问这样的问题时,地理信息系统的真正威力就开始显现出来:“哪些房子在一条河100年的洪水水位之内?”;“哪里是医院的最佳位置,这样尽可能多的人就能方便地去医院?”;“哪些学生住在特定的郊区?”在矢量数据的帮助下,地理信息系统是回答这类问题的一个很好的工具。通常,我们将回答这类问题的过程称为 spatial analysis 。在本教程后面的主题中,我们将更详细地介绍空间分析。

3.10. 矢量数据的常见问题

使用矢量数据确实存在一些问题。我们已经提到了在不同比例下捕获的矢量可能会出现的问题。矢量数据也需要大量的工作和维护,以确保其准确可靠。当用于捕获数据的工具设置不正确、捕获数据的人员不小心、时间或金钱不允许在收集过程中提供足够的细节时,可能会发生不准确的矢量数据,等等。

If you have poor quality vector data, you can often detect this when viewing the data in a GIS. For example slivers can occur when the edges of two polygon areas don't meet properly (see 图 3.39).

../../_images/vector_slivers.png

图 3.39 当两个多边形的顶点在其边界上不匹配时,就会出现碎屑。在小比例下(例如左侧的1),您可能看不到这些错误。在大比例下,它们显示为两个多边形之间的细条(右侧2个)。

Overshoots can occur when a line feature such as a road does not meet another road exactly at an intersection. Undershoots can occur when a line feature (e.g. a river) does not exactly meet another feature to which it should be connected. Figure 图 3.40 demonstrates what undershoots and overshoots look like.

../../_images/vector_overshoots.png

图 3.40 当本应相互连接的数字化矢量线不完全接触时,就会出现未及点(1)。如果一条线的终点超出了它应该连接到的线,就会发生过冲(2)。

由于这些类型的错误,仔细和准确地数字化数据是非常重要的。在接下来的主题中 topology ,我们将更详细地检查其中一些类型的错误。

3.11. 我们学到了什么?

让我们总结一下我们在此工作表中介绍的内容:

  • Vector data 被用来表示真实世界 features 在地理信息系统中。

  • 向量要素可以具有 geometry 类型 pointline 或者是 polygon

  • 每个矢量要素都有 attribute data 这就是它的描述。

  • 要素几何按照以下方面进行描述 vertices.

  • 点几何图形由一个 single vertex (X、Y和可选的Z)。

  • 多段线几何图形由以下部分组成 two or more 构成连通线的顶点。

  • 多边形几何由以下部分组成 at least four vertices 形成一个封闭的区域。第一个和最后一个顶点始终位于同一位置。

  • 选择要使用的几何图形类型取决于比例、便利性以及您要如何处理GIS中的数据。

  • 大多数GIS应用程序不允许在单个层中混合多种几何图形类型。

  • 数字化是通过在GIS应用程序中绘制数字矢量数据来创建数字矢量数据的过程。

  • 矢量数据可能存在质量问题,例如 undershootsovershootsslivers 你需要意识到这一点。

  • 矢量数据可用于 spatial analysis 在地理信息系统应用程序中,例如查找离学校最近的医院。

We have summarised the GIS Vector Data concept in Figure 图 3.41.

../../_images/vector_summary.png

图 3.41 此图显示了地理信息系统应用程序如何处理矢量数据。

3.12. 现在你来试试吧!

以下是一些建议,可供您尝试与您的学习者:

  • Using a copy of a toposheet map for your local area (like the one shown in 图 3.42), see if your learners can identify examples of the different types of vector data by highlighting them on the map.

  • 想一想如何在GIS中创建矢量要素来表示校园中的真实世界要素。创建一张包含学校内部和周围不同要素的表格,然后让学员决定在地理信息系统中以点、线还是面的形式表示这些要素的效果最好。看见 table_vector_1 举个例子。

../../_images/sample_map.png

图 3.42 你能在这张地图上识别出两个点要素和一个面要素吗?

真实世界特征

适合的几何图形类型

学校的旗杆

足球场

学校内外的人行道

水龙头所在的地方

等。

表矢量1:创建这样的表(将几何图形类型列保留为空),并让您的学员决定合适的几何图形类型。

3.13. 一些值得思考的事情

如果您没有可用的计算机,您可以使用拓扑表和透明度表向学员展示有关矢量数据的内容。

3.14. 进一步阅读

《QGIS用户指南》还提供了有关在QGIS中使用矢量数据的更多详细信息。

3.15. 下一步是什么?

在接下来的部分中,我们将更仔细地了解 attribute data 以了解如何使用它来描述矢量特征。