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

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.
主站蜘蛛池模板: 安康市| 封开县| 饶平县| 攀枝花市| 安化县| 浙江省| 高阳县| 沅江市| 南皮县| 监利县| 高尔夫| 陆良县| 大丰市| 安宁市| 大丰市| 乌什县| 荃湾区| 衡山县| 周至县| 平山县| 交口县| 温州市| 阳江市| 都匀市| 盐源县| 麦盖提县| 沛县| 海盐县| 铜山县| 永吉县| 科尔| 苗栗县| 剑阁县| 罗定市| 甘南县| 响水县| 德江县| 新兴县| 偏关县| 弥渡县| 珲春市|