Method · FME workspace · 2021

Finding overlapping address ranges with geometry

Address ranges and LRS measures describe a road network through attributes, so overlaps slip past spatial checks and defeat SQL lag/lead tricks. This method redraws every range as a straight line on a single axis and lets the spatial engine intersect them, finding every overlap at once.

Year
2021
Files
1 download

Results

  • Finds segments that overlap many others, not just the next in sort order.
  • Scales to millions of records: the geometry math is cheap.
  • Works for LRS measures and 9-1-1 address ranges.
  • Published with a sample FME workspace.

Stack

  • FME
  • Custom transformers
  • LineOnLineOverlayer
  • Road centerline data
  • LRS measures

The problem

Linear referencing measures in transportation and address ranges in 9-1-1 systems both model a road’s connectivity through attributes rather than geometry. When the ranges on two segments overlap, the same house number exists in two places.

Old Spanish Trail, Pima County, split into segments at each intersection.
Old Spanish Trail, Pima County, split into segments at each intersection.

Here segment 1’s right range runs 202 to 300, but segment 2’s right range starts at 240. Any address from 240 to 300 sits on both segments. Now imagine dispatching to 275 Old Spanish Trail.

From ranges in green, to ranges in red. Segment 2’s right range starts inside segment 1’s.
From ranges in green, to ranges in red. Segment 2’s right range starts inside segment 1’s.

With two records the error is easy to see. With two million it isn’t. SQL window functions can compare a record with its neighbor in the sort order, but which field do you sort on, and what about a record that overlaps twenty others?

Use geometry instead

From/to values ignore the road’s bends and should never overlap. So plot each range as a straight line on a plain Cartesian plane, with the from and to values as X and every line on the same Y. Overlapping ranges become intersecting lines, and a spatial engine finds intersections fast.

Both segments plotted on one axis. The overlap is boxed in red.
Both segments plotted on one axis. The overlap is boxed in red.

The FME workspace

About ten transformers do the real work, run once for left ranges and once for right.

The whole workspace, left and right ranges.
The whole workspace, left and right ranges.
  1. A Creator starts the run and a FeatureReader pulls the centerline CSV from a web URL.
  2. The stream splits into left and right ranges, and unneeded attributes are dropped.
  3. A custom transformer validates the data: it removes the original geometry, checks the measures are numeric and tests that from is less than to.
  4. Two VertexCreators build a new line from (from, 0) to (to, 0), so every range lands on the same axis.
  5. A LineOnLineOverlayer intersects the lines, grouped by street and locality so unrelated roads never match.
  6. A Tester keeps features with more than one overlap (every feature overlaps itself), a ListExploder lists each overlap, and self-matches are dropped.
  7. The overlap length is calculated and the results are formatted.
Results as a straight-line diagram: ranges in orange, overlaps in red. OBJECTID 18 covers all of 4 and runs into 12.
Results as a straight-line diagram: ranges in orange, overlaps in red. OBJECTID 18 covers all of 4 and runs into 12.

I also wrote this method up as an article: read it on LinkedIn.

Downloads