OpenStreetMap Forum

The Free Wiki World Map

You are not logged in.

#1 2017-12-24 17:40:59

Zkir
Member
From: Хрустальная Москва
Registered: 2009-02-21
Posts: 6,086

Q: how to extract building parts?

Hi Guys,

How to extract building parts?

I have extracted buildings (churches) from the planet.osm file using osmosis, it's quite easy even with relations (something like --tf accept-relations building=church --used-way  --used-node will do), but those are merely multipolygons, e.g. https://www.openstreetmap.org/relation/6637079 is just building outline, no any relation with parts.

So my question is how to fetch building parts of the certain building? is there any standard way to do that?

Last edited by Zkir (2017-12-24 20:21:39)


Истинные слова не не приятны, приятные слова не истинны.
True words are unpleasant; pleasant words are untrue.

Offline

#2 2017-12-24 18:18:14

vvoovv
Moderator
Registered: 2008-03-04
Posts: 2,247

Re: Q: how to extract building parts?

Zkir,

You need to find in which outline a building part is located.

BTW, Haven't heard from you for a while

Offline

#3 2017-12-24 22:41:37

Zkir
Member
From: Хрустальная Москва
Registered: 2009-02-21
Posts: 6,086

Re: Q: how to extract building parts?

vvoovv, thank you!


Since I still have a little more post on this forum than you, I guess not so much time has passed.
I hope you are doing well too, nice to see you again)


You need to find in which outline a building part is located.

OK, i see.  Is there any standard tool for that? Or I need to code it myself? smile
this should be actually very precise check...

Last edited by Zkir (2018-01-10 12:00:10)


Истинные слова не не приятны, приятные слова не истинны.
True words are unpleasant; pleasant words are untrue.

Offline

#4 2017-12-24 23:46:29

vvoovv
Moderator
Registered: 2008-03-04
Posts: 2,247

Re: Q: how to extract building parts?

I've been checking if an outline and a building part share some common nodes. If there are no common nodes I've been using a BVH-tree to find which outline a ray originating from a node of the building part hits.

Offline

#5 2018-01-10 11:59:30

Zkir
Member
From: Хрустальная Москва
Registered: 2009-02-21
Posts: 6,086

Re: Q: how to extract building parts?

I've been checking if an outline and a building part share some common nodes. If there are no common nodes I've been using a BVH-tree

Ok, it seems reasonable.

But there are building parts that are outside outlines!
for example this one:  http://www.openstreetmap.org/way/447556578

Is it considered to be acceptable  or not?  I guess the author of this way tried to render cornice (https://en.wikipedia.org/wiki/Cornice), but from my point of view it is completly illogical, because outline is actually a projection of all parts  a building to the ground.


***

And also a question, which I tried to raise 5 years ago:  how to tag actuall building heights?
In other words, what should be height value on buildning outline: total height or heigh of the lowest building part?

Outline of this bilding (https://www.openstreetmap.org/way/36866037#map=19/56.31051/38.12957, it'a a bell tower) should be actually 86, but currently it is set to 19, to get currect rendering of  the lowest part.


Can I change it to 86?  (height=86), or should I use (or invent) some other tagging scheme, e.g.  building:total_height=86?

My first task is to obtain the list of the highest buildings in Russia.

Last edited by Zkir (2018-01-10 13:46:16)


Истинные слова не не приятны, приятные слова не истинны.
True words are unpleasant; pleasant words are untrue.

Offline

#6 2018-01-10 13:39:29

R0bst3r
Member
Registered: 2015-04-23
Posts: 424

Re: Q: how to extract building parts?

An outline can be defined by the building=* tag or if building parts are outside of the building with an building:part=yes.
So the given example is a possible tagging scheme.

See https://demo.f4map.com/#lat=56.3106177& … 48&zoom=19

All your questions are answered on this wiki page: https://wiki.openstreetmap.org/wiki/Simple_3D_buildings
If there are multiple height in an outline use inner building parts or maybe levels. If you don't want to, you're free to choose, I would then prefer the average height wink

As height defines the height to the top of the roof according to wiki, I think the current value of the example is acceptable.

Offline

#7 2018-01-10 16:47:34

Zkir
Member
From: Хрустальная Москва
Registered: 2009-02-21
Posts: 6,086

Re: Q: how to extract building parts?

R0bst3r wrote:

All your questions are answered on this wiki page: https://wiki.openstreetmap.org/wiki/Simple_3D_buildings

Ok, but  what is writtent there, is that actually true?
My intention is to figure out how communitiy sees this topic now smile

e.g., it is stated:
When a building has any building:part=* areas, the building outline is not considered for 3D rendering.
Is it really so?

If there are multiple height in an outline use inner building parts or maybe levels. If you don't want to, you're free to choose, I would then prefer the average height wink

OK, great. I will change the height of this bell tower to 86. Let's see how F4, osm2world and Kendzi3d will react to that.
This way has full height once: https://www.openstreetmap.org/way/36866037/history, version 6, and then was changed to height of the first "tier" --version 7.


And you have not answered my question, what is  a proper way to obtain the list of the tallest buildings from OSM data. Do I need to analyze building parts for that?

Last edited by Zkir (2018-01-10 17:16:19)


Истинные слова не не приятны, приятные слова не истинны.
True words are unpleasant; pleasant words are untrue.

Offline

#8 2018-01-10 18:17:32

R0bst3r
Member
Registered: 2015-04-23
Posts: 424

Re: Q: how to extract building parts?

Zkir wrote:

When a building has any building:part=* areas, the building outline is not considered for 3D rendering.
Is it really so?

Yes, if you use building:part it has to cover the whole building outline, outline is ignored for 3D but still relevant for 2D rendering.

Zkir wrote:

And you have not answered my question, what is  a proper way to obtain the list of the tallest buildings from OSM data. Do I need to analyze building parts for that?

Yes, you have.

Offline

#9 2018-01-10 20:27:14

Zkir
Member
From: Хрустальная Москва
Registered: 2009-02-21
Posts: 6,086

Re: Q: how to extract building parts?

R0bst3r, thank you for your answers.

outline is ignored for 3D

I do not see that it is ignored, and do not understand, how it could be.


Consider the following example:
https://www.openstreetmap.org/way/35546654

in F4: http://demo.f4map.com/#lat=56.3087989&l … hi=-27.215

the building structure is the following: cillinder, then dome, then another cillinder, and then pyramidal roof. There is no building part for the lowest tier other than way/35546654, which is also outline. F4, osm2world and kendzi3d does consider it for 3d.

Last edited by Zkir (2018-01-10 20:37:09)


Истинные слова не не приятны, приятные слова не истинны.
True words are unpleasant; pleasant words are untrue.

Offline

#10 2018-01-10 21:49:17

R0bst3r
Member
Registered: 2015-04-23
Posts: 424

Re: Q: how to extract building parts?

Zkir wrote:

outline is ignored for 3D

I do not see that it is ignored, and do not understand, how it could be.

Read it related to the example on the wiki page given:

wiki wrote:

The entire building outline is filled with building:part=* ways ...
When a building has any building:part=* areas, the building outline is not considered for 3D rendering. ...

You have a building outline. Fill it completely with building:parts. No 3D building properties on outline, all on building:parts, otherwise the outline will 'cover' the building:part. If it's getting complex, add a building relation, it's also a good idea to use this as documentation of your building:parts.

BUT: You are free to use tags on building outline. You are free to use only single building:parts and do no cover the whole outline. Your are also free to don't use a relation. And the 3D renderers will anyway try to interpret your tags. You can also resign height tags and your building will still get a default height.

OSM is not perfect nor your tagging has to be. The result is the important thing and that's the task of the 3D renderers.

Last edited by R0bst3r (2018-01-10 21:50:05)

Offline

#11 2018-01-11 17:47:28

Tordanik
Moderator
From: Germany
Registered: 2008-06-17
Posts: 2,261
Website

Re: Q: how to extract building parts?

I'm afraid some of R0bst3r's statements contradict the documentation. Unlike some parts of OSM that suffer from poorly-defined tags, Simple 3D Buildings is actually quite clear about these things. So in particular:

  • All building:part areas must be entirely inside a building area. The cornice example you linked to is incorrect.

  • The building outline must be entirely covered with building parts. What happens if this rule is not followed varies widely between renderers, and cannot be relied on.

  • You do not need to analyze building parts to find the highest buildings. The height on the building=* area must be the height of the entire building.

Note that the last item means that you ought to never use the same element (e.g. a way) to represent both the building as a whole and one of its parts. The height would inevitably be incorrect for either one or the other.

Offline

#12 2018-01-11 20:22:36

vvoovv
Moderator
Registered: 2008-03-04
Posts: 2,247

Re: Q: how to extract building parts?

Tordanik wrote:

All building:part areas must be entirely inside a building area.

A minor correction:
All building:part areas must be entirely inside a building area, if a relation type=building isn't present for the building.

If the relation type=building is present, all building parts must be listed as the relation members with the role=part. The building outline must be listed with the role=outline. The building parts can be located in any possible way relative to the building outline in the presence of the relation type=building.

It makes sense to use the relation type=building only for buildings with parts hanging over the building outline.

Offline

#13 2018-01-11 20:44:33

vvoovv
Moderator
Registered: 2008-03-04
Posts: 2,247

Re: Q: how to extract building parts?

I added clarifications for the type=building relation in the Simple 3D Buildings specification:
https://wiki.openstreetmap.org/wiki/Sim … _relations

Offline

#14 2018-01-11 21:34:16

Tordanik
Moderator
From: Germany
Registered: 2008-06-17
Posts: 2,261
Website

Re: Q: how to extract building parts?

vvoovv wrote:

All building:part areas must be entirely inside a building area, if a relation type=building isn't present for the building.

I'm not sure I agree with that change. The building outline section states: "The building outline represents the area of land covered by the union of all parts of the building." A statement like that (with slightly different phrasing) has been part of the page since its first version, and there's zero indication that this would only apply to relation-free buildings.

Offline

#15 2018-01-12 09:04:24

Zkir
Member
From: Хрустальная Москва
Registered: 2009-02-21
Posts: 6,086

Re: Q: how to extract building parts?

Tordanik, thank you, that makes perfect sense for me.

Tordanik wrote:

you ought to never use the same element (e.g. a way) to represent both the building as a whole and one of its parts.

I do not have statistics, but it seems that it's quite common practice for towers with several tiers. But Ok, original intention is clear.

By the way, is osm2world still in development? Do you accept feature requests/bug reports?


Истинные слова не не приятны, приятные слова не истинны.
True words are unpleasant; pleasant words are untrue.

Offline

#16 2018-01-12 16:19:51

Tordanik
Moderator
From: Germany
Registered: 2008-06-17
Posts: 2,261
Website

Re: Q: how to extract building parts?

Zkir wrote:

By the way, is osm2world still in development? Do you accept feature requests/bug reports?

Sure! smile The best place for bug reports and feature requests is on Github, but you can also contact me directly if you prefer.

Offline

#17 2018-02-04 21:29:14

vvoovv
Moderator
Registered: 2008-03-04
Posts: 2,247

Re: Q: how to extract building parts?

Tordanik wrote:

The building outline section states: "The building outline represents the area of land covered by the union of all parts of the building." A statement like that (with slightly different phrasing) has been part of the page since its first version, and there's zero indication that this would only apply to relation-free buildings.

Tordanik, that definition is valid for 99% of cases.
However note, that a building outline is also used as the building footprint by 2d renderers.

So we have a problem if the building outline doesn't correspond to a footprint (in the manner how a mapper perceives the footprint in his head).

Example: Villa Mediterranee in Marseille. I (as an ordinary mapper) would use the building part that touches the ground as the building footprint:
Marseille_-_panoramio_%289%29.jpg
Image Source: https://commons.wikimedia.org/wiki/File … io_(9).jpg by Ainars Brūvelis, license: CC BY-SA 3.0

Offline

#18 2018-02-04 21:41:27

Zkir
Member
From: Хрустальная Москва
Registered: 2009-02-21
Posts: 6,086

Re: Q: how to extract building parts?

vvoovv wrote:

I (as an ordinary mapper)

why? smile
I, personally, as another ordinary mappper, will use projection.
And it is 100% correct for 2d renders.

Last edited by Zkir (2018-02-04 21:41:43)


Истинные слова не не приятны, приятные слова не истинны.
True words are unpleasant; pleasant words are untrue.

Offline

#19 2018-02-04 21:45:40

vvoovv
Moderator
Registered: 2008-03-04
Posts: 2,247

Re: Q: how to extract building parts?

Zkir,
that's how I perceive what a building footprint for that building is.

Offline

#20 2018-02-04 21:55:09

vvoovv
Moderator
Registered: 2008-03-04
Posts: 2,247

Re: Q: how to extract building parts?

Zkir,
also note there is one more tiny building beneath the overhanging part as shown on the photo in the website of the Villa Mediterranee.

I'd treat that tiny building as separate and independant from the volume of the Villa Mediterranee. So it can't be inside the outline of the Villa Mediterranee.

ab_14vlm-451bd.jpg
Image from http://www.villa-mediterranee.org

Offline

#21 2018-02-04 22:18:48

Tordanik
Moderator
From: Germany
Registered: 2008-06-17
Posts: 2,261
Website

Re: Q: how to extract building parts?

vvoovv wrote:

Tordanik, that definition is valid for 99% of cases.

That definition is written (and intended) as a rule, though, not an observation of things people usually do.

So right now, the S3DB page is self-contradicting: It requires that the outline surrounds all building parts (in the outline section), but also mentions the possibility of building parts outside the outline (in the relation section). Mixing the two statements makes no sense, and to maintain internal consistency, we need to either change both sections at the same time – or none of them. For the record, I currently prefer not changing them.

However note, that a building outline is also used as the building footprint by 2d renderers.

That's a problem if 2D building areas are supposed to show the ground-level footprint, but I'm not sure that's actually what people expect.

Many ordinary mappers use aerial imagery for buildings, where drawing the projection often feels more natural. And in the case of "special" buildings with bridges and overhangs, I find that people do in fact often intuitively expect the above-ground sections to be included in the area.

One example from Germany that was discussed on the forums in the past is this restaurant building spanning a motorway:

400px-RaststaetteDammerBerge.JPG

That's now mapped as a rectangular area spanning the road, rather than just as a few tiny dots where the load-bearing pillars connect to the ground.

Likewise, bridges connecting multiple building parts tend to be included in building outlines, to the point where some mappers have been complaining that Mapnik renders roads on top of them.

I'd treat that tiny building as separate and independant from the volume of the Villa Mediterranee. So it can't be inside the outline of the Villa Mediterranee.

Interesting situation. I'd also consider this a separate building, but as far as I know, there's no rule that building outlines aren't allowed to overlap? In fact, I've always considered overlapping building outlines the one situation where building relations are necessary at all. (Before the changes being discussed here, that is.)

Offline

#22 2018-02-04 22:48:05

Zkir
Member
From: Хрустальная Москва
Registered: 2009-02-21
Posts: 6,086

Re: Q: how to extract building parts?

So it can't be inside the outline of the Villa Mediterranee.

But they are. If building outlines represent vertical projection, they can be inside one of other, because vertical projections of [non-vertical] buildings can overlap.

I also do not quite understand what is the problem with 2d rendering.
If you use top-down view of a 3D render or just sattelite images, you wil get exactly the same thing.


Истинные слова не не приятны, приятные слова не истинны.
True words are unpleasant; pleasant words are untrue.

Offline

#23 2018-02-04 22:52:28

Zkir
Member
From: Хрустальная Москва
Registered: 2009-02-21
Posts: 6,086

Re: Q: how to extract building parts?

I am not sure is it relevant or not, but just what I found:

In some Mediterranean countries the definition [of the 'building footprint' term] simply is taken as the ground shadow from an overhead sun.

http://constructioncosts.eu/glossary/bu … footprint/


Истинные слова не не приятны, приятные слова не истинны.
True words are unpleasant; pleasant words are untrue.

Offline

#24 2018-02-05 00:20:18

vvoovv
Moderator
Registered: 2008-03-04
Posts: 2,247

Re: Q: how to extract building parts?

From the beginning of the same page:

Building footprint
In construction this purely refers to the ground area utilised by construction

Offline

#25 2018-02-05 03:25:18

vvoovv
Moderator
Registered: 2008-03-04
Posts: 2,247

Re: Q: how to extract building parts?

Definitions:

1) Building footprint
The ground area utilized by a building.
Pay attention to the word "footprint". It isn't "bodyprint", but "footprint". It's about the area used by the foot of the building, rather than body of the building.

2) Building outline
The area within projection of all building parts onto a horizontal plane.

Offline

Board footer

Powered by FluxBB