This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Unknown error when trying to filter nodes in Overpass Turbo using regular expression

0

Using in Overpass Turbo, I am trying to filter nodes tagged with key place:PH and with values which are not any of the following: barangay, municipality, sitio, purok, or province.

I tried this code below :

[out:xml]/*fixed by auto repair*/[timeout:50];
// gather results
(
  node["place:PH"!~"(barangay|municipality|sitio|purok|province)"]{{bbox}};
);
// print results
out meta;/*fixed by auto repair*/
>;
out meta qt;/*fixed by auto repair*/

but it gives the following unknown error:

An error occured during the execution of the overpass query! This is what overpass API returned:

Error: line 4: parse error: ';' expected - '17.731682803940448' found.

Can anybody please help on how to fix the query?

asked 28 Dec '20, 09:28

JAT86's gravatar image

JAT86
240181925
accept rate: 0%


One Answer:

1

Your query is missing round brackets before and after {{bbox}}. The correct query is

[out:xml]/*fixed by auto repair*/[timeout:50];
// gather results
(
  node["place:PH"!~"(barangay|municipality|sitio|purok|province)"]({{bbox}});
);
// print results
out meta;/*fixed by auto repair*/
>;
out meta qt;/*fixed by auto repair*/

answered 28 Dec '20, 11:22

Mannivu's gravatar image

Mannivu
1.1k31027
accept rate: 6%

Source code available on GitHub .