Topologia¶

 Objetivos: Compreender a topologia de dados vectoriais Palavras chave: Vector, topologia, regras de topologia, erros topológicos, raio de pesquisa, tolerância para o snapping, caracteristica simples

Visão global¶

Topology expresses the spatial relationships between connecting or adjacent vector features (points, polylines and polygons) in a GIS. Topological or topology-based data are useful for detecting and correcting digitising errors (e.g. two lines in a roads vector layer that do not meet perfectly at an intersection). Topology is necessary for carrying out some types of spatial analysis, such as network analysis.

Imagine que viaja para Londres. Num passeio turístico que pretende efectuar planeou visitar St. Paul’s Cathedral primeiro e no período da tarde o Covent Garden Market para levar algumas lembranças. Olhando para o mapa subterrâneo de Londres (ver figura_topology_london) tem que encontrar os comboios que ligam o Covent Garden e St. Paul’s. Isto requer informação topológica (dados) sobre o local onde é possível trocar de comboio. Olhando para o mapa do subsolo, as relações topológicas são ilustrados por círculos que mostram a conectividade.

Figure London Underground Network 1:

Topologia da rede do metro de Londres.

Erros topológicos¶

There are different types of topological errors and they can be grouped according to whether the vector feature types are polygons or polylines. Topological errors with polygon features can include unclosed polygons, gaps between polygon borders or overlapping polygon borders. A common topological error with polyline features is that they do not meet perfectly at a point (node). This type of error is called an undershoot if a gap exists between the lines, and an overshoot if a line ends beyond the line it should connect to (see figure_topology_errors).

Figure Topology Errors 1:

Undershoots (1) occur when digitised vector lines that should connect to each other don’t quite touch. Overshoots (2) happen if a line ends beyond the line it should connect to. Slivers (3) occur when the vertices of two polygons do not match up on their borders.

The result of overshoot and undershoot errors are so-called ‘dangling nodes’ at the end of the lines. Dangling nodes are acceptable in special cases, for example if they are attached to dead-end streets.

Topological errors break the relationship between features. These errors need to be fixed in order to be able to analyse vector data with procedures like network analysis (e.g. finding the best route across a road network) or measurement (e.g. finding out the length of a river). In addition to topology being useful for network analysis and measurement, there are other reasons why it is important and useful to create or have vector data with correct topology. Just imagine you digitise a municipal boundaries map for your province and the polygons overlap or show slivers. If such errors were present, you would be able to use the measurement tools, but the results you get will be incorrect. You will not know the correct area for any municipality and you will not be able to define exactly, where the borders between the municipalities are.

É importante não só para a sua própria análise para criar e ter dados topologicamente corretos, mas também para as pessoas que fornece os dados. Estarão à espera dos dados e a análise dos resultados correctas.

Regras topológicas¶

Felizmente, os erros mais comuns podem ocorrer quando digitalizamos elementos vectoriais podem ser prevenidas por regras de topologia que estão implementadas em muitas aplicações SIG.

Excepto para alguns formatos de dados SIG especiais, a topologia geralmente não é imposta por defeito. Muitos SIG comuns, como QGIS, define a topologia como as regras de relação e permite que o utilizador escolha as regras, se houver, a ser implementada numa camada vetorial.

A lista a seguir mostra alguns exemplos onde as regras de topologia podem ser definidas para os recursos do mundo real num mapa vetorial:

• As áreas de bordadura dos municipios não se podem sobrepôr

• As áreas de bordadura dos municipios não podem ter buracos (slivers)

• Os polígonos mostram os limites da propriedade que devem ser fechados. Ultrapassar ou não cruzar o limite não é permitido.

• As linhas de contorno numa camada vectorial linha não se devem intersectar (cruzar com outra).

Ferramentas topológicas¶

Many GIS applications provide tools for topological editing. For example in QGIS you can enable topological editing to improve editing and maintaining common boundaries in polygon layers. A GIS such as QGIS ‘detects’ a shared boundary in a polygon map so you only have to move the edge vertex of one polygon boundary and QGIS will ensure the updating of the other polygon boundaries as shown in figure_topological_tools (1).

Another topological option allows you to prevent** polygon overlaps** during digitising (see figure_topological_tools (2)). If you already have one polygon, it is possible with this option to digitise a second adjacent polygon so that both polygons overlap and QGIS then clips the second polygon to the common boundary.

Figure Topological Tools 1:

(1) Topological editing to detect shared boundaries, when moving vertices. When moving a vertex, all features that share that vertex are updated. (2) To avoid polygon overlaps, when a new polygon is digitised (shown in red) it is clipped to avoid overlapping neighbouring areas.

Snapping distance¶

Snapping distance is the distance a GIS uses to search for the closest vertex and / or segment you are trying to connect when you digitise. A segment is a straight line formed between two vertices in a polygon or polyline geometry. If you aren’t within the snapping distance, a GIS such as QGIS will leave the vertex where you release the mouse button, instead of snapping it to an existing vertex and / or segment (see figure_snapping_distance).

Figure Snapping Distance 1:

The snapping distance (black circle) is defined in map units (e.g. decimal degrees) for snapping to either vertices or segments.

Search radius is the distance a GIS uses to search for the closest vertex you are trying to move when you click on the map. If you aren’t within the search radius, the GIS won’t find and select any vertex of a feature for editing. In principle, it is quite similar to the snapping distance functionality.

Snapping distance and search radius are both set in map units so you may need to experiment to get the distance value set right. If you specify a value that is too big, the GIS may snap to a wrong vertex, especially if you are dealing with a large number of vertices close together. If you specify the search radius too small the GIS application won’t find any feature or vertex to move or edit.

Problemas comuns / aspectos a ter em conta¶

Mainly designed for simplicity and for fast rendering but not for data analysis that require topology (such as finding routes across a network). Many GIS applications are able to show topological and simple feature data together and some can also create, edit and analyse both.

O que é que aprendemos?¶

Vamos encerrar o que aprendemos nesta folha de trabalho:

• Topologia mostra a relação espacial de caracteristicas vectoriais vizinhas.

• Topologia em SIG é fornecida pelas Ferramentas topológicas.

• A topologia pode ser usada para detectar e corrigir erros de digitalização

• Para algumas ferramentas, tais como analise de redes a topologia é essencial.

• Snapping distance and search radius help us to digitise topologically correct vector data.
• Simple feature data is not a true topological data format but it is commonly used by GIS applications.

Agora tente!¶

Aqui estão algumas ideias para tentar com os seus alunos:

• Marque os locais de paragem do autocarro numa camada e depois dê como tarefa aos seus alunos encontrar o caminho mais curto entre dois pontos de paragem.

• Pense como poderia criar características de um vetor num SIG para representar uma rede topológica de estradas da sua cidade. Que regras topológicas são importantes e quais ferramentas podem usar os seus alunos no QGIS para se certificar de que a nova camada de estradas está topologicamente correta?

Algo para pensar¶

Se não tiver um computador disponível, pode usar um mapa das vias de circulação de autocarros ou das linhas de comboio e discutir as relações espaciais e topologia com os seus alunos.