Search code examples
openstreetmapoverpass-api

Get all power-things within a district - province - country ... Overpass turbo


Best

I would like to receive all the things which has to do with power and all these things must lay (strictly) into a district / province or even in a whole country.

But, as you can see in my code, I'll only receive things within a rectangle and it doesn't stop at the boundaries

(
  // query part for: “power=*”
  node["official_name:nl" = "Provincie Antwerpen"];
  node["power"](50.9944,4.1567,51.6,5.331);

  way["official_name:nl" = "Provincie Antwerpen"];
  way["power"](50.9944,4.1567,51.6,5.331);

  relation["official_name:nl" = "Provincie Antwerpen"];
  relation["power"](50.9944,4.1567,51.6,5.331);
);
// print results
out body;
>;
out skel qt;

Thus my question is, can someone help me?

Kind regards


Solution

  • You should enter power=* in "Provincie Antwerpen" in overpass turbo wizard.

    Hard clipping at boundaries is not possible at the moment via Overpass API, you need some additional post processing for this.