Overpass 查询语言 EBNF 语法
Overpass QL EBNF Grammar

原始链接: https://github.com/b1tw153/overpass-ebnf

本页面提供 Overpass 查询语言的正式 W3C EBNF 语法。它有助于生成有效查询、验证语法,并通过可视化方式或解析器生成器浏览该语言。它反映了对照 Overpass API 源代码和一个运行中的 v0.7.62.11 实例验证过的文档化特性,不包括未文档化但被接受的特性。避免滥用公共服务器;大量流量请使用本地实例,并通过 issue 报告错误或差距。

对不起。
相关文章

原文

A formal grammar for Overpass Query Language in W3C EBNF notation, the same notation used by the XML 1.0 specification.

The grammar is useful for:

  • Generating queries — use it as a reference for what combinations of syntax are valid when building tools that produce Overpass QL
  • Validating queries — check whether a query is syntactically valid before sending it to the API
  • Browsing the language — the Railroad Diagram Generator renders the grammar as interactive railroad diagrams, which may be easier to read than the raw EBNF

Paste the contents of overpassql.ebnf into the Railroad Diagram Generator to browse the grammar visually or check it for errors. The REx Parser Generator accepts the same notation and can produce a parser if needed.

Transformations to other EBNF-like grammars should be relatively straightforward if you plan to use a different parser implementation.

Please do not use this grammar to abuse public Overpass servers by sending large volumes of automated queries. If you have a use case that depends on a lot of Overpass traffic, consider running your own local Overpass instance using the original source code or one of the container images.

The grammar covers features documented in the Overpass QL Language Reference, Overpass QL Language Guide, and Overpass API Blog. These sources are not always reliable, so the grammar has been verified against the Overpass API source code and tested against a live instance running v0.7.62.11. Features accepted by the implementation but absent from the documentation are excluded.

If you find an error or a gap, please open an issue.

联系我们 contact @ memedata.com