TransWikia.com

Why does ['access' !~ 'no'] filter out ways with access = unknown in Overpass?

Geographic Information Systems Asked by cmot on August 18, 2021

If I use this query in Overpass

[out:json];
area[name="Squirrel Hill"];
way(area)
  ['access' !~ 'no'];
out;

then this way (OSM ID 11947323) is not in the result set.
However, if this is my query:

[out:json];
area[name="Squirrel Hill"];
way(area);
out;

The way shows up as expected in the output.

Here you can see that the previously mentioned way does not have the access=no tag.
screenshot showing that Consentino Drive does not have the access = no tag, only the access = unknown tag

What is causing this? Is the unknown tag somehow a subset of the no tag?

One Answer

The filter ['access' !~ 'no']; checks that the tag value for the key access does not match the regular expression "no".

As the string "unknown" contains "no" somewhere in the middle, your way is being filtered out.

Note that regular expressions match anywhere inside a string, unless you explicitly use "^no$" to mark the start and end of a string.

Correct answer by mmd on August 18, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP