+ function compareSize(feature1, feature2) {
+ var width1 = feature1.bounds.maxlon - feature1.bounds.minlon,
+ height1 = feature1.bounds.maxlat - feature1.bounds.minlat,
+ area1 = width1 * height1,
+ width2 = feature2.bounds.maxlat - feature2.bounds.minlat,
+ height2 = feature2.bounds.maxlat - feature2.bounds.minlat,
+ area2 = width2 * height2;
+
+ return area1 - area2;
+ }
+
+ /*
+ * To find nearby objects we ask overpass for the union of the
+ * following sets:
+ *
+ * node(around:<radius>,<lat>,lng>)
+ * way(around:<radius>,<lat>,lng>)
+ * relation(around:<radius>,<lat>,lng>)
+ *
+ * to find enclosing objects we first find all the enclosing areas:
+ *
+ * is_in(<lat>,<lng>)->.a
+ *
+ * and then return the union of the following sets:
+ *
+ * relation(pivot.a)
+ * way(pivot.a)
+ *
+ * In both cases we then ask to retrieve tags and the geometry
+ * for each object.
+ */