From: Tom Hughes Date: Mon, 17 Mar 2014 09:19:14 +0000 (+0000) Subject: Add comment describing the overpass queries we use X-Git-Tag: live~4334^2~15 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/2e05669a22ce73fff3dc81aa99694bc893d249b7 Add comment describing the overpass queries we use --- 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()),