topo-layout
Not logged in

Topology: basic DB layout

previous page back to index next page

ISO layout for DB tables implementing a Topology-Geometry

Accordingly to ISO/IEC 13249-3 (SQL/MM) specifications a Topology-Geometry should be implemented as a set of three strictly related DB tables respectively intended for Nodes, Edges and Faces.
The ISO standard dictates that several unrelated Topologies can safely coexist into the same DBMS instance, each one of them being stored on its own separate SCHEMA identified by the same name of the individual Topology.
SQLite has no equivalent concept of SCHEMA, so SpatiaLite's own Topologies will be implemented as a set of tables sharing the same name-prefix.

<topology>_NODE
NODE_IDINTEGER Node unique identifier.
CONTAINING_FACEINTEGER Unique identifier of the Face containing the Node.
Only isolated Nodes may be contained within a Face; non-isolated Nodes must declare a NULL value.
GEOMETRYPOINT Location of the Node.

<topology>_EDGE
EDGE_IDINTEGER Edge unique identifier.
START_NODEINTEGER Unique identifier of the Node at the start of the Edge.
END_NODEINTEGER Unique identifier of the Node at the end of the Edge.
LEFT_FACEINTEGER Unique identifier of the Face on the left side of the Edge when looking in the direction from START_NODE to END_NODE.
RIGHT_FACEINTEGER Unique identifier of the Face on the right side of the Edge when looking in the direction from START_NODE to END_NODE
All isolated Edges have the same Face both on the left and right sides.
NEXT_LEFT_EDGEINTEGER Unique identifier of the next Edge of the Face on the left (when looking in the direction from START_NODE to END_NODE), moving counterclockwise around the Face boundary.
NEXT_RIGHT_EDGEINTEGER Unique identifier of the next Edge of the Face on the right (when looking in the direction from START_NODE to END_NODE), moving counterclockwise around the Face boundary.
GEOMETRYCURVE Geometry of the Edge.
The first vertex of the Edge must exactly match START_NODE and the last vertex must match END_NODE.

<topology>_FACE
FACE_IDINTEGER Face unique identifier.
Every Topology-Geometry is always expected to declare the Universal Face identified by an ID value 0 (zero).
MBRRECTANGLE Minimum bounding box (aka BBOX) of the Face.
The Universal Face is expected to declare a NULL MBR because the Universal Face can never be represented as a geometry.



ISO layout for DB tables implementing a Topology-Network

ISO Topology-Network adopts a slightly different layout; in this case there are simply two DB tables respectively intended for Nodes and Links.
Different Networks can coexist within the same database, and will be implemented as a set of tables sharing the same name-prefix.

<network>_NODE
NODE_IDINTEGER Node unique identifier.
GEOMETRYPOINT Location of the Node.
All Nodes in a Logical Network must declare a NULL geometry.

<network>_LINK
LINK_IDINTEGER Link unique identifier.
START_NODEINTEGER Unique identifier of the Node at the start of the Link.
END_NODEINTEGER Unique identifier of the Node at the end of the Link.
GEOMETRYCURVE Geometry of the Link.
The first vertex of the Link must exactly match START_NODE and the last vertex must match END_NODE.
All Links in a Logical Network must declare a NULL geometry.
previous page back to index next page