E4 ยท Publication Volume 26
Vector Topology
validity, intersection, containment, adjacency and repair
Learning objectives
- Explain the decision and evidence boundary for validity, intersection, containment, adjacency and repair.
- Select and implement the relevant representation or algorithm without hidden coordinate, support or topology assumptions.
- Separate exact predicates, approximation error, source uncertainty and visual delivery.
- Produce a vector-topology validator and non-destructive repair register from synthetic evidence.
The lesson is complete only when the learner can defend the representation, transform, predicates, tests and release decision. A visually clean map or 3D scene without executable invariants and provenance remains unverified.
This is a general, institution-neutral tutorial with no relationship to any company or individual. All coordinates, geometries, grids, points, surfaces, volumes, attributes and review events in the lesson are synthetic and must not be used for an operational decision.
Decision context
The decision is whether a vector object supports the spatial relationships required by its intended use. A polygon used only as an annotation may tolerate conditions that make it unsuitable for area, overlay or containment. Validity is therefore evaluated against a declared geometry model and operation set. The workflow must distinguish coordinate defects, combinatorial defects, semantic conflicts and merely unexpected shapes. It must also state whether boundary contact counts as intersection or containment for the decision.
Write the intended use, consequence of error, required evidence, spatial support and release authority before selecting a representation or transformation. Fitness is evaluated against a versioned contract and use, not attached permanently to a file extension.
Core concept
Topology describes relationships that remain after continuous deformation: connectivity, incidence, adjacency, boundary and interior. Geometry supplies coordinates and metric quantities. A simple ring cannot cross itself; holes must lie in their permitted shell and satisfy the selected boundary rules; a network edge must reference existing nodes; adjacent polygons may require coincident shared boundaries rather than nearly parallel copies. Spatial predicates should classify interior, boundary and exterior explicitly instead of reducing all relationships to a single Boolean too early.
Keep received evidence, accepted analytical views and derived representations as distinct objects. This allows corrected evidence, a changed transform or a new level of detail to generate a new result without rewriting history. Every coordinate and primitive therefore answers both a spatial question and a provenance question.
Algorithm and data model
Build validation as ordered predicates: schema and finite coordinates; primitive cardinality; closure; repeated consecutive vertices; zero-length edges; ring simplicity; shell and hole relationships; component relationships; then dataset-level adjacency or coverage rules. Report exact primitive identities and coordinates for every failure. Repair is a separate transform with a declared policy such as removing consecutive duplicates, orienting rings, polygonising linework or splitting at intersections. A repair can change area, components or identifiers, so compare before and after and require review when semantic identity changes.
Define parsing, semantic validation, canonicalisation, indexing, exact or approximate calculation, quality evaluation and encoding as separate stages. Each stage emits structured output and does not depend on interface state, file order, graphics-driver behaviour or undocumented defaults.
Constraints and invariants
| Invariant | Executable or review test | | --- | --- | | Validity is evaluated against a declared geometry model and intended operations. | Reject or quarantine the exact affected object and preserve the received representation. | | Every topology failure identifies exact primitives and the failed predicate. | Evaluate this condition before creating a derived geometry, grid, surface or volume. | | Metric tolerance never replaces an interior-boundary-exterior classification. | Record the predicate, tolerance policy, observed values and coordinate frame. | | Repair creates a derivative and reports changed area, components and identity. | Make every repair a new version and rerun all dependent golden cases. |
An invariant must survive import, transformation, processing, export and rerun. A failed hard invariant produces no apparently valid substitute. Diagnostics remain visible with predicate, threshold, coordinate frame, scope and evidence, and require a reviewed rule before they can trigger repair.
Quantitative reasoning
For each object report vertex, edge, ring and component counts; zero-length edge count; self-intersection pairs; minimum clearance; area before and after repair; and changed-component count. A closed orientable triangular shell can be checked with edge incidence and Euler characteristic \chi=V-E+F, interpreted by component and genus rather than used as a universal validity score. For planar coverage, report overlap area and gap area against a declared expected extent. Use exact or robust predicates for classification, then apply metric tolerances only to questions that are genuinely distance based.
Every metric includes units, support, numerator and denominator where applicable, exclusions, comparison policy and evaluation version. Aggregate metrics are stratified when pooling can hide local geometry failure. A performance gain cannot overrule invalid topology, missing reference metadata or broken lineage.
Evidence and uncertainty
Keep acquisition uncertainty, interpretation uncertainty, discretisation error, numeric round-off and delivery error separate. Increasing coordinate digits or triangle count does not improve the original evidence. A sampled surface may be smooth and watertight while remaining poorly constrained between observations. Report uncertainty in the quantity and support to which it belongs.
Build an evidence packet containing immutable received objects, semantic declarations, validation findings, transform inputs and outputs, measured errors, test results, reviewer decisions and fingerprints. Contradictory evidence remains available. When a required reference, topology state or classification cannot be resolved, return unknown, conflict or blocked rather than inventing geometry.
Interfaces and storage
Interfaces transmit identity, coordinate reference, units, axis order, support, topology expectations, attribute association, null state, version and lineage beside coordinates. Structured errors identify the object, primitive, predicate, observed value, expected condition and rule. An interface that carries vertices but drops the transform or face orientation has not preserved the object.
Store authoritative received evidence separately from reproducible analytical derivatives and disposable delivery artefacts. Indexes, caches, pyramids and render meshes improve access but cannot become the only copy of source attributes or coordinate metadata. Round-trip tests verify identity, precision, topology, ordering, missingness and association after encoding changes.
Governance and review
Assign responsibilities to roles rather than named organisations or people: evidence custodian, representation author, algorithm maintainer, independent validator and release reviewer. A role may propose a repair but cannot erase the received geometry. Transform, predicate and tolerance changes are versioned and evaluated against fixed regression fixtures before release.
Exceptions are explicit decisions with scope, rationale, evidence, approving role, affected versions and review trigger. They never turn invalid topology into valid topology by label. The host website has no ownership or scientific-authority role in this workflow; it only delivers the tutorial.
Integration checkpoint
Read the figure as a reasoning map from preserved evidence through declared support and coordinates, controlled transformation, validation and scoped release. Each arrow represents a declared relationship. Integrate a vector-topology validator and non-destructive repair register into SYN-SPATIAL, rerun earlier fixtures and record every changed assumption.
Synthetic worked example
Synthetic polygon SYN-P03 is a bow-tie ring with four unique corners. Its shoelace-area calculation nearly cancels to zero, but that number does not prove the polygon is empty; the ring is self-intersecting and has no unambiguous simple-polygon interior under the selected contract. The validator reports the two crossing edges and blocks area and containment. A polygonisation repair produces two candidate triangles, preserves the original ring, records changed component identity and waits for a review role to decide whether either candidate matches the intended feature.
- Preserve the received object and state the intended decision without repair.
- Resolve identity, reference, units, support, topology and evidence eligibility.
- Run the versioned transform or predicate while retaining intermediate diagnostics.
- Issue accept, reject or quarantine and show how an independent reviewer reproduces it.
Practice task
Implement the chapter artefact against a synthetic fixture containing one normal case, one boundary case, one invalid case and one unresolved-evidence case. Preserve the received fixture. Produce canonical input, validation findings, derivative output, processing manifest, measured error and a short release decision.
Acceptance criteria:
- Every required identity, coordinate reference, unit, support and convention is explicit.
- The implementation is deterministic under stable ordering and the declared numerical policy.
- No repair overwrites received evidence or converts unknown into a guessed value.
- All hard failures block the affected derivative and remain machine-readable.
- A second implementation or reviewer can reproduce the result from the package alone.
Submit a vector-topology validator and non-destructive repair register, golden and adversarial fixtures, exact findings, measured error and a limitations note. A screenshot is not sufficient evidence because it does not identify input versions, transforms, algorithms or rule configuration.
Common failure modes
- Accepting a polygon because its first and last coordinates match.
- Buffering by a tiny amount as an undocumented universal repair.
- Treating boundary contact, overlap and containment as the same relation.
- Replacing the source object with repaired output and losing failed edges.
These failures share a pattern: implicit convenience is substituted for evidence. Diagnose the earliest boundary where the assumption entered, restore the source statement, make the transform or predicate explicit, rerun all dependent derivatives and supersede rather than overwrite the affected release.
Review questions
- How do geometry and topology differ?
- Why does a near-zero signed area not validate a self-intersecting ring?
- Which properties must be compared across a repair?
- When should dataset-level adjacency be checked after object validity?
For every answer, identify the governing invariant, evidence needed to evaluate it, numerical or semantic policy involved and correct behaviour when the condition fails.
Sources and further reading
- ISO 19107:2019 spatial schema, specifying conceptual geometry, topology and spatial operations for geographic information.
- OGC Simple Feature Access 1.2.1, defining common vector geometry types, validity concepts and spatial relationships.
- CGAL Polygon Mesh Processing manual, documenting manifold assumptions, self-intersection tests, point-side predicates and mesh repair.
- ISO 19157-1:2023 geographic data quality, providing a framework for describing and evaluating geographic-data quality.