Chapter 6. Topology

1. Introduction
2. Commands
2.1. Examples
3. Steps to create and validate a topology model
3.1. Create a topology model
3.2. Add layers to the topology model
3.3. Add rules to the topology model
3.4. Validate a topology
3.5. Obtain information about a topological model
3.6. Remove a rule
3.7. Remove a layer
3.8. Alter a layer
3.9. Remove a topological model
3.10. Change the transaction mode
4. Subtypes
4.1. Examples
4.2. Restriction on first layer
4.3. Restriction on second layer
4.4. Restriction on first and second layer
4.5. Restriction that involves first and second layer at the same time.
5. Tolerance
5.1. Cluster Tolerance
5.2. Rules with tolerance (_wt)
5.3. Search Window
6. Topology Rules
6.1. Summary of rules
6.2. Summary of rules in a single layer
6.3. Summary of rules between two layers
6.4. Point rules. Examples
6.5. Point + Point rules. Examples
6.6. Point +Line rules. Examples
6.7. Point +Polygon rules. Examples
6.8. Line rules. Examples
6.9. Line + Line rules. Examples
6.10. Line + Polygon rules. Examples
6.11. Polygon rules. Examples
6.12. Polygon + Point rules. Examples
6.13. Polygon + Line rules. Examples
6.14. Polygon + Polygon rules. Examples

1. Introduction

Jaspa implements a rule-based topology based on restrictions. The topological model is two-dimensional.

A topological model consists of layers, and rules to be met by layers. To add and remove those elements is necessary to use Section 2, “Commands”. The order to use the commands can be found in Section 3, “Steps to create and validate a topology model”.

Topological rules can be applied to a subselection of a layer rather than the full layer. Refer to Section 4, “Subtypes” for further information.

The rules can be applied to a single layer (e.g. "Must be valid", "Must not be duplicated"), or between two layers (e.g. "Must be coincident with ","Must be inside"). Section 6, “Topology Rules” includes a description and examples of all Jaspa topological rules.

In this version Jaspa incorporates an experimental cluster tolerance. This is set by the SNAP parameter, it should not be used to prevent geometric errors. By default it is disabled (SNAP false).

Very large layers can cause an out of memory exception. This issue can be solved by setting the TRANSACTION parameter to false. See Section 3.10, “Change the transaction mode” for further information.

2. Commands

SELECT COMMAND(' ');

//TOPOLOGY COMMANDS:
CREATE TOPOLOGY toponame
DROP TOPOLOGY toponame
DROP TOPOLOGY FULL

//Layer
ADD LAYER schema.name TO toponame
ADD LAYER schema.name TO toponame TOLERANCE toleranceUnits
ADD LAYER schema.name TO toponame [TOLERANCE toleranceUnits] [SNAP True / False]
REMOVE LAYER schema.name FROM toponame

ALTER LAYER layername ON toponame [TOLERANCE tolerance] [SNAP true/false]

//Rules
ADD RULE rulename TO toponame USING table1,table2 [TOLERANCE tolerance] [ATTREXP12 atrexp]
REMOVE RULE rulenumber FROM toponame

//Validate
VALIDATE RULE numberRule ON toponame [FULL | UPDATE]
VALIDATE TOPOLOGY toponame [FULL | UPDATE]
VALIDATE LAYER layer ON toponame [FULL | UPDATE]
VALIDATE LAYER layer [FULL | UPDATE]

//Show
SHOW TOPOLOGIES
SHOW LAYERS ON toponame
SHOW RULES ON toponame
SHOW RULE number ON toponame

//Transaction
SET TOPOLOGY_TRANSACTION [TRUE | FALSE <password>];

2.1. Examples

Example

SELECT command ('create topology t1');
SELECT command ('ADD layer viarialin TO t1 tolerance 0.01');
//Default tolerance 0.001
SELECT command ('ADD layer viariapol TO t1');

--snapping rules
SELECT command ('ADD RULE mbs TO t1 using viarialin');
SELECT command ('ADD RULE mbs TO t1 using viariapol');

SELECT command ('ADD RULE mbsw TO t1 using viarialin,viariapol');
SELECT command ('ADD RULE mbsw TO t1 using viariapol,viarialin');

--other rules
SELECT command ('ADD RULE mnhd TO t1 using viarialin searchwindow 10');
SELECT command ('ADD RULE mbcbbol TO t1 using viarialin,viariapol 
 attrexp1 {[TABLE1].componen1d like ''B%''}');
SELECT command ('ADD RULE mno TO t1 using viariapol');

3. Steps to create and validate a topology model

The process to build a Jaspa topological model constist on creating the model first, second add layers to the model, third add the rules to be satisfied by the layers, and finally validate some rules, some layers or the whole topological model.

With the SHOW commands you can display the rules and layers of a topological model, or obtain information about the topological models of a database.

Finally, with the REMOVE commands, you can delete rules, layers, a full topological model or even all topological models.

3.1. Create a topology model

SELECT COMMAND ('CREATE TOPOLOGY <topologyModelName>');

select command('create topology topo1') 
Result: 
"The layers metadata table for the topology topo1 have been created" 

Jaspa automatically creates the topo schema in the database (if it still does not exist), and two metadata tables in that schema:

  • layers_<topoName>

  • rules_topoName

The table layers_<topoName> stores information about the tables that are part of a topological model.

FieldType
schema_namecharacter varying
table_namecharacter varying
geom_column_namecharacter varying
tolerancedouble precision
rankinteger

The rank column at this version indicates whether to apply layer adjustment or not (values 0 or 1). By default, the system does not apply tolerance adjustment. In future releases this column will mark the hierarchy level for layers adjustment.

The table rules_<topoName> stores information about the rules that are part of a topological model.

FieldType
gidserial
rulecharacter varying
schema1_namecharacter varying
table1_namecharacter varying
geom_column1_namecharacter varying
schema2_namecharacter varying
table2_namecharacter varying
geom_column2_namecharacter varying
tolerancedouble precision
searchwindowdouble precision
lastupdate1integer
lastupdate2integer
notvalidinteger
attrexp1character varying
attrexp12character varying

3.2. Add layers to the topology model

SELECT COMMAND ('ADD LAYER <layerSchema>.<layerName1> TO <topologyModelName>');

select command('add layer public.l1 TO topo1'); 
Result: 
"The layer public.l1.geom has been added to the topology topo1"

When you add a table to a topology it happens 3 things:

  1. The metadata table layers_<topoName> is updated.

  2. A temporal table <layerName>_topotmp is added for each layer added to the topological model.

  3. A topotime field is added to each layer added to the topological model.

3.3. Add rules to the topology model

The SQL sentence to add a rule in which participates a single layer is:

SELECT COMMAND ('ADD RULE <ruleShortName> TO <topologyModelName> USING <layerSchema>.<layerName1>');

If the topological rule uses two layers, the SQL sentence is:

SELECT COMMAND ('ADD RULE <ruleShortName> TO <topologyModelName> USING <layerSchema>.<layerName1>,<layerSchema>.<layerName2>');

select command('add rule mbsp TO topo1 using l1'); 
Result: 
"GID=1 NAME=mbsp TABLE1=public.l1.geom TOLERANCE=0.0010 SEARCHWINDOW=0.1 ERRORS=0 ATTREXP1=null ATTREXP12=null 
| The topology rule has been added"

Internally Jaspa updates the metadata table rules_<topoName>.

3.4. Validate a topology

There are four ways of validating a topology

  1. Validate a rule:

    SELECT COMMAND ('VALIDATE RULE <numberRule> ON <topologyModelName> [FULL | UPDATE]');

    Select command('validate rule 1 ON topo1'); 
    --Result: 
    The rule 1 in the topology topo1 has been validated. 
    Errors [Before:0 After validating:1]
  2. Validate fully a topological model

    SELECT COMMAND ('VALIDATE TOPOLOGY <topologyModelName>');

    SELECT COMMAND('validate topology topo1'); 
    --Result: 
    The topology topo1 has been validated. 
  3. Validate a layer of a specific topological model

    SELECT COMMAND ('VALIDATE LAYER <layerName> ON <topologyModelName> [FULL/UPDATE]');

    SELECT COMMAND('validate layer l1 ON topo1'); 
    --Result: 
    The topology topo1 has been validated.
  4. Validate a layer in any topological model

    SELECT COMMAND ('VALIDATE LAYER <layerName> [FULL/UPDATE]');

    SELECT COMMAND('validate layer l1 FULL'); 
    --Result: 
    The layer public.l1.geom has been validated. 

Jaspa internally:

  1. Updates the metadata table rules_<topoName>.

  2. If a rule is validated for the first time, it creates an error table in the topo schema and inserts errors. The name of the error table is topo.r_<serialRuleNumber><topoName>_<LayerName1>_<RuleShortName>_<LayerName2>.

[Warning]

Metadata tables (rules_<topoName>, layers_<topoName>), temporal tables (<layerName>_topotmp) or the temporal field topotime must not be updated manually or deleted to ensure proper operation of Jaspa topology.

3.5. Obtain information about a topological model

SELECT COMMAND ('SHOW TOPOLOGIES')

SELECT COMMAND ('SHOW TOPOLOGIES');
--Result:
t1 |

SELECT COMMAND ('SHOW LAYERS ON toponame')

SELECT COMMAND ('SHOW LAYERS ON topo1');
--Result:
public.l1.geom | 0.0010 | 

SHOW RULES ON toponame

SELECT COMMAND ('SHOW RULES ON topo1');
--Result:
GID=1 NAME=mbsp TABLE1=public.l1.geom TOLERANCE=0.0010 SEARCHWINDOW=0.1 ERRORS=1 ATTREXP1=null ATTREXP12=null | 

SHOW RULE number IN toponame

SELECT COMMAND ('SHOW LAYERS ON topo1');
--Result:
public.l1.geom | 0.0010 | 

3.6. Remove a rule

SELECT COMMAND ('REMOVE RULE <rulenumber> FROM <topologyModelName>')

SELECT COMMAND ('REMOVE RULE 1 FROM topo1');
--Result:
The topology rule 1 and its asociated geometry error table has been deleted

3.7. Remove a layer

SELECT COMMAND ('REMOVE LAYER <layerSchema>.<layerName1> FROM <topologyModelName>')

SELECT COMMAND ('REMOVE LAYER l1 FROM topo1');
--Result:
The layer 'public.l1.geom' has been removed from the topology t1

3.8. Alter a layer

ALTER LAYER layername ON toponame [TOLERANCE tolerance] [SNAP true/false]

This command is useful to disable or enable cluster tolerance of a rule. It can also change the tolerance, but this Jaspa version only allows switching to smaller tolerances for new geometries.

3.9. Remove a topological model

Jaspa offers the possibility of eliminating all topological models or one in particular

  1. Elimate every topological model

    SELECT COMMAND ('DROP TOPOLOGY FULL');

    SELECT COMMAND ('DROP TOPOLOGY FULL');
    --Result:
    The topology metadata structure has been deleted. 
    Use CREATE TOPOLOGY in order to create it again.
  2. Eliminate a particular topological model

    SELECT COMMAND ('DROP TOPOLOGY <topologyModelName>');

    SELECT COMMAND ('DROP TOPOLOGY topo1');
    --Result:
    The topology metadata tables for the topology t1 have been deleted

3.10. Change the transaction mode

By default the transaction mode is set to true. If the layers contain a lot of topological errors can cause an out of memory exception. This can be avoided setting the transaction mode to false. If the transaction mode is set to false, the password must also be indicated.

  1. Set transaction mode to FALSE

    SELECT COMMAND ('SET TOPOLOGY_TRANSACTION false <password>');

    SELECT COMMAND ('SET TOPOLOGY_TRANSACTION false mypassword');
    --Result:
                        command                     
    -------------------------------------------------
     Topology transaction mode has been set to false
    (1 row)
  2. Set transaction mode to TRUE

    SELECT COMMAND ('SET TOPOLOGY_TRANSACTION true');

    SELECT COMMAND ('SET TOPOLOGY_TRANSACTION true');
    --Result:
                        command                     
    ------------------------------------------------
     Topology transaction mode has been set to true
    (1 row)
    

4. Subtypes

Jaspa allows the use of sub-selections in the application of topological rules. This can be done using the sub-selection parameter (ATTREXP12) when a rule is added.

If the subselection is appliable only to the first layer in a rule, the parameter ATTREP1 must be used.

If the subselection is appliable only to the second layer in a rule or to a combination of the first and second layer, the parameter ATTREP12 must be used.

Let's illustrate this with some examples.

4.1. Examples

Imagine you want to check that polygons contain one point, but this requirement is only applicable to part of the layer. The rule to use is [Polygon] must contain one [Point].

table_a

GidTypeGeom
1a1POLYGON((-2 5,-2 9,2 9,2 9,2 5,2 5,-2 5))
2a2POLYGON((3.5 9,3.5 12.3,5.3 12.3,5.3 9,3.5 9))
3a3POLYGON((-2 9,-2 12.3,3.5 12.3,3.5 9,-2 9))
4a4POLYGON((2 5,2 9,5.3 9,5.3 5,2 5))
5bPOLYGON((7 8,7 11,9 11,9 8,7 8))

table_b

GidTypeGeom
11POINT(0 11)
22POINT(4 5)
33POINT(-1 6)
44POINT(1 4)
55POINT(2 10)

Create the tables and populate date into them:

CREATE TABLE table_a(gid serial PRIMARY KEY,type VARCHAR);
SELECT AddGeometryColumn ('table_a','geom',-1,'POLYGON',2);
INSERT INTO table_a(type ,geom) VALUES ('a1',ST_GeomfromText('POLYGON((-2 5,-2 9,2 9,2 9,2 5,2 5,-2 5))'));
INSERT INTO table_a(type ,geom) VALUES ('a2',ST_GeomfromText('POLYGON((3.5 9,3.5 12.3,5.3 12.3,5.3 9,3.5 9))'));
INSERT INTO table_a(type ,geom) VALUES ('a3',ST_GeomfromText('POLYGON((-2 9,-2 12.3,3.5 12.3,3.5 9,-2 9))'));
INSERT INTO table_a(type ,geom) VALUES ('a4',ST_GeomfromText('POLYGON((2 5,2 9,5.3 9,5.3 5,2 5))'));
INSERT INTO table_a(type ,geom) VALUES ('b',ST_GeomfromText('POLYGON((7 8,7 11,9 11,9 8,7 8))'));

CREATE TABLE table_b(gid serial PRIMARY KEY, type int);
SELECT AddGeometryColumn ('table_b','geom',-1,'POINT',2);
INSERT INTO table_b(type ,geom) VALUES (1,ST_GeomfromText('POINT(0 11)'));
INSERT INTO table_b(type ,geom) VALUES (2,ST_GeomfromText('POINT(4 5)'));
INSERT INTO table_b(type ,geom) VALUES (3,ST_GeomfromText('POINT(-1 6)'));
INSERT INTO table_b(type ,geom) VALUES (4,ST_GeomfromText('POINT(1 4)'));
INSERT INTO table_b(type ,geom) VALUES (5,ST_GeomfromText('POINT(2 10)'));

Create the topology set and add the geometry tables to it:

SELECT COMMAND ('create topology t1');
SELECT COMMAND('ADD layer table_a TO t1');
SELECT COMMAND('ADD layer table_b TO t1');

4.2. Restriction on first layer

Polygons whose type is like a, must contain one point. The rule to use is [Polygon] must contain one [Point]. In this case, as the restriction only applies to first layer the sub-selection parameter to use is ATTREP1.

Fields labeled = type

Add the rule:

SELECT COMMAND('ADD RULE mcop TO t1 using table_a,table_b 
attrexp1 {[TABLE1].type like ''a%''}');

Validate

SELECT COMMAND ('VALIDATE RULE 1 on t1');

4.3. Restriction on second layer

Polygons must contain one point whose type is lower than 3

Fields labeled = type

Add the rule:

SELECT COMMAND('ADD RULE mcop TO t1 using table_a,table_b 
attrexp12 {[TABLE2].type < 3}');

4.4. Restriction on first and second layer

Polygons whose type is like a must contain one point whose type is lower than 3

Fields labeled = type

Add the rule:

SELECT COMMAND('ADD RULE mcop TO t1 using table_a,table_b 
attrexp1 {[TABLE1].type like ''a%''} 
attrexp12 {[TABLE2].type < 3}');

4.5. Restriction that involves first and second layer at the same time.

Polygons must contain one point whose gid field is higher than the polygon's gid.

Fields labeled = gid

Add the rule:

SELECT COMMAND('ADD RULE mcop TO t1 using table_a,table_b 
attrexp12 {[TABLE1].gid < [TABLE2].gid}');

5. Tolerance

5.1. Cluster Tolerance

The cluster tolerence is the minimum distance between coordinates to be considered identical.

If two lines are at a distance of 5 maps units, and the tolerance is set to 10 map units, the vatidation process will consider that the lines are coincident.

Cluster tolerance should be set according to the layer accuracy. It is set with the tolerance parameter when a layer is added to the topology model. ADD LAYER schema.name TO toponame [TOLERANCE toleranceUnits] [SNAP True / False]

If this tolerance is active (Snap True) vertices or edges are snapped to become coincident. If it not specified, the default value 0.001 map units is used.

The cluster tolerance is also used in the rules with tolerance _wt. (See next section).

This parameter is stored in the metadata table layers_<topoName>.

ADD layer <layerName> to <topologyName> tolerance 0.01

Default value 0.001:

ADD layer <layerName> to <topologyName>

5.2. Rules with tolerance (_wt)

Some rules use a snapping tolerance, their name finish with the "_WT" suffix. For instance: Must be disjoint with tolerance (mbd_wt).

SELECT command('ADD RULE mbd_wt TO t1 using l16 tolerance 0.1');

If the user does not indicate the tolerance parameter, the layer tolerance is used.

SELECT command('ADD RULE mbd_wt ON t1 using l16');

The following example applies the rule "must be disjoint with tolerance" (mbd_wt). We can see that the points on the lower left corner 1 and 3, are disjoint. But if we consider the cluster tolerance they should be considered as coincident and so are marked as errors. Note that the multipoint 3 is composed by two points, and both are marked as errors.

GidGeom
1MULTIPOINT ((7 13))
2MULTIPOINT ((12 17))
3MULTIPOINT ((8 12), (7 18))
3MULTIPOINT ((12.5 12))

5.3. Search Window

This parameter is used for the rule must not have dangles. It is used to indicate the maximum distance to search a geometry near to the dangle.

SELECT command('ADD RULE mnhd TO t1 using <layer> searchwindwow 10');

If the search window parameter is not specified, it uses as default value 100 times the layer tolerance.

SELECT command('ADD RULE mnhd TO t1 using <layer>');

The error layer has a distance field that indicates the distance to the nearest geometry (If there is not a geometry within the search window, it indicates the parameter search window). The gid of the nearest geometry is indicated in the field geomgid2.

SearchWindow = 10
GidExc.gid geom1gid geom2dist.
1false131.1
2false230.7
3false230.2
SearchWindow = 0.1
GidExc.gid geom1gid geom2dist.
1false1Null0.1
2false230.7
3false230.2

6. Topology Rules

This section presents a comprehensive list of the available topology rules.

6.1. Summary of rules

GeometryAliasRule

Point

mbsp

Must be single Part

mbd

Must be disjoint

mbd_wt

Must be disjoint with tolerance

mnbd

Must not be duplicated

mnbd_wt

Must not be duplicated with tolerance

mnhrp

Must not have repeated points

Point + Point

mbdw

Must be disjoint with

mbdw_wt

Must be disjoint with, with tolerance

mbcw

Must be coincident with

mbcw_wt

Must be coincident with, with tolerance

Point + Line

mbi

Must be inside

mbpi

Must be properly inside

Point + Polygon

mbi

Must be inside

mbpi

Must be properly inside

mbcbbo

Must be covered by boundary of

Line

mbsp

Must be single Part

mnsi

Must not self intersect

mnioti

Must not intersect or touch interior

mnti

Must not touch interior

mni

Must not intersect

mbd

Must be disjoint

mbd_wt

Must be disjoint, with tolerance

mnbd

Must not be duplicated

mno

Must not overlap

mnhd

Must not have dangles

mnhd_wt

Must not have dangles, with tolerance

mnhp

Must not have pseudonodes

mnhp_wt

Must not have pseudonodes, with tolerance

mnhrp

Must not have repeated points

 mbc2d_wtMust be connected 2D, with tolerance
 mbc3d_wtMust be connected 3D, with tolerance

Line + Line

mniotiw

Must not intersect or touch interior with

mniw

Must not intersect with

mntiw

Must not touch interior with

mbdw

Must be disjoint with

mbdw_wt

Must be disjoint with, with tolerance

mnow

Must not overlap with

mbi

Must be inside

mbpi

Must be properly inside

mbcbl

Must be covered by layer

 mbc2dw_wtMust be connected 2D with, with tolerance
 mbc3dw_wtMust be connected 3D with, with tolerance
 mbccw_wtMust be cross connected with, with tolerance

Line + Polygon

mbi

Must be inside

mbpi

Must be properly inside

mbcbl

Must be covered by layer

mbcbbol

Must be covered by boundary of layer

mbcbbo

Must be covered by boundary of

 mbccw_wtMust be cross connected with, with tolerance

Polygon

mbsp

Must be single Part

mbv

Must be valid

mbd

Must be disjoint

mbd_wt

Must be disjoint, with tolerance

mnbd

Must not be duplicated

mno

Must not overlap

mnhg

Must not have gaps

mnhrp

Must not have repeated points

Polygon + Point

mcop

Must contain one point

mcpop

Must contain properly one point

mcp

Must contain points

mcpp

Must contain properly points

Polygon + Line

bmbcbl

Boundary must be covered by layer

 mbccw_wtMust be cross connected with

Polygon + Polygon

mbdw

Must be disjoint with

mbdw_wt

Must be disjoint with

mnow

Must not overlap with

mbi

Must be inside

mbpi

Must be properly inside

mbcbl

Must be covered by layer

bmbcbbol

Boundary must be covered by boundary of layer

 mbccw_wtMust be cross connected with, with tolerance

6.2. Summary of rules in a single layer

PointLinePolygonAliasRule
XXX

mbsp

Must be single Part

XXX

mbd

Must be disjoint
XXX

mbd_wt

Must be disjoint with tolerance
XXXmnbd

Must not be duplicated

X  

mnbd_wt

Must not be duplicated with tolerance

XXX

mnhrp

Must not have repeated points

 

X

 

mnsi

Must not self intersect

 

X

 

mnioti

Must not intersect or touch interior

 

X

 

mnti

Must not touch interior

 

X

 

mni

Must not intersect

 XX

mno

Must not overlap

 X

mnhd

Must not have dangles

 

X

 

mnhd_wt

Must not have dangles, with tolerance

 

X

 

mnhp

Must not have pseudonodes

 

X

 

mnhp_wt

Must not have pseudonodes, with tolerance

  X

mbv

Must be valid

  X

mnhg

Must not have gaps

 X 

mbc2d_wt

Must be connected 2d, with tolerance

 X 

mbc3d_wt

Must be connected 3d, with tolerance

6.3. Summary of rules between two layers

PointLinePolygonAliasRule

Point + Point

Line + Line

Polygon + Polygon

mbdw

Must be disjoint with

Point + Point

Line + Line

Polygon + Polygon

mbdw_wt

Must be disjoint with, with tolerance

Point + Point

  

mbcw

Must be coincident with

Point + Point

  

mbcw_wt

Must be coincident with, with tolerance

Point + Line

Point + Polygon

Line + Line

Line + Polygon

Polygon + Polygon

mbi

Must be inside

Point + Line

Point + Polygon

Line + Line

Line + Polygon

Polygon + Polygon

mbpi

Must be properly inside

Point + Polygon

Line + Polygon

 

mbcbbo

Must be covered by boundary of

 

Line + Line

 

mniotiw

Must not intersect or touch interior with

 

Line + Line

 

mniw

Must not intersect with

 

Line + Line

 

mntiw

Must not touch interior with

 

Line + Line

Polygon + Polygon

mnow

Must not overlap with

 

Line + Line

Line + Polygon

Polygon + Polygon

mbcbl

Must be covered by layer

 

Line + Polygon

 

mbcbbol

Must be covered by boundary of layer

  

Polygon + Point

mcop

Must contain one point

  

Polygon + Point

mcpop

Must contain properly one point

  

Polygon + Point

mcp

Must contain points

  

Polygon + Point

mcpp

Must contain properly points

  

Polygon + Line

bmbcbl

Boundary must be covered by layer

  

Polygon + Polygon

bmbcbbol

Boundary must be covered by boundary of layer

 Line + Line

mbc2dw_wt

Must be connected 2D with

 Line + Line

mbc3dw_wt

Must be connected 3D with

 

Line + Line

Line + Polygon

Polygon + Line

Polygon + Polygon

mbccw_wt

Must be cross connected with, with tolerance

6.4. Point rules. Examples

RuleInput / OutputDescriptionExample 

Must be single Part (mbsp)

Input: MultiPoint

Output: MultiPoint

Checks that multigeometries have only one part.

Any geometry with more than one part is an error.

MULTIPOINT ((50 60), (90 60), (70 30))
MULTIPOINT ((120 90))
MULTIPOINT ((70 100))
MULTIPOINT ((50 60), (90 60), (70 30))

Must be disjoint (mbd)

Input: Point Features

Output: MultiPoint

A point must not coincide with other points of its layer.

Errors are created when points interserct.

Must be disjoint (mbd_wt)

Tolerance version

Input: Point Features

Output: MultiPoint

A point must not coincide with other points of its layer.

Must not be duplicated (mnbd)

Input: All

Output: Same as input

A Geometry must not be spatially equal to another Geometry. (ST_Equals)

Note that this method computes topologically equality, not structural or vertex-wise equality

POINT (10 10)
POINT (10.08 10)
POINT (10 10)
Error
POINT (10 10)

Must not be duplicated (mnbd_wt)

Tolerance version

Input: Point

Output: Point

A point must not be spatially equal or nearly equal (tolerance)
POINT (10 10)
POINT (10.08 10)
POINT (12 12)

Tolerance 0.1
Error
POINT (10 10)

Must not have repeated points (mnhrp)

Input: Point Features

Output: MultiPoint

A vertex must be captured just once.
MULTIPOINT ((50 50), 
(90 60), (50 50))
MULTIPOINT ((50 50))

6.5. Point + Point rules. Examples

RuleInput / OutputDescriptionExample 

Must be disjoint with (mbdw)

Input 1: Point Features

Input 2: Point Features

Output: Point Features

A point must not coincide with other points of another layer.

Errors are the original non disjoint points.

Must be disjoint with (mbdw_wt)

Tolerance version

Input 1: Point Features

Input 2: Point Features

Output: MultiPoint

A point must not coincide with other points of its layer.

Errors consist of the original non disjoint geometries.

Must be coincident with (mbcw)

Input 1: Point Features (just 1 point)

Input 2: Point Features

Output: Point Features

Checks that points of one layer are exactly coincident with points in another layer.

Must be coincident with (mbcw_wt)

Tolerance

Input 1: Point Features (just 1 point)

Input 2: Point Features

Output: Point Features

Checks that points of one layer are coincident with points in another layer.

Points do not need to be exactly coincident, they can be as close together as the tolerance indicates.

Errors consist of the disjoint points.

6.6. Point +Line rules. Examples

RuleInput / OutputDescriptionExample 
Must be inside (mbi)

Input 1: Point Features

Input 2: Line Features

Output: Point Features

A point must be inside a line from another layer. Points can lie at endpoints of a line.

Must be properly inside (mbpi)

Input 1: Point Features

Input 2: Line Features

Output: Point Features

A point must be properly inside a line from another layer. Points do not lie endpoints of a line.

Errors consist of points that do not lie completely in the interior of a line from another layer.

6.7. Point +Polygon rules. Examples

RuleInput / OutputDescriptionExample 
Must be inside (mbi)

Input 1: Point Features

Input 2: Polygon Features

Output:Point Features

A point must be inside a polygon from another layer. Points can lie at edges of polygons.
Must be properly inside (mbpi)

Input 1: Point Features

Input 2: Polygon Features

Output:Point Features

A point must be properly inside of a polygon from another layer. Points do not fall on polygon boundaries.

Errors consist of points that do not lie completely in the interior of a polygon.

Must be covered by boundary of (mbcbbo)

Input 1: Point Features

Input 2: Polygon Features

Output: Point Features

A point must be covered by the boundary of an area layer.

Requires that points lie on edge of polygons.

6.8. Line rules. Examples

RuleInput / OutputDescriptionExampleErrors

Must be single Part (mbsp)

Input: MultiLineString

Output: MultiLineString

Checks that multigeometries have only one part.

Any geometry with more than one part is an error.

MULTILINESTRING ((16 -8, 52 9, 93 -9))
MULTILINESTRING ((15 13, 54 35),
(101 12, 63 34))
MULTILINESTRING ((15 13, 54 35),
(101 12, 63 34))

Must not self intersect (mnsi)

Input: Line Features

Output: MultiPoint

Checks that lines do not cross or overlap themselves.

Errors consist of the points where a line intersects itself.

Must not intersect or touch interior (mnioti)

Input: Line Features

Output: Table without geometry constraint. (Point or LineString)

Checks that lines do not overlap or interserct (except at endpoints).

Errors consist of points if lines intersect, or lines if lines overlap.

Must not touch interior (mnti)

Input: Line Features

Output: Point

Checks that an endpoint of a line does not touch another line. Lines can overlap of intersect other lines.

Must not intersect (mni)

Input: Line Features

Output: Table without geometry constraint. (Point or LineString)

Checks that lines do not intersect.

Errors consist of points or lines.

Must be disjoint (mbd)

Input: Line Features

Output: (Point or LineString geometries)

A line must not have any part in common with other lines in the same layer.

Line errors are created where lines overlap.

Points errors are created where lines cross or touch each other.

Must be disjoint (mbd_wt)

Tolerance version

Input: Line Features

Output: MultType

A line must not have any part in common with other lines.

Errors consist of the original non disjoint geometries.

Must not be duplicated (mnbd)

Input: All

Output: Same as input

A Geometry must not be spatially equal to another Geometry. (ST_Equals)

Note that this method computes topologically equality, not structural or vertex-wise equality

LINESTRING (30 40, 60 40)
LINESTRING (30 40, 60 40)
LINESTRING (40 50, 60 70)
Error
LINESTRING (30 40, 60 40)

Must not overlap (mno)

Input 1: Line Features

Output: MultiLineString

A line must not share its interior with lines of the same layer. Lines can cross or share vertices.

Errors consist of the intersection of the interiors with linear dimension.

Must not have dangles (mnhd)

SearchWindow

Input: Line Features

Output: Point Features

Every line endpoint must be connected to a line. This rule detects undershoots and overshoots.

Must not have dangles (mnhd_wt)

Tolerance version

Input: Line Features

Output: Point

Every line endpoint must be connected to a line. This rule detects undershoots and overshoots.

Tolerance

Must not have pseudonodes (mnhp)

Input: Line Features

Output: Point

Checks that lines connect at least 2 other lines at endpoints.

Pseudones consist of nodes with 2 arcs.

Must not have pseudonodes (mnhp_wt)

Tolerance version

Input: Line Features

Output: Point

Nodes with 2 arcs. Requires that lines connect at al least 2 endpoints.

Must not have repeated points (mnhrp)

Input: Line Features

Output: MultiPoint

Checks that the vertices of a line are captured just once.
LINESTRING (0 0 15, 10 10 25, 
10 10 25, 20 10 35)
MULTIPOINT ((10 10))
Must be connected 2d, with tolerance (mbc2d_wt)

Input: Line Features

Output: Point

Checks that lines that are closer than the tolerance distance are connected
Must be connected 3d, with tolerance (mbc3d_wt)

Input: Line Features

Output: Point

Checks that lines that are closer than the tolerance distance are connected vertically

6.9. Line + Line rules. Examples

RuleInput / OutputDescriptionExample 
Must not intersect or touch interior with (mniotiw)

Input 1: Line Features

Input 2: Line Features

Output: Table without geometry constraint. (Point or LineString)

Checks that lines do not overlap or interserct lines of another layer (except at endpoints)
Must not intersect with (mniw)

Input 1: Line Features

Input 2: Line Features

Output: Table without geometry constraint. (Point or LineString)

Checks that Lines do not intersect with lines of another layer.

Errors consist of points or lines.

Must not touch interior with (mntiw)

Input 1: Line Features

Input 2: Line Features

Output: Point

Checks that an endpoint of a line does not touch another line of another layer. Lines can overlap of intersect other lines.

Errors consist of points.

Must be disjoint with (mbdw)

Input 1: Line Features

Input 2: Line Features

Output: Table without geometry constraint. (Point or LineString)

A line must not have any part in common with lines of another layer.

Line errors are created where lines overlap.

Points errors are created where lines cross or touch each other.

Must be disjoint with (mbdw_wt)

Tolerance version

Input 1: Line Features

Input 2: Line Features

Output: MultiLineString

A line must not have any part in common with lines of another layer.

Stores the original non disjoint geometries.

Must not overlap with (mnow)

Input 1: Line Features

Input 2: Line Features

Output: MultiLineString

A line must not share its interior with lines of another layer. Lines can cross or share vertices.

Errors consist of the intersection of the interiors with linear dimension.

Must be inside (mbi)

Input 1: Line Features

Input 2: Line Features

Output: Line Features

A line must be contained within the endpoints of a line from another layer.

Must be properly inside (mbpi)

Input 1: Line Features

Input 2: Line Features

Output: Line Features

A line must be properly inside a line from another layer.

Errors consists of lines that do not lie completely in the interior of a line from another layer.

Must be covered by layer (mbcbl)

Input 1: Line Features

Input 2: Line Features

Output: LineString

Checks that lines from one layer are covered by the lines of another layer.
Must be connected 2d with, with tolerance (mbc2dw_wt)

Input: Line Features

Output: Point

Checks that lines from one layer that are closer than the tolerance distance to lines of another layer are connected
Must be connected 3d with, with tolerance (mbc3dw_wt)

Input: Line Features

Output: Point

Checks that lines from one layer that are closer than the tolerance distance to lines of another layer are connected vertically

Must be cross connected with (mbccw_wt)

Tolerance version

Input 1: Line Features

Input 2: Line Features

Output: Point

Checks that lines from one layer that intersect with lines from another layer, are vertically coincident in the intersection points.

Errors consist of the instersection points with different 3d coordinate.

6.10. Line + Polygon rules. Examples

RuleInput / OutputDescriptionExample 
Must be inside (mbi)

Input 1: Line Features

Input 2: Polygon Features

Output: Line Features (input 1)

A line must be inside a polygon from another layer.
Must be properly inside (mbpi)

Input 1: Line Features

Input 2: Polygon Features

Output:LineString / MultiLineString

A line must be properly inside a polygon from another layer. Lines do not cross or share boundary with polygon geometries.

Errors consists of lines that do not lie completely in the interior of a polygon.

Must be covered by layer (mbcbl)

Input 1: Line Features

Input 2: Polygon Features

Output: LineString

A line must be covered by an area layer.

Must be covered by boundary of layer (mbcbbol)

Input 1: Line Features

Input 2: Polygon Features

Output: MultiLineString

A line must be covered by the boundary of an area layer.

Requires that lines lie on edge of polygons.

Must be covered by boundary of (mbcbbo)

Input 1: Line Features

Input 2: Polygon Features

Output: Line Features

Checks that Lines are covered by the boundary of polygon features.

Must be cross connected with (mbccw_wt)

Tolerance version

Input 1: Line Features

Input 2: Polygon Features

Output: Point

Checks that lines from one layer that intersect with polygons from another layer, are vertically coincident in the intersection points.

Errors consist of the instersection points with different 3d coordinate.

(0.0 Z coordinate)

6.11. Polygon rules. Examples

RuleInput / OutputDescriptionExample 

Must be single Part (mbsp)

Input: Multipolygon

Output: Multipolygon

Checks that multigeometries have only one part.

Any geometry with more than one part is an error.

Must be valid (mbv)

Input: Polygon Features

Output: Polygon Features

Checks that Polygons are well formed.

Returns the polygons that are invalid.

Must be disjoint (mbd)

Input: Polygon Features

Output: Table without geometry constraint. (Point, LineString or Polygon geometries)

A polygon must not have any part in common with other polygons.

Errors are created when polygons interserct. Errors can be polygons, lines or points.

Must be disjoint (mbd_wt)

Tolerance version

Input: Polygon Features

Output: MultiPolygon

A polygon must not have any part in common with other polygons.

Errors consist of the original non disjoint geometries.

Must not be duplicated (mnbd)

Input: All

Output: Same as input

A Geometry must not be spatially equal to another Geometry. (ST_Equals)

Note that this method computes topologically equality, not structural or vertex-wise equality

POLYGON ((10 0, 10 40, 40 40, 40 0, 10 0))
POLYGON ((10 0, 10 40, 40 40, 40 0, 10 0))
POLYGON ((50 10, 50 20, 70 20, 70 10, 50 10))
Error
POLYGON ((10 0, 10 40, 40 40, 40 0, 10 0))

Must not overlap (mno)

Input: Polygon Features

Output: MultiPolygon

A polygon must not share its interior with other polygons. But polygons can share lines or vertices.

Errors consist of the intersection of the interiors with dimension 2.

Must not have gaps (mnhg)

Input: Polygon Features

Output: MultiLineString

Polygons must form a continuous surface, without gaps.

Exterior rings are always marked as errors.

Must not have repeated points (mnhrp)

Input: Polygon Features

Output: MultiPoint

Checks that polygon vertices are captured just once.
POLYGON ((21 15, 21 20, 27 20, 
27 20, 27 15, 21 15))
MULTIPOINT ((27 20))

6.12. Polygon + Point rules. Examples

RuleInput / OutputDescriptionExample 
Must contain one point (mcop)

Input 1: Polygon Features

Input 2: Pointal

Output: Polygon Features

Each polygon must have one point inside it.

Points outside polygons are not errors.

Must contain properly one point (mcpop)

Input 1: Polygon Features

Input 2: Pointal

Output: Polygon Features

Each polygon must have one point inside it.

Points outside polygons are not errors.

Must contain points (mcp)

Input 1: Polygon Features

Input 2: Pointal

Output: Polygon Features

Each polygon must have at least one point inside it.

Points outside polygons are not errors.

Must contain properly points (mcpp)

Input 1: Polygon Features

Input 2: Pointal

Output: Polygon Features

Each polygon must have at least one point properly inside it.

Points outside polygons are not errors.

6.13. Polygon + Line rules. Examples

RuleInput / OutputDescriptionExample 

Boundary must be covered by layer (bmbcbl)

Input 1: Polygon Features

Input 2: Line Features

Output: MultiLineString

Checks that each polygon boundary is covered by lines of another layer.

Must be cross connected with (mbccw_wt)

Tolerance version

Input 1: Polygon Features

Input 2: Line Features

Output: Point

Checks that polygons from one layer that intersect with lines from another layer, are vertically coincident in the intersection points.

Errors consist of the instersection points with different 3d coordinate.

(0.0 Z coordinate)

6.14. Polygon + Polygon rules. Examples

RuleInput / OutputDescriptionExample 

Must be disjoint with (mbdw)

Input 1: Polygon Features

Input 2: Polygon Features

Output:Table without geometry constraint. (Point or LineString)

A polygon must not have any part in common with polygons of another layer.

Errors are created when polygons interserct. Errors can be polygons, lines or points.

Must be disjoint with (mbdw_wt)

Tolerance version

Input 1: Polygon Features

Input 2: Polygon Features

Output: MultiPolygon

Stores the original non disjoint geometries.

Must not overlap with (mnow)

Input 1: Polygon Features

Input 2: Polygon Features

Output: MultiPolygon

A polygon must not share its interior with polygons of another layer. Polygons can share lines or vertices.

Errors consist of the intersection of the interiors with polygonal dimension.

Must be inside (mbi)

Input 1: Polygon Features

Input 2: Polygon Features

Output: Polygon Features (input 1)

A polygon must be inside a polygon from another layer.
Must be properly inside (mbpi)

Input 1: Polygon Features

Input 2: Polygon Features

Output: Polygon Features

A polygon must be properly inside a polygon from another layer.

Errors consists of polygons that do not lie completely in the interior of a polygon from another layer.

Must be covered by layer (mbcbl)

Input 1: Polygon Features

Input 2: Polygon Features

Output: Polygon

Checks that a Polygon in a layer is covered by polygons of another layer.

Boundary must be covered by boundary of layer (bmbcbbol)

Input 1: Polygon Features

Input 2: Polygon Features

Output: MultiLineString

Checks that Polygons are covered by the boundary of polygon features of another layer.

Must be cross connected with (mbccw_wt)

Tolerance version

Input 1: Polygon Features

Input 2: Polygon Features

Output: Point

Checks that polygons from one layer that intersect with polygons from another layer, are vertically coincident in the intersection points.

Errors consist of the instersection points with different 3d coordinate.

(0.0 Z coordinate)