Convert form
Overpass QL
A valid input is a sequence of one or more statements, where each statement ends with a double colon ";". Stataments are actions, queries or the initial declaration. You may add any amount of whitespace you like between two statements or immediately before the double colon.
The only exisiting action so far is out. Thus e.g. "out;" is a valid action. Possible variants are to add one of the modifiers below between out and the double colon:
- ids: Print only the id of each element.
- skel: Print ids, coordinates and memberships.
- body: Print the complete spatial data.
- meta: Print the complete spatial and meta data.
- quirks: Fake the meta data to cope with overzealous parsers. Not yet implemented.
- qt: Order by quadtile instead of id.
- asc: Order printed elements by id.
The default options are body and asc.
A query starts with the type of the result. This can be node, way, relation or rel (shortcut for relation). After the type follow one or more clauses. The individual clauses all have brackets or parentheses and hence are written without double colon one after another.
The following clauses are possible:
- bbox: written as (south,west,north,east). An example is
node[highway=bus_stop](50.6,6.8,50.9,7.2);out;
.
- id: written as (ref), where ref is the id of the referred element. An example is
rel(62478);out;
- has-kv: written as ["key"="value"] or ["key"]. The former selects all elements where the key has the given value, the latter selects all elements where the key has any nonempty value. The quotations marks can be omitted if the entire string contains only alphanumeric characters. Example:
way[name="Adelheidisstraße"];out;
.
- recurse: written as (w.input set), (r.input set), (bn.input set), (bw.input set), or (br.input set). Determines the origin from with the given type of elements should be derived. The input set including the leading dot can be omitted. It then default to _. Examples are
way[name="Adelheidisstraße"]node(w);out;
and way[name="Adelheidisstraße"]->.foo node(w.foo);out;
.
- around: written as (around.input set:radius). The around statement currently is only compatible to output of type node, and I even haven't decided on the semantics for the other cases. The input set including the leading dot can be omitted. It then defaults to _. An example is
node[name="Lichtscheid"];node(around:1000)[highway=bus_stop];out;
.
- user/uid: written as (user:"name") resp. (uid:id). Selects all elements last touched by the given user. The user can be selected by her user name (use user) or user id (use uid). Examples are
way(user:"Roland Olbricht");out;
or way(uid:65282);out;
.
- newer: similar to user.
The initial declaration can be omitted if nothing must be declared. Otherwise, all declarations are enclosed in brackets and written one after another (without a double colon). Possible declarations are:
- timeout: Select the maximum allowed runtime in seconds. The default value is 180. Use a higher value if except a large result or complex query.
- maxsize: Select the maximum allowed RAM size of the query on the server. If you expect a large result or complex query, you can manually raise this bound to up to 1073741824 (=1024^3).
- out: Select the output format. Possible values are json or xml. Default is xml.