Chapter 9. Topology Checking and Data Validation

In this chapter, we will cover the following topics:

  • Creating a rule – only one point inside a polygon
  • A point must be on the starting and ending nodes of a line only
  • LineStrings must not overlap
  • A LineString must not have dangles
  • A polygon centroid must be within a specific distance of a line

Introduction

Topology rules allow you to enforce and test spatial relationships between different geometry sets. This chapter will build an open source set of topology rules that you can run from the command line or integrate in your python programs.

The spatial relationships described by the DE-9IM (Nine Intersect Model) are Equals, Disjoint, Intersects, Touches, Crosses, Within, Contains, and Overlaps. However, ...

Get Python Geospatial Analysis Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.