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

Overpass tag not exists

0

I'm trying to get the addresses that do not have a postal code but have the address information the code still selects ways/relations that have the postal code set already, but I want to select those that don't exist/aren't set.

[out:json][timeout:2500];
{{geocodeArea:Gatineau}}->.searchArea;
// gather results
(
  // query part for: “"addr:housenumber"=*”

  (way["addr:housenumber"](area.searchArea);relation["addr:housenumber"](area.searchArea))->.a;
  way.a["addr:postcode"~"^$"]({{bbox}});
  relation.a["addr:postcode"~"^$"]({{bbox}});
);
// print results
out body;
>;
out skel qt;

asked 18 Jul '15, 12:20

LogicalViolinist's gravatar image

LogicalVioli...
2466714
accept rate: 16%

A bit off topic, but please do not add the postal code information to individual addresses in e.g. Flanders, Belgium. We have a complete set of postal code boundaries and that information has to be used to get a complete address. I think the same holds e.g. for Germany.

(19 Jul '15, 14:49) escada

That may be well for europe, but in Canada, canada post wants to copyright postal codes and has sued geocder.ca for building a database against it. The lawsuit was eventually dropped, but what I wanted to get at is untill we have a full data population for a street I cannot trace said polygon as it can change midway through the street

(19 Jul '15, 20:00) LogicalVioli...

2 Answers:

2

As you're using the wizard in overpass turbo already, simply copy the following expression to the wizard popup:

("addr:housenumber"=* and "addr:postcode" is null) in Gatineau

overpass turbo link: http://overpass-turbo.eu/s/auT

answered 19 Jul '15, 08:50

mmd's gravatar image

mmd
5.7k15388
accept rate: 37%

edited 19 Jul '15, 08:50

0

Maybe this example can be helpful:

has-kv k="addr:city"

has-kv k="addr:postcode" modv="not" regv="."

This is looking for elements with addr_city=xxx and without addr:postcode.

answered 18 Jul '15, 19:48

stephan75's gravatar image

stephan75
12.6k556210
accept rate: 6%

Source code available on GitHub .