{"id":1001,"date":"2018-04-21T13:52:31","date_gmt":"2018-04-21T11:52:31","guid":{"rendered":"http:\/\/hannes.enjoys.it\/blog\/?p=1001"},"modified":"2018-04-21T13:52:45","modified_gmt":"2018-04-21T11:52:45","slug":"solving-quiztime-with-a-spatial-relationship-query-in-overpass-turbo","status":"publish","type":"post","link":"https:\/\/hannes.enjoys.it\/blog\/2018\/04\/solving-quiztime-with-a-spatial-relationship-query-in-overpass-turbo\/","title":{"rendered":"(Not) Solving #quiztime with a spatial relationship query in Overpass-Turbo"},"content":{"rendered":"<p>I saw a #quiztime on Twitter and it looked like a perfect geospatial puzzle so I had to give it a try: <a href=\"https:\/\/twitter.com\/Sector035\/status\/987631780147679233\">https:\/\/twitter.com\/Sector035\/status\/987631780147679233<\/a><\/p>\n<p>So we have something called &#8220;Lidl&#8221; which I know is a supermarket. And we have something else, with a potential name ending in &#8220;nden&#8221;. And that&#8217;s it.<\/p>\n<p>If you have a global OSM database, this would be a simple query away. If you don&#8217;t have a global OSM database, the <a href=\"https:\/\/wiki.openstreetmap.org\/wiki\/Overpass_API\">Overpass API<\/a> let&#8217;s you query one. And <a href=\"http:\/\/overpass-turbo.eu\/\">overpass turbo<\/a> can make it fun (not in this case though, I had a lot of trial and error until I found <a href=\"https:\/\/wiki.openstreetmap.org\/wiki\/Overpass_API\/Overpass_QL#Relative_to_other_elements_.28around.29\">these nice examples in the Wiki<\/a>).<\/p>\n<p>I ended up looking for things within 50 meters to a Lidl named &#8220;-nden&#8221;<\/p>\n<blockquote>\n<pre>[out:json][timeout:180][maxsize:2000000000];\r\n\r\n{{radius=50}}\r\n\r\nnode[name=\"Lidl\"]->.lidls;\r\n\r\n( \r\n   way(around.lidls:{{radius}})[\"name\"~\".*nden$\"];\r\n  node(around.lidls:{{radius}})[\"name\"~\".*nden$\"];\r\n);\r\n\r\n(._;>;);  \/\/ whatever? <o\/\r\nout;<\/pre>\n<\/blockquote>\n<p><a href=\"http:\/\/hannes.enjoys.it\/blog\/wp-content\/uploads\/overpass-turbo-quiztime.png\"><img loading=\"lazy\" decoding=\"async\" width=\"250\" height=\"202\" src=\"http:\/\/hannes.enjoys.it\/blog\/wp-content\/uploads\/overpass-turbo-quiztime-250x202.png\" alt=\"\" class=\"alignleft size-medium wp-image-1005\" srcset=\"https:\/\/hannes.enjoys.it\/blog\/wp-content\/uploads\/overpass-turbo-quiztime-250x202.png 250w, https:\/\/hannes.enjoys.it\/blog\/wp-content\/uploads\/overpass-turbo-quiztime-768x621.png 768w, https:\/\/hannes.enjoys.it\/blog\/wp-content\/uploads\/overpass-turbo-quiztime-700x566.png 700w, https:\/\/hannes.enjoys.it\/blog\/wp-content\/uploads\/overpass-turbo-quiztime-120x97.png 120w, https:\/\/hannes.enjoys.it\/blog\/wp-content\/uploads\/overpass-turbo-quiztime.png 1087w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<ul>\n<li>Two parking spaces in Germany named \"Lidl-Kunden\". Not it.<\/li>\n<li>Some farmland in Baden-W\u00fcrttemberg named \"Gr\u00fcnden\". Not it.<\/li>\n<li>In the west Nethernlands a <a href=\"https:\/\/www.openstreetmap.org\/way\/389587716\"><code>landuse=commercial; name=Winkelcentrum Rietlanden<\/code><\/a>! A shopping mall! That looks promising!<\/li>\n<li>And in Amsterdam a <a href=\"https:\/\/www.openstreetmap.org\/node\/2357181600\"><code>name=Sportshop van Swinden; shop=sports<\/code><\/a>!<\/ul>\n<p> Too far away from the Lidl.<\/li>\n<\/ul>\n<p>But <a href=\"https:\/\/www.google.de\/maps\/@52.7512114,6.8897946,3a,75y,154.88h,82.28t\/data=!3m6!1e1!3m4!1sDmIockUOvIDVVHNRhCMQhQ!2e0!7i13312!8i6656\">driving around the place in Google StreetView<\/a> I could not find the spot and it does not look very much like the photo.<\/p>\n<p>So I guess my query is fine but either the \"thing\" or the Lidl are not in OSM yet.<\/p>\n<p>Oh well, I did learn something new (about Overpass) and it was fun. :)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I saw a #quiztime on Twitter and it looked like a perfect geospatial puzzle so I had to give it a try: https:\/\/twitter.com\/Sector035\/status\/987631780147679233 So we have something called &#8220;Lidl&#8221; which I know is a supermarket. And we have something else, with a potential name ending in &#8220;nden&#8221;. And that&#8217;s it. If you have a global [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29,18,10,48],"tags":[],"class_list":["post-1001","post","type-post","status-publish","format-standard","hentry","category-gis","category-journalismus","category-open-data","category-osm"],"_links":{"self":[{"href":"https:\/\/hannes.enjoys.it\/blog\/wp-json\/wp\/v2\/posts\/1001","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hannes.enjoys.it\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hannes.enjoys.it\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hannes.enjoys.it\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hannes.enjoys.it\/blog\/wp-json\/wp\/v2\/comments?post=1001"}],"version-history":[{"count":6,"href":"https:\/\/hannes.enjoys.it\/blog\/wp-json\/wp\/v2\/posts\/1001\/revisions"}],"predecessor-version":[{"id":1008,"href":"https:\/\/hannes.enjoys.it\/blog\/wp-json\/wp\/v2\/posts\/1001\/revisions\/1008"}],"wp:attachment":[{"href":"https:\/\/hannes.enjoys.it\/blog\/wp-json\/wp\/v2\/media?parent=1001"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hannes.enjoys.it\/blog\/wp-json\/wp\/v2\/categories?post=1001"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hannes.enjoys.it\/blog\/wp-json\/wp\/v2\/tags?post=1001"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}