You are on page 1of 87

Introduction to topology

© Donald Boyes, Department of Geography and Planning, University of Toronto 1
Designing a vector data file format
What would be useful?
Creating data
• Prevent editing errors
• Detect and correct existing errors
Storing data
• No redundancy, so more efficient
Using data
• Easy to edit
• Spatial analysis more efficient
• e.g., is this road connected to that road?

© Donald Boyes, Department of Geography and Planning, University of Toronto 2
Topology
 The branch of geometry that deals with the 
properties of a figure that remain unchanged 
even when the figure is bent, stretched, or distorted

 Topology defines and enforces data integrity rules 
 e.g., there should be no gaps between polygons
…Esri Dictionary
https://support.esri.com/en/other‐resources/gis‐dictionary/term/topology

© Donald Boyes, Department of Geography and Planning, University of Toronto 3
Can only 
have one 
owner

Example: land ownership

Preventing overlap

© Donald Boyes, Department of Geography and Planning, University of Toronto 4
All space must be occupied, 
and by only one polygon

Planar enforcement

© Donald Boyes, Department of Geography and Planning, University of Toronto 5
A B

Which polygon is next to A?

Adjacency

© Donald Boyes, Department of Geography and Planning, University of Toronto 6
Is the lake inside the land parcel polygon?

Containment

© Donald Boyes, Department of Geography and Planning, University of Toronto 7
All space 
should be 
Which one  accounted for
is correct?

Planar enforcement

Slivers

© Donald Boyes, Department of Geography and Planning, University of Toronto 8
Shared boundaries stored twice, edited twice

Data redundancy

© Donald Boyes, Department of Geography and Planning, University of Toronto 9
Example: roads

Overshoot

Undershoot
(error beyond Snapping
snapping tolerance) tolerance

Digitizing errors

© Donald Boyes, Department of Geography and Planning, University of Toronto 10
Intersections?

Nodes

Driving directions

© Donald Boyes, Department of Geography and Planning, University of Toronto 11
Adjacency Containment Connectivity

Topology: spatial relationships

© Donald Boyes, Department of Geography and Planning, University of Toronto 12
Why use topology?
 Reduce errors
 Efficient data storage 
 Efficient analysis.

© Donald Boyes, Department of Geography and Planning, University of Toronto 13
Topology and data formats

© Donald Boyes, Department of Geography and Planning, University of Toronto 14
.docx file .txt file

Same data, different file types (data models)

© Donald Boyes, Department of Geography and Planning, University of Toronto 15
Software: ArcInfo ArcView ArcGIS
Developed: 1980s 1990s 2000s

Same data:

Data format: Coverage Shapefile Geodatabase


Topology required Topology absent Topology optional
Complicated Simple Sophisticated
Hard to use Easy to use Easy to use
Efficient data Inefficient data ↑ Func onality

© Donald Boyes, Department of Geography and Planning, University of Toronto 16
© Donald Boyes, Department of Geography and Planning, University of Toronto 17
Koffler Scientific Reserve
Land Cover
Cedar
Conifer dominated mixed wood
Hemlock dominated mixed wood
Locust
Mixed deciduous hedge row
Mixed wood
Red pine
Scots pine
White pine
Sugar maple
Old growth hardwood
Tolerant hardwood
Field
Barren and scattered
Building
Bog
Water

0 0.5 1
Land cover2 Km

© Donald Boyes, Department of Geography and Planning, University of Toronto 18
Koffler Scientific Reserve
Land Cover
Cedar
Overlapping 
Conifer dominated mixed wood
Hemlock dominated mixed wood
Locust
polygons Koffler Scientific Reserve
Mixed deciduous hedge row Land Cover
Mixed wood Cedar
Red pine
Scots pine
Conifer dominated mixed wood
White pine Hemlock dominated mixed wood
Sugar maple Locust
Old growth hardwood
Tolerant hardwood Mixed deciduous hedge row
Field Mixed wood
Barren and scattered
Red pine
Building
Bog Scots pine
Water White pine
Sugar maple
Old growth hardwood
Tolerant hardwood
Field
Barren and scattered
Building
Bog

Land cover classes should  Water

be mutually exclusive

Shapefile: overlapping polygons

© Donald Boyes, Department of Geography and Planning, University of Toronto 19
Koffler Scientific Reserve
Area Errors
Land Cover
Cedar
Conifer dominated mixed wood
Line Errors
Hemlock dominated mixed wood
Locust
Mixed deciduous hedge row
Point Errors
Mixed wood
Red pine
Land cover topology
Scots pine
White pine
Sugar maple
Old growth hardwood
Tolerant hardwood
Field
Barren and scattered
Building
Bog
Water

Topological errors

© Donald Boyes, Department of Geography and Planning, University of Toronto 20
Shapefile: simple, no topology

© Donald Boyes, Department of Geography and Planning, University of Toronto 21
Software: ArcInfo ArcView ArcGIS
Developed: 1980s 1990s 2000s

Same data:

Data format: Coverage Shapefile Geodatabase


Topology required Topology absent Topology optional
Complicated Simple Sophisticated
Hard to use Easy to use Easy to use
Efficient data Inefficient data ↑ Func onality

© Donald Boyes, Department of Geography and Planning, University of Toronto 22
Geometry Attributes
point Name Speed Limit
Bloor Street West 50
Record
University Avenue Field
60
line
St. George Street 40
College Street 50
polygon

Vector data model

© Donald Boyes, Department of Geography and Planning, University of Toronto 23
1
3

2
4

(0,0)
Points

© Donald Boyes, Department of Geography and Planning, University of Toronto 24
Geometry
Point ID X,Y
1 (1,8)
1 2 (3,4)
3 3 (5,7)
4 (9,3)

Attributes
2 Point ID Tree
1 Maple
4
2 Elm
3 Oak
4 Pine

(0,0)

© Donald Boyes, Department of Geography and Planning, University of Toronto 25
(0,0)
Lines

© Donald Boyes, Department of Geography and Planning, University of Toronto 26
ID X,Y coordinates
Intersection? 1 (2,10) (2,2) (10,2)
2 (2,8) (5,8) (7,6) (7,0)
2

Simple data model:
 Intersections, overlaps 
1 not stored in data
 Lines are not “aware” 
of each other

Intersection or
overpass?
vertex
(0,0)

© Donald Boyes, Department of Geography and Planning, University of Toronto 27
(0,0)
Polygons

© Donald Boyes, Department of Geography and Planning, University of Toronto 28
ID X,Y coordinates
1 (1,9) (6,9) (6,8) (4,6) (1,6) (1,9)
2 (1,6) (4,6) (4,1) (1,6)
1 3 (6,9) (9,9) (9,1) (4,1) (4,6) (6,8) (6,9) 
4 (6,4) (8,4) (8,2) (6,2) (6,4)

3
4

vertex
(0,0) (adapted from Chang, 2014)

© Donald Boyes, Department of Geography and Planning, University of Toronto 29
Coordinates stored twice, edited twice ID X,Y coordinates
1 (1,9) (6,9) (6,8) (4,6) (1,6) (1,9)
2 (1,6) (4,6) (4,1) (1,6)
1 3 (6,9) (9,9) (9,1) (4,1) (4,6) (6,8) (6,9) 
4 (6,4) (8,4) (8,2) (6,2) (6,4)

2 Closing the polygon

3 Simple data model:
4  Adjacencies, overlaps 
not stored in data
 Redundancies
Overlaps not stored

(0,0)

© Donald Boyes, Department of Geography and Planning, University of Toronto 30
Spaghetti data model
 Lines do not intersect, but “overlap” each other 
like spaghetti noodles on a plate

© Donald Boyes, Department of Geography and Planning, University of Toronto 31
Simple data model: limitations
 Redundancy
 Coordinates stored twice, edited twice
 Prone to error
 No easy way to check for overlaps, slivers, etc.
 Isolated objects
 Spatial relationships must be calculated
 Example: 
 Esri shapefile.

© Donald Boyes, Department of Geography and Planning, University of Toronto 32
Data editing
 Data quality affects all subsequent analysis
 Data errors can cause errors in analysis results
 “garbage in, garbage out”
 Time‐consuming to track down.

© Donald Boyes, Department of Geography and Planning, University of Toronto 33
Coverage: complex, but has topology

© Donald Boyes, Department of Geography and Planning, University of Toronto 34
Software: ArcInfo ArcView ArcGIS
Developed: 1980s 1990s 2000s

Same data:

Data format: Coverage Shapefile Geodatabase


Topology required Topology absent Topology optional
Complicated Simple Sophisticated
Hard to use Easy to use Easy to use
Efficient data Inefficient data ↑ Func onality

© Donald Boyes, Department of Geography and Planning, University of Toronto 35
1
3

2
4

(0,0)
Points

© Donald Boyes, Department of Geography and Planning, University of Toronto 36
Point ID X,Y
1 (1,8)
1 2 (3,4)
3 3 (5,7)
4 (9,3)

2
4

(0,0)

© Donald Boyes, Department of Geography and Planning, University of Toronto 37
(0,0)
Lines

© Donald Boyes, Department of Geography and Planning, University of Toronto 38
Arc ID X,Y coordinates
1 1 (2,10) (2,8)
2 (2,8) (5,8) (7,6) (7,2)
2
3 (2,8) (2,2) (7,2) 
4 (7,2) (10,2)
5 (7,2) (7,0)

4
5 vertex
(0,0)

© Donald Boyes, Department of Geography and Planning, University of Toronto 39
1
1
2 2

3 4 4
5 vertex
5 node
(0,0)

© Donald Boyes, Department of Geography and Planning, University of Toronto 40
1 Arc ID X,Y coordinates
1 1 (2,10) (2,8)
2 (2,8) (5,8) (7,6) (7,2)
2 2
3 (2,8) (2,2) (7,2) 
4 (7,2) (10,2)
5 (7,2) (7,0)

Arc ID F-node T-node


3
1 1 2
2 2 3
3 2 3
Shared node
4 3 4
3 4 4 5 3 5
5 vertex
5 node
(0,0) (adapted from Chang, 2014)

© Donald Boyes, Department of Geography and Planning, University of Toronto 41
(0,0)
Polygons

© Donald Boyes, Department of Geography and Planning, University of Toronto 42
vertex
(0,0)

© Donald Boyes, Department of Geography and Planning, University of Toronto 43
Arc ID X,Y coordinates
1 (6,9) (1,9) (1,6)
1 1 2 (1,6) (4,6) 
3 (6,9) (6,8) (4,6)
3 4 (1,6) (1,1) (4,1)
5 (4,6) (4,1)
2 2 3 6 (6,9) (9,9) (9,1) (4,1)
7 (6,4) (8,4) (8,2) (6,2) (6,4)
6
5
4 5
7

4 vertex
(0,0) node

© Donald Boyes, Department of Geography and Planning, University of Toronto 44
Arc ID X,Y coordinates
1 (6,9) (1,9) (1,6)
1 1 2 (1,6) (4,6) 
3 (6,9) (6,8) (4,6)
1 3 4 (1,6) (1,1) (4,1)
5 (4,6) (4,1)
2 2 3 6 (6,9) (9,9) (9,1) (4,1)
3
7 (6,4) (8,4) (8,2) (6,2) (6,4)
6 Poly ID Arc ID Coordinates for 
5 1 1, 2, 3 each vertex only 
4 2 5 2 2, 4, 5 stored once 
4 7 3 3, 5, 6, 0
4 7

4 vertex
(0,0) node (adapted from Chang, 2014)

© Donald Boyes, Department of Geography and Planning, University of Toronto 45
Arc ID X,Y coordinates
1 (6,9) (1,9) (1,6)
1 1 2 (1,6) (4,6) 
3 (6,9) (6,8) (4,6)
1 3 4 (1,6) (1,1) (4,1)
5 (4,6) (4,1)
2 2 3 6 (6,9) (9,9) (9,1) (4,1)
3
7 (6,4) (8,4) (8,2) (6,2) (6,4)
6 Poly ID Arc ID Coordinates for 
5 1 1, 2, 3 each vertex only 
4 2 Planar 
5 2 2, 4, 5 stored once 
enforcement 4 7 3 3, 5, 6, 0
4 7

4 vertex
(0,0) node

© Donald Boyes, Department of Geography and Planning, University of Toronto 46
Arc ID X,Y coordinates
0 1 (6,9) (1,9) (1,6)
1 1 2 (1,6) (4,6) 
3 (6,9) (6,8) (4,6)
1 3 4 (1,6) (1,1) (4,1)
5 (4,6) (4,1)
2 2 3 6 (6,9) (9,9) (9,1) (4,1)
3
7 (6,4) (8,4) (8,2) (6,2) (6,4)
6 Poly ID Arc ID Arc ID L‐poly R‐poly
5 1 1, 2, 3 1 1 0
4 2 5 2 2, 4, 5 2 1 2
4 7
Polygons are 3 3, 5, 6, 0 3 3 1
adjacent 4 7 4 2 0
5 3 2
4 vertex 6 0 3
7 3 4
(0,0) node

© Donald Boyes, Department of Geography and Planning, University of Toronto 47
Spaghetti with meatballs
data model

(0,0)

© Donald Boyes, Department of Geography and Planning, University of Toronto 48
0 (universe polygon) Planar Enforcement
 All space must be 
accounted for, and 
occupied by only one 
polygon
 Overlapping polygons 
are split into separate 
polygons

© Donald Boyes, Department of Geography and Planning, University of Toronto 49
Topological data model
 Example: ESRI Coverage

© Donald Boyes, Department of Geography and Planning, University of Toronto 50
Comparison of shapefile, coverage
and geodatabase, based on topology

© Donald Boyes, Department of Geography and Planning, University of Toronto 51
Software: ArcInfo ArcView ArcGIS
Developed: 1980s 1990s 2000s

Same data:

Data format: Coverage Shapefile Geodatabase


Topology required Topology absent Topology optional
Complicated Simple Sophisticated
Hard to use Easy to use Easy to use
Efficient data Inefficient data ↑ Func onality

© Donald Boyes, Department of Geography and Planning, University of Toronto 52
Newmarket

Aurora

± 0 0.25 0.5 1 Km

Koffler Scientific Reserve (Joker’s Hill)

© Donald Boyes, Department of Geography and Planning, University of Toronto 53
Koffler Scientific Reserve
Land Cover
Cedar
Conifer dominated mixed wood
Hemlock dominated mixed wood
Locust
Mixed deciduous hedge row
Mixed wood
Red pine
Scots pine
White pine
Sugar maple
Old growth hardwood
Tolerant hardwood
Field
Barren and scattered
Building
Bog
Water

0 0.5 1
Land cover2 Km

© Donald Boyes, Department of Geography and Planning, University of Toronto 54
Coverage

Geodatabase
Feature class

Shapefile

Same data, different file formats

© Donald Boyes, Department of Geography and Planning, University of Toronto 55
Koffler Scientific Reserve
Land Cover
Cedar
Conifer dominated mixed wood
Hemlock dominated mixed wood
Overlapping 
Koffler Scientific Reserve
Locust
Mixed deciduous hedge row
polygons Land Cover
Mixed wood Cedar
Red pine
Scots pine
Conifer dominated mixed wood
White pine Hemlock dominated mixed wood
Sugar maple Locust
Old growth hardwood
Tolerant hardwood Mixed deciduous hedge row
Field Mixed wood
Barren and scattered
Red pine
Building
Bog Scots pine
Water White pine
Sugar maple
Old growth hardwood
Tolerant hardwood
Field
Barren and scattered
Building
Bog

Land cover classes should  Water

be mutually exclusive

Shapefile: overlapping polygons

© Donald Boyes, Department of Geography and Planning, University of Toronto 56
Overlapping 
polygons
Sliver

Shapefile: slivers, overlaps

© Donald Boyes, Department of Geography and Planning, University of Toronto 57
Convert shapefile to coverage

© Donald Boyes, Department of Geography and Planning, University of Toronto 58
No overlapping 
polygons

Coverage version of same data

© Donald Boyes, Department of Geography and Planning, University of Toronto 59
Sliver
polygons

Coverage version of same data

© Donald Boyes, Department of Geography and Planning, University of Toronto 60
Geodatabase topology
 Optional
 Can exist within and between feature classes
 More user‐oriented
 Like a “spell‐checker” for digitized map data.

© Donald Boyes, Department of Geography and Planning, University of Toronto 61
© Donald Boyes, Department of Geography and Planning, University of Toronto 62
Geodatabase
Feature class

Feature class in file geodatabase

© Donald Boyes, Department of Geography and Planning, University of Toronto 63
Geodatabase: no topology

© Donald Boyes, Department of Geography and Planning, University of Toronto 64
Feature dataset

Geodatabase: new feature dataset

© Donald Boyes, Department of Geography and Planning, University of Toronto 65
Geodatabase: new topology

© Donald Boyes, Department of Geography and Planning, University of Toronto 66
Topology

Geodatabase: new topology

© Donald Boyes, Department of Geography and Planning, University of Toronto 67
Geodatabase: new topology

© Donald Boyes, Department of Geography and Planning, University of Toronto 68
Koffler Scientific Reserve
Area Errors
Land Cover
Cedar
Conifer dominated mixed wood
Line Errors
Hemlock dominated mixed wood
Locust
Mixed deciduous hedge row
Point Errors
Mixed wood
Red pine
Land cover topology
Scots pine
White pine
Sugar maple
Old growth hardwood
Tolerant hardwood
Field
Barren and scattered
Building
Bog
Water

Topological errors

© Donald Boyes, Department of Geography and Planning, University of Toronto 69
Choosing the correct solution

© Donald Boyes, Department of Geography and Planning, University of Toronto 70
Georelational and object-relational
vector data models

© Donald Boyes, Department of Geography and Planning, University of Toronto 71
GEOMETRY ATTRIBUTES
Coordinates Columns of information

(RDBMS)

“Geo” “Relational”

Examples: shapefile, coverage

RDBMS: Relational database management system

Georelational data model

© Donald Boyes, Department of Geography and Planning, University of Toronto 72
Proprietary Commercial RDBMS
GEOMETRY ATTRIBUTES
Coordinates Columns of information

dBASE IV
(RDBMS)

RDBMS: Relational database management system

Shapefile

© Donald Boyes, Department of Geography and Planning, University of Toronto 73
Koffler Scientific Reserve
Land Cover
Cedar
Conifer dominated mixed wood
Hemlock dominated mixed wood
Locust
Mixed deciduous hedge row
Mixed wood
Red pine
Scots pine
White pine
Sugar maple
Old growth hardwood
Tolerant hardwood
Field
Barren and scattered
Building
Bog
Water

0 0.5 1
Shapefile
2 Km

© Donald Boyes, Department of Geography and Planning, University of Toronto 74
Looks like one file

Shapefile file structure

© Donald Boyes, Department of Geography and Planning, University of Toronto 75
.shp: geometry data
.dbf: attribute data (dBASE IV format)
.prj: projection

.sbn: spatial index for geometry
.sbx: spatial index for geometry
.shx: index of feature geometry
.cpg: code page for DBF encoding

Shapefile file extensions

© Donald Boyes, Department of Geography and Planning, University of Toronto 76
Proprietary Proprietary RDBMS
GEOMETRY ATTRIBUTES
Coordinates Columns of information

Esri INFO
(RDBMS)

(RDBMS)

TOPOLOGY
Spatial relationships

Esri coverage

© Donald Boyes, Department of Geography and Planning, University of Toronto 77
Coverage file structure
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Contents_of_a_coverage_workspace/001400000002000000/

© Donald Boyes, Department of Geography and Planning, University of Toronto 78
Feature attribute Feature attribute
Spatial data in
Feature class table coverage table in INFO
coverage directory
directory database

Point lab.adf pat.adf .nit and .dat


Arc arc.adf  aat.adf .nit and .dat
Node arc.nit, arc.adf nat.adf .nit and .dat
Route arc.adf, sec.adf <route>.rat  .nit and .dat
Section arc.adf <route>.sec  .nit and .dat

pal.adf, cnt.adf, 
Polygon pat.adf .nit and .dat
lab.adf, arc.adf

Region rxp.adf, <region>.pal  <region>.pat  .nit and .dat


Annotation <anno>.txt  <anno>.tat  .nit and .dat
Tic tic.adf tic.adf .nit and .dat
Link lnk.adf lnk.adf .nit and .dat
Coverage extent bnd.adf bnd.adf .nit and .dat

Coverage file structure

© Donald Boyes, Department of Geography and Planning, University of Toronto 79
Object-relational data model

© Donald Boyes, Department of Geography and Planning, University of Toronto 80
Proprietary Commercial RDBMS
RASTER GEOMETRY ATTRIBUTES
Coordinates Coordinates Columns of information

Microsoft Access
(RDBMS)

(RDBMS)

TOPOLOGY NETWORK DATASET ADDRESS LOCATOR


Spatial relationships Spatial relationships Styles (…and 
more)

Personal geodatabase

© Donald Boyes, Department of Geography and Planning, University of Toronto 81
One file!

 Designed for single users with small data sets
 Max. size 2 GB (slows down after 250 MB).

Personal geodatabase

© Donald Boyes, Department of Geography and Planning, University of Toronto 82
Proprietary Proprietary RDBMS
RASTER GEOMETRY ATTRIBUTES
Coordinates Coordinates Columns of information

Esri Geodatabase
(RDBMS)

(RDBMS)

TOPOLOGY NETWORK DATASET ADDRESS LOCATOR


Spatial relationships Spatial relationships Styles (…and 
more)

File geodatabase

© Donald Boyes, Department of Geography and Planning, University of Toronto 83
One folder

 Supports multiple editors
 No size limit
 Fast performance
 ESRI’s recommended (or “native”) file format.

File geodatabase

© Donald Boyes, Department of Geography and Planning, University of Toronto 84
47 files!

File geodatabase

© Donald Boyes, Department of Geography and Planning, University of Toronto 85
File geodatabase
Address locator
Feature dataset
Feature class

Topology

Network dataset

Table

Raster dataset

File geodatabase elements

© Donald Boyes, Department of Geography and Planning, University of Toronto 86
Object behavior
 Attribute domains
 Limit data entry to specific values
 Assign default values
 Preset behavior if objects are split or merged

 Relationships among objects
 e.g. a parcel of land can have only 2 owners.

© Donald Boyes, Department of Geography and Planning, University of Toronto 87

You might also like