Skip to content

Instantly share code, notes, and snippets.

@govvin
Created November 7, 2017 08:55
Show Gist options
  • Save govvin/b36191f3c3b9b5de28480a6ca575294f to your computer and use it in GitHub Desktop.
Save govvin/b36191f3c3b9b5de28480a6ca575294f to your computer and use it in GitHub Desktop.
Overpass Turbo query: number of village halls in a given geographic area
/*
number of village halls in a province
*/
[out:csv(::id,"name",::lat,::lon,::is_in;false)]
[timeout:60];
area["name"="Calabarzon"]->.territory;
way(area.territory)["townhall:type"="village"];
foreach(
node(w)->.n;
.n is_in->.a;
area.a[name][boundary=administrative][admin_level~"^[2-8]$"] -> .a;
out center;
convert way ::=::,
::id = id(),
is_in=a.set("{" + t[admin_level] + ":" + t[name] + "}");
out;
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment