Road Watcher - a simple Python bot to monitor road class changes
ߊ߬ ߟߊߦߟߍ߬ߣߍ߲߬ ߦߋ߫ RicoElectrico ߓߟߏ߫ 26 April 2024 ߦߋ߫ English ߟߋ߬ ߘߐ߫There are some object categories in OSM whose exact classification is often a matter of contention and edit wars. Main highways are one of the most prominent examples. There was a small edit war in Poland which resulted in no less than 4 blocks, but I did not let that crisis go to waste:
Behold road-watcher, a quick Python project that regurarly queries Overpass API for highway=secondary
and above within a specified boundary and then detects any classification changes, sending them to a Discord channel (though it’s trivial to substitute it with another means of notification).
Discussion
ߡߙߌߣߊ߲ ߞߊ߬ ߝߘߊ߫ mmd ߟߊ߫ 5 May 2024 at 08:27 ߘߐ߫
You could probably achieve something similar by using https://gist.github.com/mmd-osm/bca4da8cd9afe8a071c45fef38e9afa6 -
The query only returns ways which have changed since a cut off timestamp (newer:…), and then returns the same ways again at the cut of timestamp itself.
As a result, you don’t need to store the previous query result anymore but only the last processing timestamp.
Also, the query result should hopefully be much smaller, like a few hundred ways instead of more than 200k.
There’s one caveat: the way the retro statement is used here might change in the future (see osm.wiki/Overpass_API/Overpass_QL#The_block_statement_retro )