Warning, /frameworks/syntax-highlighting/autotests/input/highlight.overpassql is written in an unsupported language. File is not indexed.

0001 /* Overpass samples taken from
0002    https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL
0003    https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_API_by_Example
0004 
0005 */
0006 
0007 // single line comment with TODO alerts
0008 
0009 /* multi-line comment with ### alerts */
0010 
0011 [out:json][timeout:25];
0012 // gather results
0013 (
0014   // query part for: “amenity=post_box”
0015   node["amenity"="post_box"](52.0, 13.0, 54.0, 13.5);
0016   way["amenity"="post_box"]({{bbox}});
0017   relation["amenity"="post_box"]({{bbox}});
0018 );
0019 // print results
0020 out body;
0021 >;
0022 out skel qt;
0023 
0024 
0025 [out:csv(::type, "de:regionalschluessel", name,
0026          ::count, ::"count:nodes", ::"count:ways", ::"count:relations")];
0027 
0028 //All areas with regional key (German: "Regionalschlüssel") starting with 057
0029 area["de:regionalschluessel"~"^057"];
0030 
0031 // Count the pharmacies in each area
0032 foreach->.regio(
0033   // display details for the current area
0034   .regio out;
0035 
0036   // Collect all Nodes, Ways and Relations with amenity=pharmacy in the current area
0037   ( node(area.regio)[amenity=pharmacy];
0038     way(area.regio)[amenity=pharmacy];
0039     rel(area.regio)[amenity=pharmacy];);
0040 
0041 // Count the elements in the current area Area
0042   out count;
0043 );
0044 
0045 
0046 [timeout:300]
0047 [bbox:51.08282186160976,-12.8759765625,55.986091533808384,-1.86767578125]
0048 [out:csv(::id, ::type, name, "name:en", "name:ga")];
0049 
0050 ( node[name]["name:en"]["name:ga"](if:(t["name"] != t["name:en"]) && (t["name"] != t["name:ga"]));
0051   way[name]["name:en"]["name:ga"] (if:(t["name"] != t["name:en"]) && (t["name"] != t["name:ga"]));
0052   rel[name]["name:en"]["name:ga"] (if:(t["name"] != t["name:en"]) && (t["name"] != t["name:ga"]));
0053 );
0054 out;
0055 
0056 
0057 [out:csv(version,timestamp,changeset,count)];
0058 timeline(relation,2632934);
0059 for (t["created"])
0060 {
0061   retro(_.val)
0062   {
0063     rel(2632934);
0064     make stat version=u(version()),timestamp=u(timestamp()),changeset=u(changeset()),count=u(count_members());
0065     out;
0066   }
0067 }
0068 
0069 
0070 [timeout:60];
0071 area["name"="Mayenne"]->.boundaryarea;
0072 way(area.boundaryarea)["building"="church"];
0073   foreach(
0074     node(w)->.d;                                     // determine all nodes of a way
0075     .n is_in->.a;
0076     area.a[name][boundary=administrative][admin_level~"^[2-8]$"] -> .a;
0077     out center;
0078     convert way ::=::,
0079               ::id = id(),
0080               is_in=a.set("{" + t["admin_level"] + ":" + t["name"] + "}");
0081 
0082     out;
0083 );