From 2e05669a22ce73fff3dc81aa99694bc893d249b7 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 17 Mar 2014 09:19:14 +0000 Subject: [PATCH] Add comment describing the overpass queries we use --- app/assets/javascripts/index/query.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/app/assets/javascripts/index/query.js b/app/assets/javascripts/index/query.js index 8e0e0dae5..01a8a1f69 100644 --- a/app/assets/javascripts/index/query.js +++ b/app/assets/javascripts/index/query.js @@ -209,6 +209,29 @@ OSM.Query = function(map) { })); } + /* + * To find nearby objects we ask overpass for the union of the + * following sets: + * + * node(around:,,lng>) + * way(around:,,lng>) + * node(w) + * relation(around:,,lng>) + * + * to find enclosing objects we first find all the enclosing areas: + * + * is_in(,)->.a + * + * and then return the union of the following sets: + * + * relation(pivot.a) + * way(pivot.a) + * node(w) + * + * In order to avoid overly large responses we don't currently + * attempt to complete any relations and instead just show those + * ways and nodes which are returned for other reasons. + */ function queryOverpass(lat, lng) { var latlng = L.latLng(lat, lng), radius = 10 * Math.pow(1.5, 19 - map.getZoom()), -- 2.45.2