Opened 13 years ago

Last modified 12 years ago

#5933 closed enhancement

[patch needs rework] Building presets — at Version 12

Reported by: bilbo Owned by: team
Priority: normal Milestone:
Component: Core Version: latest
Keywords: Cc:

Description (last modified by !i!)

Patch that will enhance presets for building parameters (height, levels, etc ....)

Note that optimally, these presets should be available for any building (building=house, building=train_station, etc ...) - is this possible to somehow change the '<key key="building" value="yes" />' so that "yes" will be default, but user will be able to choose other building types, and this preset would be available for any way tagged with building key?

Change History (14)

by bilbo, 13 years ago

Attachment: building-presets.patch added

Patch to add building presets to JOSM

comment:1 by stoecker, 13 years ago

The "select building type" should be possible using a combobox with a default value "yes" and a delete_if_empty set to false.

comment:2 by tordanik, 13 years ago

This preset introduces several tags that are controversial, haven't been discussed sufficiently and/or don't work for most cases. For example:

  • building:roof:orientation isn't properly defined for anything but the most simple outlines
  • objections against culture-dependent understanding of building:min_level have been raised on the proposal's discussion page and not been addressed so far
  • building:architecture provides an arbitrary set of values and isn't actually popular in tagging practice
  • building:type is mostly a duplicate of building

I wouldn't be happy if these ideas were prematurely established via JOSM preset. These issues need to be discussed more thoroughly.

comment:3 by !i!, 13 years ago

You are right, but we all would be very happy if you would add the well known/established ones already.

comment:4 by tordanik, 13 years ago

The only keys in this template which I would consider truly established are building, height and building:levels. If you want to add these, you have my support.

comment:5 by bilbo, 13 years ago

Well, this patch add all the tags mentioned anywhere. Aside from height and building:levels, min_height and/or building:min_level is used in about 1000 buildings in OSM (as buildings with large parts between ground and first floor are not so common), so while not very common, it is quite used. But at least the height and building:levels should be added now and the list can then be extended later once some further tags are considered stable ....

stoecker> "select building type" should be possible using a combobox

But problem is that the buuilding type is a key:

<key key="building" text="Building type" value="yes" />

Is it possible to specify something like:

<key-as-a-combo key="building" text="Building type" values="yes,house,commercial,retail, ......." default="yes" delete_if_empty="true" />

instead?

Documentation does not mention such possibility.

comment:6 by stoecker, 13 years ago

You can simply change the key to a combo. You must only ensure, that the value is set always (thus delete_if_empty=false). Key means "set without user interaction". All the other forms mean "set with user-interaction".

comment:7 by stoecker, 13 years ago

Summary: [patch] Building presets[patch needs rework] Building presets

comment:8 by bilbo, 13 years ago

I tried this:

<key key="building" value="yes" />
<combo key="building" text="Type of building" values="train_station,hangar,yes" default="yes" use_last_as_default="true"/>

And when selecting from menu, it works fine. However, if you select existing building (anything tagged with building=yes), then in the panel with tag editor you click "Man made/man made/Building" and change the "Type of building" to "train_station", the tag will change to building=tran_station (so far all is ok), but then "Man made/man made/Building" will disappear from the panel with tags (as building=train_station does not match the key), so you are unable to edit the building using this preset anymore.

I loooked in the corresponding Java code in tag editor and it seems there is currently no way of showing this presets in the panel with tag editor for building=<anything> (as ).
So I guess some code change would be required for this preset to fully work (enhance the key to and then support this in the preset matching logic org/openstreetmap/josm/gui/dialogs/properties/PresetListPanel.java).

by bilbo, 13 years ago

Attachment: building-presets.2.patch added

Fixed and simplified building presets

comment:9 by bilbo, 13 years ago

Summary: [patch needs rework] Building presets[patch] Building presets

Attached reworked patch - only height and building:levels tags from the advanced attributes are present (the rest can be added later) and you can now specify building type. Only three are present (hanger, train_station and the default "yes")

More types can be added, but I am not sure of what values should end up there as being considered well defined, etc ...

I suggest adding most of : hut, house, apartments, residential, industrial (these have at least 10000 occurences on entire planet)
and perhaps think about: garage, garages, barn, shed, university, bunker, cabin, chapel, church, commercial, factory, farm, greenhouse, hall, hospital, industrial, office, retail, school, tank, warehouse (some of the others I've seen with at least few hundred occurences)

Minor code change was needed, so the preset will show up in the tag editor as clickable for any building tag, not only for default "building=yes"

comment:10 by stoecker, 13 years ago

Summary: [patch] Building presets[patch needs rework] Building presets

I don't like that both key and combo describe the same key. This is error prone. Also you match_only_key is more a workaround than a clean solution.

Your idea to change code seems sensible, but rather than your solution I would a suggest a "match" property, which can be used for all types (especially combo boxes), which has following values:

  • yes (the default for keys, matches key+value)
  • no (does not match - disable key matching, default for all other types)
  • key (what you implemented)

For buildings presets, the key line can then be dropped and match="key" can be added to the combo. match="yes" for combos would mean one of the values matches.

comment:11 by simon04, 13 years ago

Type: defectenhancement

comment:12 by !i!, 12 years ago

Description: modified (diff)

We are currently bringing the 3D tags together, there are just to much: http://wiki.openstreetmap.org/wiki/3D_Development/Tagging#Usage_tools
Hopefully we can do it on the 3D meeting next year: http://wiki.openstreetmap.org/wiki/2nd_3D_Workshop_Garching

Note: See TracTickets for help on using tickets.