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

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.
主站蜘蛛池模板: 曲阳县| 大方县| 伊吾县| 遂平县| 根河市| 上杭县| 子洲县| 依兰县| 洪雅县| 绵阳市| 荥经县| 蚌埠市| 饶阳县| 大洼县| 康平县| 巢湖市| 孝义市| 八宿县| 梁河县| 新蔡县| 公主岭市| 麻栗坡县| 沈丘县| 南通市| 桐乡市| 林甸县| 仙桃市| 阿尔山市| 客服| 甘泉县| 永德县| 扎赉特旗| 当雄县| 新泰市| 仙游县| 西华县| 呼伦贝尔市| 重庆市| 胶州市| 夏河县| 靖州|