# User:Jongleur/MultiLevel Building Shapes

Most buildings in the world are built of more than one level. Often those levels are not congruent to each other. One floor overlaps the floor below or the top-most floor e.g. keeps space for a terrace.

For POI inside of buildings we can use level=* with the level number as value to describe the floor the (e.g.) shop is located at. But there is a scheme missing to describe the geometry of the different levels.

## Approach

To solve this we model different layers separately as polygons or multipolygons. Even when the level is combined of more than one simple polygon these should be connected in a multipolygon relation to bind them together to the same floor. The naive approach would be to require one (multi-)polygon per level, but that's highly redundant, where a building is a simple block with lot's of congruent levels. To avoid this redundancy we add a tagging scheme to polygons spanning more than one level.

Let's assume in the image above A to contain 2 floors, B to contain 3 floors. We apply the following tags:

A) building:levels=2

B) building:levels=5 building:min_level=2

Additionally, if known, we add the height in meters, for the complete block as follows

A) height=6

## Rationale

The combination of levels as the topmost level number and the min_level as the bottom-most one helps to support older renderer software. Let's assume to have a renderer who interprets height=* and/or building:levels=* but not building:min_level=* or min_height=*

The following images show a comparison of how renderers would render the example described before. Images showing real 3D renderings would be nice additionally.

## TODO

• Tunnels and briges: could be described as buildings; solves problems with bundeling more than one way to a single tunnel/bridge (examples: separate bridges over Pader, Paderborn, Germany vs. any street bridge containing sidewalks)
• interpolation of levels (stairs, ...)
• rendering is easier in some cases, if different shapes don't intersect each other; that should be stated here for situations where it's possible to avoid intersections without losing information

## why not add an external 3D-building database

Why should we describe the geometry of buildings in the OSM? I talked to people preferring external 3D models like Google does it.

I think, there are good arguments to add external models, and if there is such a model it would be good to support it in renderers, too, but:

I dislike the idea to require the interpretation of external models for navigation and routing. Malls, fairgrounds, parking houses, universities etc. are often complex buildings with several levels, where routing should be able to navigate pedestrians to the target - not to a point 2km away at the entrance of the mall.

## Discussion from IRC

These are my notes from discussing the difficult cases of buildings where they are interconnected with other buildings in ways that what a "level" denotes may be ill-defined Pnorman 00:13, 21 December 2010 (UTC)

building:levels=n The number of the level above the highest level of the building.

building:min_level=m The number of the lowest level of the building. If not specified, defaults to 0.

building:ground_level=g The number of the level which is the "ground floor" of the building. If not specified, defaults to 0.

n, m, and g need not be integers

When two buildings join, the each level of one building matches with the same numbered level of the next building.

For an isolated building there is no difference between building:levels=n building:min_level=m building:ground_level=g and building:levels=n+x building:min_level=m+x building:ground_level=g+x

### Example tagging

A house with two levels: building:levels=2
A house with two levels above ground and a basement below ground: building:levels=2 building:min_level=-1
A house with two levels total, one of which is partially below ground. building:levels=2 building:ground_level=0.5 with building=entrance building:levels=0 nodes for entrances to the lower floor with stairs tagged on the footway leading to it
A three story and four story building level ground with an overpass between them on the floor above ground level
Building A: building=yes building:levels=3
Building B: building=yes building:levels=4
Overpass (touching both buildings): building=yes building:levels=2 building:min_level=1
A three story building and a four story building with the three story building being elevated due to ground level differences, connected by an overpass which connects the floor above ground level of the three story building with the floor two above ground level of the four story building.
Building A: building=yes building:levels=4
Building B: building=yes building:levels=4 building:min_level=1 building:ground_level=1
Overpass (touching both buildings): building=yes building:levels=3 building:min_level=2

### Sloping ground

Does not address sloping ground where a building may not have a clear "ground floor"

## Related stuff

### Rendering Software

• Kothic: realtime renderer able to render extruded buildings in real time considering number of levels or, where available, height.
• MapSurfer.Net: Another rendering engine (not open source!) with 3D capabilities
• OSM-3D: Generates interactive web-based 3D scenes, not maps
• glosm: Both 3D tile generator and interactive first-person viewer using OpenGL

### Related proposals

• Relations/Proposed/Level: Proposal for a relation used as a collection of all elements at the same floor. If I understand it right, it's not solving the issue with different shapes of different levels.