Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support roof orientation #1063

Closed
PanderMusubi opened this issue May 9, 2018 · 44 comments
Closed

Support roof orientation #1063

PanderMusubi opened this issue May 9, 2018 · 44 comments
Labels
blocked blocked by another issue enhancement new quest accepted new quest proposal (if marked as blocked, it may require upstream work first)

Comments

@PanderMusubi
Copy link
Contributor

Please support roof orientation. For example, rendering of roofs is completely off without this tag, see for example http://demo.f4map.com/#lat=52.0635927&lon=5.1341593&zoom=21 where in reality it is one roof running from left to right in that view.

Documentation is scarce but found at https://wiki.openstreetmap.org/wiki/Simple_3D_buildings#Roof However, more than 250.000 houses have this tag to facilitate proper roof rendering, see https://taginfo.openstreetmap.org/keys/roof%3Aorientation#overview

@rugk
Copy link
Contributor

rugk commented May 9, 2018

As it seems most renderers just use the longest width of a house as the orientation of the roof, which is okay, IMHO.

As for your suggestion: How do you imagine this to be done in StreetComplete? As a new quest`As an addition to the existing roof quest? (If so, at which position should it ask that?)

Generally I'd tend to say that this is just an additional tag, which may be added by later OSM mappers and is not really suited for SC.

@PanderMusubi
Copy link
Contributor Author

PanderMusubi commented May 9, 2018

Other rendering that is off is https://osmbuildings.org/?lat=52.06345&lon=5.13176&zoom=20.0&rotation=-99&tilt=45 and it is also like this in 3D Mapbox. They should reder as https://www.google.com/maps/@52.0635645,5.1321129,3a,75y,253.78h,87.42t/data=!3m6!1e1!3m4!1sRMlRiMt6C2sFb0Zz5C_a9w!2e0!7i13312!8i6656

To answer your question, yes, it assumes the default for rendering the roof. IMHO it is worse than rendering no roof. In the Netherlands, most houses are small in width and long in depth and are positioned in a row with a shared roof running along the houses in that row. Houses for which the default would work are mainly the historical buildings along canals. Therefore, supporting this additional tag would enable properly represent not only the roof but make the feeling of the rendering appropriate.

Why query (in another quest) for roof shape if the result is not that useful when orientation is missing? This is a detail that other ways of mapping (e.g. via aerial photography) is not so easy. SC is ideal for this as the use has already looked at the house for the number of levels and how the roof looks.

In order to for SC to formulate this in a easy quest, I would say, offer an image representing roof orientation along and roof orientation across (and one option for 'Can't say'). It is only useful ask the user for roof shapes:

  • skillion
  • gabled
  • half-hipped
  • hipped
  • gambrel
  • mansard
  • round
  • saltbox

@rugk
Copy link
Contributor

rugk commented May 9, 2018

So you want to suggest anew quest?
In this case please read https://github.com/westnordost/StreetComplete/blob/master/CONTRIBUTING.md#suggesting-new-quests and fill out the issue template.

@matkoniecz
Copy link
Member

Given

For roofs with a ridge the ridge is assumed to be parallel to the longest side of the building (roof:orientation=along). But it can be tagged explicitly with this tag.

from https://wiki.openstreetmap.org/wiki/Simple_3D_buildings#Roof and that it should be easy to add from aerial images I am not convinced that it would be a good quest.

@PanderMusubi
Copy link
Contributor Author

That would mean that after a user has done a lot of quests related to number of floors in a building and then adding the shape of a roof, he or she needs to go home, use another tool such as iD editor, locate all the buildings for which these quests were done, find the areal imagry (which is not always available at proper resolution) and manually add this detail. Isn't that resulting in much more work and taking the fun out of SC?

To answer rugk's question, yes, it would be another quest. I will fill out the template and I'm willing to implement it.

@rugk
Copy link
Contributor

rugk commented May 10, 2018

You'll see if you fill out the issue template and give instructions that it would (e.g. I doubt you can fulfill the "no spam" requirement) possible not work in StreetComplete.
What is taking fun of SC would not be some details you may have to add later using another editor (if you want!), but a quest you can only answer with "no" in 90% of the cases or so.
Remember you can always create a manual note in SC, which you can later find on openstreetmap.org to find the house, where you want to add a tag or so.

@rugk
Copy link
Contributor

rugk commented May 10, 2018

We don't need Google Translate if the article you link is also available in English (as for the second one): https://en.wikipedia.org/wiki/Terraced_house (so maybe not only Netherlands…?)

Here is also a DeepL translation of the first one.

@PanderMusubi
Copy link
Contributor Author

The translated page has other images and is less focused on the Dutch situation. Thanks for the DeepL link, didn't know yet about that site.

@westnordost
Copy link
Member

See #1063 (comment)

@HolgerJeromin
Copy link
Contributor

If NL has other defaults this should be integrated into the visualisation.

@PanderMusubi
Copy link
Contributor Author

It is not an official default and it does vary. More historic places have the default as it is now. Houses from after WWII mainly have this feature, but again, not all.

@RubenKelevra
Copy link
Contributor

I think we should think about adding this as an additionally quest asked right behind the roof question. We could just rotate the small pictograms according to the orientation of the building in the map view. This should be dead easy for the users.

@rugk
Copy link
Contributor

rugk commented May 12, 2018

additionally quest asked right behind the roof question

Until now @westnordost always declined such "follow-up" questions. And I think that's good, because either make a new quest and also apply it to buildings, which already have a roof specified; or not. Follow-up questions are also just yet another thing you have to click on. And may have similar restrictions than new quests – e.g. "no spam": It still makes no fun (or UX) to click on "no" after 80% of the roof quests you solve.

What could be done is to somehow integrate it into the roof quest that does not need another button. "small pictograms according to the orientation" sounds like the right direction. I think of this as the map moves for the bicycle quest… I am just not sure how to make iot clear to the user how to rotate the map/when to rotate and what effect this rotation has… Or, ye again, maybe an "other answer"?
Still not really convinced about any option…

@RubenKelevra
Copy link
Contributor

RubenKelevra commented May 12, 2018

Well, with follow-up I meant a quest directly located behind the first one. :)

If you dislike it, you can just deactivate it and SC will never bother you again. :)

@rugk
Copy link
Contributor

rugk commented May 12, 2018

BTW we still have no actual issue template filled out for this quest suggestion – if one thinks this should be a new quest.

This whole issue is rather vague… What is finally the imagined way for SC to do? @PanderMusubi How do you imagine this?


I meant a quest directly located behind the first one

@RubenKelevra So this is a "new quest" as usual then. "no spam" is still unsolved.

@RubenKelevra
Copy link
Contributor

Well, if a new quest is considered "spam" - which I don't agree on (in this case), we could add two arrows at a corner of the roof-type question, make it able to turn the pictograms by 90° back and forth. The pictograms need to be rotated like the building is showed on the map like I already said.

So we would need some kind of 3D pictogram rotating in 3D... I don't know if this is possible to implement.

@ENT8R
Copy link
Contributor

ENT8R commented May 13, 2018

we could add two arrows at a corner of the roof-type question

I think extending an existing quest is rather a bad idea because you have to teach the user somehow that now an additional information is required and there are maybe some users who don't even see that something changed...

@westnordost
Copy link
Member

westnordost commented May 13, 2018

@RubenKelevra did you consider that it is often not actually visible for the surveyor which side of the building is the long and which is the short side? Only dependent on this information, a UI like you propose would make sense.

The way I see it is that the only UI that makes sense is to show a preview of the building roof in the same orientation as the map, like for the cycleway quest (or even on the map). As you ascertained yourself, this is only possible with a 3D-model. The models are so relatively simple that they may be defined even in code, the "3D roof pictogram view" would need to be implemented using a GLSurfaceView (OpenGL). It is an interesting coding challenge.

I could imagine that the current roof shape quest is modified to have this kind of 3D-view and add a button that rotates the roof by 90°. By default, the building is shown in the "roof-along" orientation and if the user presses no further buttons, it is also tagged that way explicitly.

The solution as a separate quest would have this "no spam" problem. Yet, if the quest asks simply "is the roof more like this or like this?" (showing two 3d previews), it's at least answered quickly.

@RubenKelevra
Copy link
Contributor

RubenKelevra commented May 13, 2018

@ENT8R well, we can just add a fullscreen hint, highlighting this change, to inform users about the change.

@westnordost if the user is able to observe the basic roof shape, the user would also be able to tag the roof orientation and vice versa. But regardless of the implementation, if the user is not able to observe it, he/she should not answer it. :)

Edit:

Your idea with a default orientation "along the street" would require a detection of the orientation of the street. Maybe it's easier to ask the user explicitly that: We just draw a pictogram of a street in front of the building and create a second pictogram of the building the a roof towards the street on the 90° image. This would skip the 3D part completely and so do not overcomplicate things internally. :)

@PanderMusubi
Copy link
Contributor Author

General

Affected tag(s) to be modified/added: roof:orientation
Question asked: How is this roof oriented?

Checklist

Checklist for quest suggestions (see guidelines):

  • 🚧 To be added tag is established and has a useful purpose
  • 🤔 Any answer the user can give must have an equivalent tagging (Quest should not reappear to other users when solved by one)
  • 🐿️ Easily answerable by everyone from the outside but a survey is necessary
  • 💤 Not an overwhelming percentage of elements have the same answer (No spam)
  • 🕓 Applies to a reasonable number of elements (Worth the effort)

It improves 3D rendering of houses a a major way. See also https://taginfo.openstreetmap.org/keys/roof:orientation#values where the values across and along are divided almost 50-50 for a total of 150,000 items.

Ideas for implementation

Similar to building:levels and roof:shape. It should follow quest roof:shape. Value for building:levels is (I think) irrelevant here as this is probably a precondition for roof:shape already.

Element selection:

Probably concerns all countries.

Metadata needed:

roof:shape must have a value of:

  • skillion
  • gabled
  • half-hipped
  • hipped
  • gambrel
  • mansard
  • round
  • saltbox

See also https://taginfo.openstreetmap.org/keys/roof:shape#values All other values should not be used as precondition.

Proposed GUI:

Following options could be presented:

  • across
  • along
  • can't say
  • complex/combined?

Personally I would present it in a general way, although the use needs to look also at the shape of the building on the map in order to determine the roof's orientation. Perhaps the ratio can already be calculated for the user in order to more easily select the proper answer.

img_20180514_155649

That idea of along the street does hold some value which can be applied here, albeit that it would only work for houses which are in a row and not on the corner of a street. But using the proper pictogram according to the already calculated ratio would make this less difficult.

@westnordost
Copy link
Member

westnordost commented May 14, 2018

@PanderMusubi Wat, did you read my last comment?

Perhaps I wasn't clear, so I can elaborate based on your sketch: Assume you stand in front of the house pictured on the lower right. From that point of view, you can see how broad the house is, but not how long it is - it is not transparent. In other words, you can't see if a is bigger than b because b is unknown.
And even in situations where you can see it because it is free-standing, there is a relatively large margin where people will not estimate correctly which side of a house with a relatively square outline is actually the longer one.

@PanderMusubi
Copy link
Contributor Author

Yes, I agree with you, some cases it is not easy to see from the street. Usually it is best seen from a house on the corner of such row of houses. So a user should be presented the 'can't say' option in such way that it is not a loss or shame to choose that. The ratio a/b can be derived from the building, but should be used carefully because some houses have an extension at the back which has a flat roof.

This detail has indeed some challenges. On taginfo, I also found some values related to N, north, NE, north_east, etc. https://taginfo.openstreetmap.org/keys/roof:orientation#values That would make it easier, but I'm no expert on these values and if they could be promoted to be allowed to be used. Ask the OSM tag community?

@westnordost
Copy link
Member

westnordost commented May 14, 2018

No, just read and understand my comment: #1063 (comment)

With the addition: Whether to use across or along can be automatically calculated from the building outline.

@PanderMusubi
Copy link
Contributor Author

I see what you mean by not making a separate quest out of it, but combining it. The addition I made was according to the template and try to make the quest as atomic as possible and not yet anticipate how the implementation would be.

@HolgerJeromin
Copy link
Contributor

Just as a side note for the implementation:
I had nearly square buildings (location germany, so not so much in the north) in the past where different 3D renderers detected the "longer building side" different. This was probably due to map projection differences.

@westnordost westnordost added enhancement new quest accepted new quest proposal (if marked as blocked, it may require upstream work first) labels May 27, 2018
@xuiqzy
Copy link
Contributor

xuiqzy commented Apr 6, 2020

I can confirm that in at least some cities in Germany it is not clear if across or along would be used considerably more often because of thin row houses and thus the quest would not be spam there.

@HolgerJeromin It could also be the case that the building outline is updated when better imagery is available and thus the interpretation of along and across changes!
Maybe a tag with the cardinal direction like south like @PanderMusubi mentioned would be less error prone? But that could be problematic for larger buildings with many corners...

@ModProg
Copy link

ModProg commented May 8, 2020

One option would be the use of https://wiki.openstreetmap.org/wiki/OSM-4D/Roof_table, but as far as I can see this would require to edit the path for the building.

@westnordost
Copy link
Member

@tordanik is there a way to create a 3d object of a house with a certain roof shape using some kind of (small) library? That would be great, then I could just feed the outline, floor levels/height, roof levels and hsape etc to that library and have returned an OBJ that I can feed to OpenGL.

@tordanik
Copy link

tordanik commented Sep 8, 2020

@tordanik is there a way to create a 3d object of a house with a certain roof shape using some kind of (small) library?

Turning a building outline + tags into an OBJ sounds exactly like a job for OSM2World . :)

As you would only need the core module, the size wouldn't have to be particularly large. If size is really critical, we could strip it down further by removing all the features besides buildings.

I do not currently offer an Android build, but helping out StreetComplete might just be the perfect reason to change that. Use as a library is firmly within the project's intended scope, so it would fit well with my plans. I'd be happy to accommodate requirements for the library's interface and the visual aesthetics. Feel free to reach out to discuss details!

@westnordost
Copy link
Member

no Android build necessary, a Java library is fine as well I would say. I posted ticket with a rough idea how the interface could look

@tommycrock
Copy link

Just to say that adding this in would be useful for terraced houses in the UK, where again many, perhaps most, will be gabled but with the ridge parallel to the short side. I agree that presenting the user with a view of the roof oriented to the map, as for pavements, cycle lanes, etc. is the way to do it. If the 3d model was too hard to implement then could a simple ridge line be shown on the building?

@RubenKelevra
Copy link
Contributor

@tommycrock we actually have already "3D models" of the buildings, we need to rotate them to be a top-down view:

IMG_20210718_121706

The major task would probably be to determine the orientation of the building itself, as there are very complex building shapes out there. Maybe we can restrict this first to simple 4 point buildings?

@tommycrock
Copy link

I had assumed that in the app those were just raster images and that presenting them dynamically rotated to the angle of the building might be awkward.

Yes, I hadn't thought about the complexities of building shape in relation to determining this, and that they often won't have been (or actually be) squared. I guess you need to try to determine the longest segment, use that for orientation, then find a rectangle that encompasses the whole building (off the top of my head). Perhaps if it is square or near-square orientation shouldn't be specified as there isn't a clear interpretation. Alternatively, using the compass points a lot of this complexity falls away and leaves more readily interpretable tags (although I don't know how well they are supported).

@RubenKelevra
Copy link
Contributor

@tommycrock wrote:

I had assumed that in the app those were just raster images and that presenting them dynamically rotated to the angle of the building might be awkward.

Yeah, That's why my 3D buildings were in quotes. But I'm not sure if they are SVGs or raster images, but we could create similar-looking ones just from the top view.

Yes, I hadn't thought about the complexities of building shape in relation to determining this, and that they often won't have been (or actually be) squared. I guess you need to try to determine the longest segment, use that for orientation, then find a rectangle that encompasses the whole building (off the top of my head). Perhaps if it is square or near-square orientation shouldn't be specified as there isn't a clear interpretation. Alternatively, using the compass points a lot of this complexity falls away and leaves more readily interpretable tags (although I don't know how well they are supported).

This won't work. Have a look at these examples and try your algorithm:

https://www.openstreetmap.org/way/99536366
https://www.openstreetmap.org/way/276515762
https://www.openstreetmap.org/relation/3011170


I think actually roof:direction might be much easier than determining the street orientation and the orientation of the building in relation.

We might try to find pretty much parallel lines in two directions. If enough percentage of the building is aligned in 2 directions, we can take the average and rotate the building image accordingly.

With the roof:direction tag we don't have to care about the street orientation anymore.

@tommycrock
Copy link

About those examples, I'm not sure they're relevant as the answer isn't going to be a basic roof type with a ridge in a particular orientation. From eyeballing the 2nd and 3rd it would work well enough but anyway would be irrelevant. The first it would hopefully deliberately fail as there are equal length segments all round, so those options don't need to be presented.

Yes, it was direction I was suggesting would be a better tag to use.

@westnordost westnordost added the blocked blocked by another issue label Jul 18, 2021
@westnordost
Copy link
Member

The only reasonable way forward to improve this is to offer a preview of how the building will look like - maybe even superimposed on the map itself when selecting the basic shape and orientation.

And this is best done by a library based off Osm2World, i.e. this is blocked by tordanik/OSM2World#171
And when it is not anymore blocked by that because it is implemented, solving this quest will be awesome. Last time I asked @tordanik about it, he is still committed to doing this, but he has limited time to work on Osm2World and looking at the github history, it is clear that there are enough other important things to do. So it is not clear when this will be done. If you would like to see this quest and you know Java and OpenGL, one option may be to start contributing to Osm2World itself.

@matkoniecz
Copy link
Member

matkoniecz commented Dec 8, 2021

Given enormous effort required to implement this and how often such data would be used: is it worth keeping open?

I would not be against including it if someone would somehow implement it but I would close this issue.

@westnordost
Copy link
Member

Well it's blocked. But when it's unblocked, it should be quite straightforward to do

@matkoniecz
Copy link
Member

I subscribed to tordanik/OSM2World#171 and will reopen this issue once it is implemented

@matkoniecz
Copy link
Member

assigned matkoniecz 14 minutes ago

Though note that it is only for reopening, I will unassign once I will do this

@westnordost
Copy link
Member

You certainly make it complicated for yourself. You close it to get your mind off it / get it off the table, but then you assign yourself so to keep it in mind.

@matkoniecz
Copy link
Member

@westnordost Well, @smichel17 assigned me and I do not really see point of that. To remember it I watchlisted relevant issue on osm2world

@smichel17
Copy link
Member

smichel17 commented Dec 15, 2021

I assigned @matkoniecz kind of on impulse 😅 . I figured it might be useful to indicate that someone was tracking the upstream issue. If that turns out to be the case, we can do it more. If it's not useful, we can forget about it and not do it again.

I thought it would not make much of a difference for "getting off your mind" because it is closed; the only real difference it makes is when looking at issues with the blocked label, where you can now see that someone is on top of watching this one.

I didn't comment because I didn't want to create more noise in the issue (I have now spent way longer writing this comment than I spent thinking before I clicked the assign button), but I guess that has failed 🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked blocked by another issue enhancement new quest accepted new quest proposal (if marked as blocked, it may require upstream work first)
Projects
None yet
Development

No branches or pull requests