Skip to content

Instantly share code, notes, and snippets.

@govvin
Last active November 7, 2017 05:46
Show Gist options
  • Save govvin/64de280f9c9c1692980534d16099a360 to your computer and use it in GitHub Desktop.
Save govvin/64de280f9c9c1692980534d16099a360 to your computer and use it in GitHub Desktop.
query to count suspicicious nodes made (mostly) by maps.me users in the Philippines, filtered by date
/*
See: https://git.io/vFCea
*/
[out:csv("ISO3166-2", name, total )][timeout:500];
{{period="2017-10-31T23:59:59Z"}}
//All PH regions
area["ISO3166-2"~"^PH"][admin_level=3][boundary=administrative];
// Count the occurunces in each area
foreach->.region(
// Collect tagged objects in the area
( node(newer:{{period}})(area.region)[amenity=shelter];
/*node(newer:{{period}})(area.region)[tourism=viewpoint];
node(newer:{{period}})(area.region)[tourism=artwork];
node(newer:{{period}})(area.region)[tourism=guest_house];
*/node(newer:{{period}})(area.region)[tourism=attraction];
node(newer:{{period}})(area.region)[historic=castle]);
make count "ISO3166-2" = region.set(t["ISO3166-2"]),
//"Philippines" = region.set(t[ "Philippines"]),
name = region.set(t["name"]),
total = count(nodes);
out;
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment