Vector topology: Difference between revisions

From GRASS-Wiki
Jump to navigation Jump to search
No edit summary
 
(added link to progman)
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''Q:''' What is the difference between pseudo-topology and real topology?
== GRASS GIS topology management ==
 
=== Topology general characteristics ===
 
* geometry and attributes are stored separately (concept: ''don't read both if it is not necessary'' - usually it is not)
* the format is topological (areas build from boundaries)
* currently only 2D topology is supported (also 3D faces but no true 3D topology with kernels)
 
Topology is stored for '''native GRASS GIS vector format''' (the default). In case of linked OGR sources (see {{cmd|v.external}} module), only pseudo-topology (boundaries constructed from polygons) is written.
 
The following '''topological rules''' apply to the vector data:
 
* Boundaries should not cross each other (i.e., boundaries which would cross must be split at their intersection to form distict boundaries). On the contrary, lines can cross each other, e.g. bridges over rivers.
* Lines and boundaries share nodes only if their endpoints are identical. Lines or boundaries can be forced to share a common node by snapping them together. This is particulary important since nodes are not represented in the coor file, but only implicitly as endpoints of lines and boundaries.
* Common area boundaries should appear only once (i.e., should not be double digitized).
* Areas must be explicitly closed. This means that it must be possible to complete each area by following one or more boundaries that are connected by common nodes, and that such tracings result in closed areas.
* It is recommended that area features and linear features be placed in separate layers. However if area features and linear features must appear in one layer, common boundaries should be digitized only once. For example, a boundary that is also a line (e.g., a road which is also a field boundary), should be digitized as a boundary to complete the area(s), and a boundary which is functionally also a line should be labeled as a line by a distinct category number.
 
Vector map topology can be cleaned at user level by {{cmd|v.clean}} command.
 
* Intro to [[Vector Database Management|vector data model]] (with drawing)
* More user-oriented topology details in the manual at: [https://grass.osgeo.org/grass-stable/manuals/vectorintro.html#vector-model-and-topology Vector model and topology]
* [https://grass.osgeo.org/programming8/vectorlib.html Vectorlib in the GRASS GIS 8 Programmer's Manual]
 
== GRASS GIS: pseudo-topology and real topology ==
 
'''Q:''' What is the difference between pseudo-topology (v.external`) and real topology?


'''A:''' The differences are listed in the table below.
'''A:''' The differences are listed in the table below.
Line 14: Line 40:
                                         *
                                         *
</pre>
</pre>
== Vector data export ==
The topological GRASS GIS vector data can be written out to common GIS vector formats with <tt>{{cmd|v.out.ogr}}</tt>.
=== Export of islands ===
If you want only isles and not regular areas in the SHAPE file, use <tt>{{cmd|v.centroids}} layer=X</tt> with a layer number that is unused, then <tt>{{cmd|v.out.ogr}} layer=X</tt> to write out the islands.
== Extracts nodes by number of line connections ==
See: https://gist.github.com/petrasovaa/356b2bf9671b2b6801963f4368d7db0b
== See also ==
* [[Vector topology cleaning]]
* Intro to [[Vector Database Management|vector data model]] (with drawing)
* see also [http://grass.osgeo.org/programming8/vectorlib.html#vlibTopoManagement Vector library topology management] background
* [[Vector patching]]
[[Category:FAQ]]
[[Category:Topology]]
[[Category:Vector]]

Latest revision as of 07:36, 10 October 2023

GRASS GIS topology management

Topology general characteristics

  • geometry and attributes are stored separately (concept: don't read both if it is not necessary - usually it is not)
  • the format is topological (areas build from boundaries)
  • currently only 2D topology is supported (also 3D faces but no true 3D topology with kernels)

Topology is stored for native GRASS GIS vector format (the default). In case of linked OGR sources (see v.external module), only pseudo-topology (boundaries constructed from polygons) is written.

The following topological rules apply to the vector data:

  • Boundaries should not cross each other (i.e., boundaries which would cross must be split at their intersection to form distict boundaries). On the contrary, lines can cross each other, e.g. bridges over rivers.
  • Lines and boundaries share nodes only if their endpoints are identical. Lines or boundaries can be forced to share a common node by snapping them together. This is particulary important since nodes are not represented in the coor file, but only implicitly as endpoints of lines and boundaries.
  • Common area boundaries should appear only once (i.e., should not be double digitized).
  • Areas must be explicitly closed. This means that it must be possible to complete each area by following one or more boundaries that are connected by common nodes, and that such tracings result in closed areas.
  • It is recommended that area features and linear features be placed in separate layers. However if area features and linear features must appear in one layer, common boundaries should be digitized only once. For example, a boundary that is also a line (e.g., a road which is also a field boundary), should be digitized as a boundary to complete the area(s), and a boundary which is functionally also a line should be labeled as a line by a distinct category number.

Vector map topology can be cleaned at user level by v.clean command.

GRASS GIS: pseudo-topology and real topology

Q: What is the difference between pseudo-topology (v.external`) and real topology?

A: The differences are listed in the table below.

Basically a full topological format knows what 'network' is so that every node is directly related with his degree of connection. Boundary lines dividing areas are simply arcs connected together, there is no need to duplicate any basic geometric feature (vertex or arc), even if it belongs to more than one geometric entity.

 pseudo-topological                      * full-topological
-----------------------------------------*-------------------------------------
                                         * 
 adjacent area boundaries are duplicated * a single boundary can share several   
                                         * areas  
                                         *
                                         *

Vector data export

The topological GRASS GIS vector data can be written out to common GIS vector formats with v.out.ogr.

Export of islands

If you want only isles and not regular areas in the SHAPE file, use v.centroids layer=X with a layer number that is unused, then v.out.ogr layer=X to write out the islands.

Extracts nodes by number of line connections

See: https://gist.github.com/petrasovaa/356b2bf9671b2b6801963f4368d7db0b

See also