Sometimes one Geospatial Frequently Asked Question (G-FAQ) leads me directly into my next topic, and that is the case this month. While doing research for the four part series on ‘What is GIS?’, I realized that I had a gap in my GIS knowledge on topology. There is not a day that goes by where I am not learning something new and this G-FAQ is no different. So without further ado, let’s jump into an exploration of spatial topology in the world of GIS.
This two-part G-FAQ on spatial topology will focus on three core questions:
What is spatial topology, why is it important and how is it maintained in GIS? What are example files types that are topological in Esri’s ArcGIS? Do shapefiles have topology?
Before we jump head long into this discussion on spatial topology, let me start with a high-level definition. Topology is the science and mathematics of spatial relationships of vectors in GIS. There are four basic spatial relationships that can be maintained with vector features, I will elaborate on these shortly: adjacency, connectivity, containment and coincidence. These spatial relationships are recorded in topological vector models with the assumption of a two-dimensional world (i.e. all of the features are on the same plane). Keep in mind that raster files do not have topology – for a detailed handling of vector versus raster file types, please refer to the April 2014 G-FAQ edition.
As a quick side note, similar to the last few G-FAQ’s, this edition will also focus on Esri’s ArcGIS with regards to topology – though I do assume (perhaps incorrectly!) that these relationships are maintained likewise in all GIS software.
Arc-Node Data Structure
Spatial topology in ArcGIS is predicated on the vector arc-node data structure. As was mentioned in the April 2014 G-FAQ, there are three basic types of vectors, i.e. points, lines (or arcs) and polygons. Here are the basic rules of the arc-node data structure:
- All arcs are comprised of nodes with 0 to more vertices in between.
- A node is at the start and end of each arc. As there is a start and end to arcs, they have a direction in which they are created.
- Vertices between nodes define the shape of arcs. You can think of vertices as points along the curve of an arc.
- Arcs can be connected and if they are, they share a common node.
- Connecting arcs in a close geometric shape creates polygons.
- When arcs are connected to make a polygon, it actually defines two polygons. The first is often called the ‘universe polygon,’ which is all of the space outside the defined shape. The second is the area contained within the connected arcs.
Each of the arc-node relationships defined above are stored in lists. For points, the list contains an identifying number and its X and Y position (or coordinate).
For lines, the list contains an arc number, the start and end node numbers and thus the direction of the arc (i.e. clockwise or counter-clockwise) is inferred here. There is also an arc-coordinate list that contains the arc number and the associated X and Y coordinates.
For a polygon, there are also two lists. The first is the polygon-arc list which contains an identifying polygon number and then the arc numbers that comprise it. The second is the left-right list which contains the arc number and then the identifying number of the polygons to the left and right of the arc.
The Types of Spatial Topology and the Files That Maintain It
As has been discussed in previous G-FAQ editions, there are four basic types of spatial topology that can be maintained:
- Adjacency – which vector features are next to each other?
- Connectivity – which arcs connect to each other?
- Containment – which vector features are within other polygons?
- Coincidence – which vector features occupy the same space?
In ArcGIS, there are two key file types that maintain topology, ArcINFO coverage files and geodatabases. The reason I say key file types here is to allow some wiggle room as admittedly there may be other file types with topology but I was unable to uncover any in my research. If our readers know of additional file types with explicit spatial topology, please leave a comment below so the rest of us can learn even more!
ArcINFO coverage files are rarely used today, well at least in the GIS work that I have done. They can be thought of as the original Esri shapefiles. By definition, a coverage file is topological as a topology table is created and maintained as the file is modified and expanded upon. Coverages are a collection of various files, the topology table is one of them, and they have a complex structure as you see in the case of a geodatabase. A coverage can contain point, line and polygon features in a single file. Often times, you will see coverages grouped into a single file with the extension .e00 – these are called ArcINFO Export files and need to be extracted first before they can be read by ArcGIS. One tool you can use to extract ArcINFO Export files is offered for free from Esri here, it is called Import71.
Geodatabases are by far the more popular file format that can maintain topological relationships; and I say they can maintain topology as it is possible to create a geodatabase without these rules embedded. A geodatabase can also contain point, line and polygon layers which are called features. In order to embed topology in a geodatabase, it is necessary to define classes of features and the rules that relate them to each other. Topology can be maintained between points, line and polygons. Once these rules are validated, the set of features will be related through topological relationships that are maintained even when you edit. It is possible to create exceptions to these topological rules so they can be violated in specific instances but then maintained across the broad set of related features.
There are two key differences with regards to spatial topology of ArcINFO coverage files and geodatabases. First, in coverage files, there is a specific table defining all the topological relationships between the features that is created and changed as the file is edited. And for a geodatabase, there is not a specific table but rather a set of rules that are stored to maintain topology. Second, with a geodatabase it is possible to edit a set of feature classes that share a common geometry, while in coverage files each vector layer must be edited independently. So for example take two polygon layers representing parcels and easements in a city where they share a common geometry (or boundaries). When the parcel layer is edited in a geodatabase, so is the easement layer; while in a coverage file, it would be necessary to edit both layers independently.
By now, I am sure our readers’ heads are full of fun information on arc-node data structures and spatial topology, so for now, let’s call a close to this two-part G-FAQ. In the next edition, we will pick up this discussion, looking at why spatial topology is (or perhaps was…) important and at the ‘topology’ of shapefiles.
Do you have an idea for a future G-FAQ? If so, let me know by email at email@example.com.
Find Out More About This Topic Here
- Esri – ArcGIS: Working with Geodatabase Topology
- Oberlin College – Understanding Topology
- Saint Louis University – How to Create and Edit Topology
- State University of New York – Data Structures
- University of Eastern Michigan – Fundamentals of GIS Data
- University of Massachusetts – Topology Slides
- University of Nebraska, Omaha – Structuring Maps
- University of North Texas – GeoDatabase Topology
- University of Texas – Vector Data Model
- University of Washington – Spatial Data Model
Brock Adam McCarty