官术网_书友最值得收藏!

Vector topology - the right way

More complex geometries have more theoretical possibilities, which leads to added complexity. Defining a point is unequivocal, that is, it has only one coordinate tuple. Multi-points and line strings are neither much more complex--they consist of individual and connected coordinate tuples respectively. Polygons, on the other hand, can contain holes, the holes can contain islands (fills), and theoretically, these structures can be nested infinitesimally. This structure adds a decent complexity for a GIS software. For example, QGIS only supports polygons to the first level--with holes.

The real complexity, however, only comes with topology. Different features in a layer can have relationships with each other. For example, in our administrative boundary layer, polygons should share borders. They shouldn't have gaps and overlaps. Another great example is a river network. Streams flow into rivers, rivers flow into water bodies. In a vector model, they should be connected like in the real world.

The topological geometry model (or vector model) is the sophisticated way to solve these kinds of relational problems. In this model, points are stored as nodes while other geometries form a hierarchical structure. Line segments contain references to nodes, line strings, and polygons consist of references to segments. By using this hierarchical structure, we can easily handle relationships. This way, if we change the position of a node, every geometry referring to the node changes. Take a look at the following screenshot:

Not every GIS software enforces a topological model. For example, in QGIS, we can toggle topological editing. Let's try it out by checking Enable topological editing in Settings | Snapping Options. If we edit the boundaries layer again, we can see the neighboring feature's geometry following our changes.

While QGIS does not enforce a topological model, it offers various tools for checking topological consistency. One of the tools is the built-in Topology Checker plugin. We can find the tool under the Add layer buttons.

If you don't see the tool, it might be disabled in your version of QGIS by default. You can enable it from Plugins | Manage and Install Plugins. Go to the Installed tab and check the  Topology Checker.

If we activate the tool, a new panel appears docked under the Processing Toolbox. By clicking on Configure, we can add some topology rules to the opened vector layers. Let's add two simple rules to the administrative boundaries layer--they must not have gaps or overlaps. Consider the following screenshot:

The only thing left to do is to click on the Validate All or Validate Extent button. If we have some errors, we can navigate between them by clicking on the items one by one.

If you have some errors, be sure to review them as the tool can create false positives. If you would like to repair some of the real topological errors automatically, you can try out the Geometry Checker built-in plugin. You have to enable it first, then you can find the tool at Vector | Geometry Tools | Check Geometries. Note that it won't resolve false positives as they are not real errors.
主站蜘蛛池模板: 贵阳市| 建阳市| 房山区| 资溪县| 南乐县| 桂林市| 集贤县| 玉环县| 农安县| 南宫市| 盐山县| 盐池县| 仁寿县| 桂平市| 岑巩县| 淮北市| 乌拉特前旗| 确山县| 石柱| 喜德县| 勃利县| 天台县| 仁怀市| 商洛市| 克山县| 湖口县| 略阳县| 阿鲁科尔沁旗| 四会市| 安康市| 揭东县| 原阳县| 株洲市| 芦山县| 三原县| 平定县| 同心县| 墨竹工卡县| 辽阳县| 赣州市| 长白|