/*! \page vlibTopology Topology
by GRASS Development Team (http://grass.osgeo.org)
\tableofcontents
\section vlibTopoManagement Vector library topology management
Topology general characteristics:
- geometry and attributes are stored separately
(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
Topology is written for native GRASS vector format; in case of
linked OGR sources (see v.external module), only
pseudo-topology (boundaries constructed from polygons) is written.
The following 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 particularly 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.
\subsection vlibTopoFileFormat Topo file format specification
Topo file is read by Vect_open_topo().
\subsubsection vlibTopoFileHead Header
Note: plus is an instance of \ref Plus_head data structure.
Name | Type | Number | Description |
plus->Version_Major | C | 1 | file version (major) |
plus->Version_Minor | C | 1 | file version (minor) |
plus->Back_Major | C | 1 | supported from GRASS version (major) |
plus->Back_Minor | C | 1 | supported from GRASS version (minor) |
plus->port->byte_order | C | 1 | little or big endian
flag; files are written in machine native order but
files in both little and big endian order may be
readl; zero for little endian |
plus->head_size | L | 1 | header size |
plus->with_z | C | 1 | 2D or 3D flag; zero for 2D |
plus->box | D | 6 | Bounding box coordinates (N,S,E,W,T,B) |
plus->n_nodes, plus->n_lines, etc. | I | 7 | Number of
nodes, edges, lines, areas, isles, volumes and holes |
plus->n_plines, plus->n_llines, etc. | I | 7 | Number of
points, lines, boundaries, centroids, faces and kernels |
plus->Node_offset, plus->Edge_offset,
etc. | L | 7 | Offset value for nodes, edges, lines,
areas, isles, volumes and holes |
plus->coor_size | L | 1 | File size |
\subsubsection vlibTopoFileBody Body (nodes, lines, areas, isles)