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...

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

permanent link

answered 19 Jul '15, 08:50

mmd's gravatar image

mmd
5.6k4988
accept rate: 37%

edited 19 Jul '15, 08:50

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.

permanent link

answered 18 Jul '15, 19:48

stephan75's gravatar image

stephan75
12.5k453209
accept rate: 6%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×355
×190
×139
×10

question asked: 18 Jul '15, 12:20

question was seen: 3,105 times

last updated: 19 Jul '15, 20:00

powered by OSQA