Skip to content

Instantly share code, notes, and snippets.

@Nate-Wessel
Created September 5, 2019 00:17
Show Gist options
  • Save Nate-Wessel/7f74baaad95f847786e0e1ada5527b97 to your computer and use it in GitHub Desktop.
Save Nate-Wessel/7f74baaad95f847786e0e1ada5527b97 to your computer and use it in GitHub Desktop.
Overpass query to select buildings in hamilton county not recently edited.
[timeout:600];
// Hamilton County area by id
rel(104784); map_to_area->.ham;
// get older buildings inside the county
way(area.ham)[building](if: timestamp() < "2014-08-25")->.buildings;
// iterate over buildings, checking the dates on their nodes
foreach .buildings->.way {
// only add ways to the result set if nodes are also
// not recently modified
node(w.way)(if: timestamp() > "2014-08-25");
if (count(nodes) == 0) {
( .way; .result; )->.result;
}
}
// recurse to include nodes of ways
(.result;>;);
out body;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment