Checking for changes to Long Distance Paths
Posted by SomeoneElse on 30 July 2021 in English. Last updated on 15 October 2021.
Previously I wrote about checking National Parks in Britain and Ireland for breakage, by counting the number of valid polygons in a rendering database.
A similar approach can also be used to check line features as well as polygons. It’s possible to count the number of contiguous sections of a given polygon. For example, here’s the Lyke Wake Walk, which is in one piece:
psql -d gis -c "SELECT count(*) FROM planet_osm_line WHERE (osm_id = '-1996318');"
count
-------
2
(1 row)
and here is the Sabrina Way, which isn’t:
psql -d gis -c "SELECT count(*) FROM planet_osm_line WHERE (osm_id = '-537430');"
count
-------
12
(1 row)
If something is changed in OSM that introduces an extra piece, or fixes a gap, that number will change. This script can be used to count the change in the number, like this:
Change in relation components for Sabrina_Way 537430
3c3
< 12
---
> 13







