Overpass API developpement

Text archives Help


[overpass] Lua module to query Overpass API from Wikipedia


Chronological Thread 
  • From: Jo <winfixit@gmail.com>
  • To: overpass@listes.openstreetmap.fr
  • Subject: [overpass] Lua module to query Overpass API from Wikipedia
  • Date: Wed, 12 Aug 2015 12:22:17 +0200

Hi,

I've written a Lua module to query Overpass API from Wikipedia.

https://en.wikipedia.org/wiki/Module:OSM

I deployed it on nl, en and fr.

I got a remark about queries using regular expressions to retrieve multiple wikidata Q-numbers.

The second test case produces the following query:
(
node["wikidata"~"[Q650206|Q713300]"];
way["wikidata"~"[Q650206|Q713300]"];
relation["wikidata"~"[Q650206|Q713300]"];
);
out;
>;
out meta qt;


which takes forever to complete and eventually times out. A solution would be to add a bbox. But this is a relatively simple case and it's unfortunate it doesn't work.

The other remark is that the query is too general and would give wrong results for shorter Q-numbers, which is correct. So I came up with the following:

(
node["wikidata"~"[Q650206(;.+|$)|Q713300(;.+|$)]"];
way["wikidata"~"[Q650206(;.+|$)|Q713300(;.+|$)]"];
relation["wikidata"~"[Q650206(;.+|$)|Q713300(;.+|$)]"];
);
out;
>;
out meta qt;

which times out as well.

I must be doing something wrong, but I can't seem to figure out what it is.

Anyway, the module should make it easier to find streets named after persons or cities. (If they already have wikidata tags, that is).

Polyglot



Archive powered by MHonArc 2.6.18.

Top of page