Support for gabled roofs broken
Gabled roofs are rendered as flat in most cases, and in surprising angles in others. Examples:
- https://beakerboy.github.io/OSMBuilding/index.html?id=285102551 (flat; building has no height or roof:height)
- https://beakerboy.github.io/OSMBuilding/index.html?id=868101951 (flat; building has levels + roof:levels)
- https://beakerboy.github.io/OSMBuilding/index.html?id=283112960 (weird angle; building has levels + roof:levels)
Thanks! I was just looking into that.
There are a couple roof orientation bugs. I just fixed one, but it looks like this is slightly different. If a building is rectangular, everything seems to be fine. The issue with the third build with the weird angles is due to the fact that the corners are not 90° and that there are nodes along the longest edges which make each segment shorter then the “short side”. The code looks for the longest line segment when it tries to figure out which way to orient the roof. I’ve added a simple sanity check to add 90° if it thinks this situation is present. Since your building does not have 90° corners, things look wonky.
I should be able to compensate for this.
The missing roofs must be something else altogether. I’ve improved my unit testing, so hopefully I can figure those out shortly.
Your example with the mis-oriented roof now works.
The roof:shape=round rendering seems to be broken as a result
|
Before |
After |
|---|---|
|
|
|
Roof example: https://www.openstreetmap.org/way/1241626581
p. s. I note that this temple is not rendered in the main branch until https://github.com/Beakerboy/OSMBuilding/pull/100 isn't merged 😉
This makes sense. Round and gabled are both directional and I fixed one, but round was working so I probably broke it. The round roof must have had two mistakes which compensated for each other. By fixing one it revealed the second.
On closer inspection, I don’t even have support for round roof type. I reordered the way I evaluated the rendering. I think it used to be that if a type was unsupported, it just returned without a roof. Now it displays a flat roof.
@canavan I think the issue with the second one is it is tagged as “roof:direction” = “across” instead of “roof:orientation” = “across”. ‘roof:direction’ Is supposed to be a compass direction in degrees.
I corrected the tag and it renders correctly now. I’ll add a feature to inform the user if the tag contains “not a number”
@canavan I think the issue with the second one is it is tagged as “roof:direction” = “across” instead of “roof:orientation” = “across”. ‘roof:direction’ Is supposed to be a compass direction in degrees.
good find. That was my mistake, and I thought I had fixed that. My excuse is that the intro of the roof:direction Wiki article is at best confusing regarding the use of orientation vs. direction.
All examples now work.