2

I am trying to query all the nodes which are in Potsdam city and with postcode 14480.

I know that it can be coded as follows:

    area["ISO3166-1"="DE"][admin_level=2]->.germany;
(
  node["addr:city"="Potsdam"]["addr:postcode"="14480"](area.germany);
)->.r;

but I would like to use an if condition with evaluators as shown below in the code.

However, it seems that there is something wrong in the code below How can I fix it?

Code:

    [out:json][timeout:180];
area["ISO3166-1"="DE"]["admin_level"="2"]->.germany;
(
  node(
    if: (t["addr:city"] == "Potsdam") && (t["addr:postcode"] =="14480")
  );
);

  out geom;
0

1 Answer 1

0

Your first query does not return results for me.

When using the Overpass Turbo Wizard with the query "addr:postcode=14480 in Potsdam" it generates the following statement

/*
This has been generated by the overpass-turbo wizard.
The original search was:
“addr:postcode=14480 in Potsdam”
*/
[out:json][timeout:25];
// fetch area “Potsdam” to search in
{{geocodeArea:Potsdam}}->.searchArea;
// gather results
(
  // query part for: “"addr:postcode"=14480”
  node["addr:postcode"="14480"](area.searchArea);
);
// print results
out body;
>;
out skel qt;

See here: https://overpass-turbo.eu/s/14NY .

The result seem to be correct this way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.