# parts in buildings (shapes in shapes)

Last week the first code for relations were implemented in “OSM go”.

*** multipolygon: ***

“outer” and “inner” are done (not as way parts yet).
That is useful for “landuse”. Woods do have clearings now, pedestrian path have holes at subway entrances.
There is a known error in Three.js: quite a view holes are not done! May be clipper.js will do it better.
(way/34151096 http://www.osmgo.org/index.html?lat=48.13841&lon=11.57144&ele=62.90&dir=331&view=-53&tiles=1))

*** building: ***

Replacing an “outer” by a bunch of “part”s works fine. But …

https://wiki.openstreetmap.org/wiki/Key:building:part says: "It is also recommended to use a type=building relation to group together the outline way and the building:part=yes ways.” — “recommended” is nice but not done mostly Another acceptable tagging is to give the “outer” also an tag “building:part”.
(way/226672615 OSMgo.org?lat=49.59545&lon=11.00640&ele=53.37&dir=58&view=-10
http://osmbuildings.org/?lat=49.59638&lon=11.00439&zoom=18.6&rotation=-46&tilt=45))

So it has do be detected automatically! A human easily sees if a “part" is inside an “outer”. But what code logic should be used?

**Is there a good ready to use solution for “shape is inside shape”?
**

To compare any “outer” with any “part” is not efficient. Nodes/Ways could be sorted in the Lat- and Lon-axis. I fond another way: The “outer” and the “part” mostly share some nodes. If therer are alt last 3 such nodes, OSM go hides the “outer” except it is also an “building:part”. That’s not 100% correct but works mostly until I will find a “if shape in shape” solution.

A first test showed some steeples without church (also with OSMBuildings.org): The mapper hat only the steeple tagged as “building:part”, and no relation of course. In this case, the “outer” should be tagged with both “building” and part. How to detect such cases? Well, the “outer” should be “propper filled” with “building:part”s. So again that “shape in shape” question and also a kind of volume/area size compare. Or a relavant amount of the buildings nodes should also be a member of a part.

I think, such complex analyes should better be done on a vector tile server. A vector tile should have that relating information. Are there any vector tile servers I could use?

p.s.: Some times an entire building with all its parts is defined only with “building”. The 2D renderer seem to ignore all parts inside the outer. So my solution does not work.

Yes, OSM Buildings tile server exists

https://{s}.data.osmbuildings.org/0.2/anonymous/tile/{z}/{x}/{y}.json

Yes, we talked about it. Using this would solve quite a view of my building problems. I know, you do a lot of tag analysing on the server. I have to have a closer look at result structure. There is only zoom 16 or all? Later I would like to “fly” up to an earth view in space. (What about the {s}? This works: https://data.osmbuildings.org/0.2/anonymous/tile/16/19293/24641.json))

An additional download would be needed to get the remaining node and base layer data. And processing the base layer, I also have that problem with holes in shape. Could we define tiles with exactly the contend I need? I will do the work, if you tell me how. I yet have to think about what I need or just make a view experiments. (to be read!: https://wiki.openstreetmap.org/wiki/Vector_tiles))

There are only zoom levels 15 and 16 for now. With focus on buildings and vectors ist good enough.
However, some client side are needed to adapt tile sizes.

If you need it wall, there are more downloads. Serving all OSM data is not an option for OSM Buildings. But we could probably create a mixin for/with vector tiles.
Please describe what contents you’ll need.