- Practical GIS
- Gábor Farkas
- 533字
- 2021-07-02 22:49:13
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 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.
- R語言數據分析從入門到精通
- ASP.NET MVC4框架揭秘
- 小創客玩轉圖形化編程
- JavaScript語言精髓與編程實踐(第3版)
- 深入淺出Java虛擬機:JVM原理與實戰
- 看透JavaScript:原理、方法與實踐
- Kotlin Standard Library Cookbook
- Python數據可視化之Matplotlib與Pyecharts實戰
- Serverless computing in Azure with .NET
- Python爬蟲、數據分析與可視化:工具詳解與案例實戰
- Spring 5 Design Patterns
- Fastdata Processing with Spark
- Puppet 5 Beginner's Guide(Third Edition)
- C語言程序設計實驗指導
- 高性能MVVM框架的設計與實現:San