Geneste opdracht (alle gebouwen in een straat)

Hello,

I am trying to retrieve the geometry of all houses in certain streets, the query below gives the data I am looking for, however just not in the way I would like.

The current query also shows houses that are not located on these streets, this is caused by the fact that I am also applying an ‘environment scan’ of 60 metres for the buildings. How do I get only the buildings that are also linked to the roads found with the first part of the query?

[out:json];
(

  way(around:5, 52.1548187909734, 6.420503512149891)["highway"]["highway"!="footway"];
  node(around:5, 52.1548187909734, 6.420503512149891)["highway"];
  way(around:60, 52.1548187909734, 6.420503512149891)["building"];
  node(around:60, 52.1548187909734, 6.420503512149891)["building"];
);
out body;
>;
out skel qt;

This example yields two streets within 5 metres of the given coordinate (Schimmelpennicklaan and Thorbeckelaan), so I would like the geometry of all houses on these two streets. In the attached image, you can see what is missing/excess.

Anyone any idea how to set up this query? Thanks in advance.

Regards

ABBOV

If you’re somewhere that’s well mapped when it comes to addresses you could potentially search on the addr:street tag to get everything that has that refers to that street. Associated street relations are rarer, but might also be an avenue worth exploring.

1 Like

The closest I could get, still the quality may change from one location to another. overpass turbo


[out:json];

(
  way(around:200, 52.1548187909734, 6.420503512149891)["highway"]["highway"!="footway"];
  node(around:200, 52.1548187909734, 6.420503512149891)["highway"];
)->.roadset0;

(
  way(around:5, 52.1548187909734, 6.420503512149891)["highway"]["highway"!="footway"];
  node(around:5, 52.1548187909734, 6.420503512149891)["highway"];
)->.roadset1;

/* exclude target roads from surrounding */
( .roadset0; - .roadset1;)->.roadset2;

/* buildings near surrounding roads */
(
  way(around.roadset2:15)["building"];
  node(around.roadset2:15)["building"];
)->.r2;

/* building near traget roads exculding those in surrounding*/
((
  way(around.roadset1:15)["building"];
  node(around.roadset1:15)["building"];);
 - .r2;
);
 

out geom;
>;
out skel qt;