Skip to main content
added 68 characters in body
Source Link
mmd
  • 4.7k
  • 1
  • 12
  • 19

The correct solution is a bit more involved, because you need to convert relations explicitly into an internal representation called area (this happens implicitly for ways).

// fetch both ways and relations with landuse=industrial in your current bbox
wr["landuse"="industrial"]({{bbox}});

// visualize landuse=industrial ways and relations for debugging purposes
out geom;

// specificallyexplicitly convert relation to area, also include ways in search area
map_to_area -> .searchArea;

// query for buildings inside search area
( 
  way["building"](area.searchArea);
  node["building"](area.searchArea); 
  relation["building"]nwr["building"](area.searchArea); 
);

// and print results
out body;
>;
out skel qt;

Note: the query uses the shorter version "wr" for ways & relations, as well as "nwr" for nodes, ways & relations to avoid some extra typing.

Check out this overpass turbo link for an example: https://overpass-turbo.eu/s/1tzChttps://overpass-turbo.eu/s/1tzE

Sample screenshot highlighting buildings both inside landuse=industrial ways and relations:

enter image description here

The correct solution is a bit more involved, because you need to convert relations explicitly into an internal representation called area (this happens implicitly for ways).

// fetch both ways and relations with landuse=industrial in your current bbox
wr["landuse"="industrial"]({{bbox}});

// visualize landuse=industrial ways and relations for debugging purposes
out geom;

// specifically convert relation to area
map_to_area -> .searchArea;

// query for buildings inside search area
( 
  way["building"](area.searchArea);
  node["building"](area.searchArea); 
  relation["building"](area.searchArea); 
);

// and print results
out body;
>;
out skel qt;

Check out this overpass turbo link for an example: https://overpass-turbo.eu/s/1tzC

Sample screenshot highlighting buildings both inside landuse=industrial ways and relations:

enter image description here

The correct solution is a bit more involved, because you need to convert relations explicitly into an internal representation called area (this happens implicitly for ways).

// fetch both ways and relations with landuse=industrial in your current bbox
wr["landuse"="industrial"]({{bbox}});

// visualize landuse=industrial ways and relations for debugging purposes
out geom;

// explicitly convert relation to area, also include ways in search area
map_to_area -> .searchArea;

// query for buildings inside search area
nwr["building"](area.searchArea);

// and print results
out body;
>;
out skel qt;

Note: the query uses the shorter version "wr" for ways & relations, as well as "nwr" for nodes, ways & relations to avoid some extra typing.

Check out this overpass turbo link for an example: https://overpass-turbo.eu/s/1tzE

Sample screenshot highlighting buildings both inside landuse=industrial ways and relations:

enter image description here

Source Link
mmd
  • 4.7k
  • 1
  • 12
  • 19

The correct solution is a bit more involved, because you need to convert relations explicitly into an internal representation called area (this happens implicitly for ways).

// fetch both ways and relations with landuse=industrial in your current bbox
wr["landuse"="industrial"]({{bbox}});

// visualize landuse=industrial ways and relations for debugging purposes
out geom;

// specifically convert relation to area
map_to_area -> .searchArea;

// query for buildings inside search area
( 
  way["building"](area.searchArea);
  node["building"](area.searchArea); 
  relation["building"](area.searchArea); 
);

// and print results
out body;
>;
out skel qt;

Check out this overpass turbo link for an example: https://overpass-turbo.eu/s/1tzC

Sample screenshot highlighting buildings both inside landuse=industrial ways and relations:

enter image description here