Postgis topology workshop session
Setting up a boundaries database with PostGIS topology
Benjamin Deswysen
Benjamin Deswysen
→ Geomatician @GeoPostcodes
Polleur (Liège, Belgium)
ULiege, UNamur
Geo data science & engineering
OSM occasional contributor
2
© Taïs Grippa - 2023
4
5
6
“A collection of vector polygons representing either postal code or administrative division shapes.”
Boundaries database
GeoPostcodes products
“A truly global data set containing all administrative divisions, cities and postal codes for 247 countries.”
Worldwide postal database
GeoPostcodes products
“A collection of vector polygons representing either postal code or administrative division shapes.”
Boundaries database
GeoPostcodes products
“Complete your geo data with street-level information for address validation, autocomplete, and last-mile delivery.”
Streets database
01
Topology in GIS
Topology
Geography <=> Territory delimitations and “ownership”
Topology
Geography <=> Territory delimitations and “ownership”
Topology definition
Topology expresses the spatial relationships between connecting or adjacent vector features (points, polylines and polygons) in a GIS.
Topological or topology-based data are useful for detecting and correcting digitising errors (e.g. two lines in a roads vector layer that do not meet perfectly at an intersection). Topology is necessary for carrying out some types of spatial analysis, such as network analysis.
Topology errors
Topology rules examples
02
Postgis topology
= postgresql extension
- 4 Edges
- 4 Nodes
17
Example of polygon boundaries
1 Polygon
18
GIS topology = outgrowth of graph theory
It’s a �graph!
Postgis topology datamodel
=> Topological primitives
“lines”
“polygons”
“points”
Postgis topology datamodel
Face
Edge
Node
Topogeometry type
Topogeometry = postgis topology column type
= layers (groups) of primitives
= composed object � (topology_id, layer_id, topogeo id, type)�
Topology ≠ Geometry
Advantages of postgis topology
Advantages of postgis topology
Advantages of postgis topology
VIZ / HPR boundaries databases
Simplification
Real polygon
Simplification: careful with tolerance value
1 Polygon� - 2 Edges� - 2 Nodes
Simplification
→ Oversimplification = Empty geometry!
Simplification: careful with tolerance value (2)
1 Polygon� - 2 Edges� - 2 Nodes
Densify topology� - 5 Edges� - 5 Nodes
Simplification
03
Q&A
Any questions?
04
Workshop
Get your hands dirty!
https://bdeswysen.gitlab.io/postgis_topology_workshop