OpenStreetMap Forum

The Free Wiki World Map

You are not logged in.

Announcement

A fix has been applied to the login system for the forums - if you have trouble logging in please contact support@openstreetmap.org with both your forum username and your OpenStreetMap username so we can make sure your accounts are properly linked.

#1 2017-03-20 17:54:58

Quidam2k
New Member
Registered: 2017-03-20
Posts: 2

Overpass - Some buildings not defined as such

Hey there! I'm new to the forums and a bit less new to OSM and Overpass, so forgive me if I overlook some of the more obvious solutions.

I'm working with queries that pull all the buildings in an area via Overpass. For example:

node(34.1674996523779,-118.508148193359,34.1765892428501,-118.497161865234);way(bn)['building'];(._;>;);out;

If you run this on Overpass Turbo, you can see that near the middle of the screen, Apartments #6416841 is not highlighted as a building, whereas right next to it, Apartments #431388565 is. (These are the ids found using the Query Features button on OSM proper.)

If I modify the query like so

node(34.1674996523779,-118.508148193359,34.1765892428501,-118.497161865234);way(bn)['building'];(._;>;);out;

We can see that all the ways are properly defined, but for some reason via Overpass, Apartments #6416841 is not being considered a building. The buildings that are defined as such are filled in yellow, but the problem ones aren't.

Is this a matter of editing the OSM data and attaching the building's ways to an area or relation, or is it an issue with Overpass, since it seems to be working properly with the Query Features button on OSM itself?

Thanks in advance for any light you might be able to shed on the topic, and do let me know if there's any clarification I can provide.

Offline

#2 2017-03-20 19:06:46

mmd
Member
Registered: 2010-11-06
Posts: 909

Re: Overpass - Some buildings not defined as such

Quidam2k wrote:

Is this a matter of editing the OSM data and attaching the building's ways to an area or relation

Yes, the building in question belongs to a relation: http://www.openstreetmap.org/relation/6416839

In your query, you only query for nodes and ways with a building=* tag. This doesn't really match with the way this building is mapped.

You would have to extend your query to also check for relations with a building tag.

Straight forward approach would be to use the overpass turbo wizard to generate the following:

/*
This has been generated by the overpass-turbo wizard.
The original search was:
“building=*”
*/
[out:json][timeout:25];
// gather results
(
  // query part for: “building=*”
  node["building"]({{bbox}});
  way["building"]({{bbox}});
  relation["building"]({{bbox}});
);
// print results
out body;
>;
out skel qt;

Offline

#3 2017-03-20 23:01:40

Quidam2k
New Member
Registered: 2017-03-20
Posts: 2

Re: Overpass - Some buildings not defined as such

Thank you very much, that looks like it'll do the trick!

Offline

Board footer

Powered by FluxBB