NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

0
1

I have a strange problem with several of my custom presets that I've tried to fix many times without success. Below is my XML preset for tagging certain waterway features. When I invoke it on a new untagged river or stream way, the section to tag source:name (a multiselect key) is always grayed out. However, if the way is already tagged with waterway=stream or waterway=river, that section behaves as it should and I can select one of the values from the source:name multiselect and apply the tags. Furthermore, the default note "Actual direction of flow unknown." only appears in the first scenario. If there is an existing waterway tag as in the second situation, it does not appear.

The identical behavior is observed in the second item, Lakes/Ponds. If no tags exist on a closedway, the source:name section is grayed out. If a water=pond, or water=lake tag exists before the preset is invoked, everything works as it should.

Can someone lend a hand? Any help or suggestions will be most appreciated.

Dave

(Note: I have replaced < and > with @ symbols to allow XML code to display herein. Also, all "_" get automatically removed when posting XML code)

@presets xmlns="http://josm.openstreetmap.de/tagging-preset-1.0"@

@group name="Waters" @

@item name="Waterways" type="way" icon="presets/river.png" @

@combo key="waterway" text="Type of waterway" values="river,stream,canal,drain,ditch" default="" /@

@check key="intermittent" text="Intermittent?" disable_off="true" /@

@text key="name" text="Name" default=""/@

@text key="name:th" text="Name:th" default=""/@

@text key="name:en" text="Name:en" default=""/@

@multiselect key="source" text="Source(s)" values="Bing;survey;Mapbox Satellite;USGS Topo;MSR Topo;GPS;AK GINA" default="Bing" delete_if_empty="true"/@

@space/@

@multiselect key="source:name" text="Source(s) of name" values="personal_knowledge;survey;USGS Topo;MSR Topo;physical sign on bridge" default="" delete_if_empty="true"/@

@space/@

@optional@

@text key="note" text="Note" default="Actual direction of flow unknown."/@

@text key="ref" text="Reference" default=""/@

@text key="wikipedia:en" text="Wikipedia" default=""/@

@/optional@

@/item@

@item name="Lakes/Ponds" icon="presets/water.png" type="node,closedway" @

@key key="natural" value="water" /@

@check key="salt" text="Salt Water" disable_off="true" /@

@combo key="water" text="Pond, Reservoir, Lake" values="pond,lake,reservoir,oxbow,lagoon" default="pond" values_searchable="true" /@

@text key="name" text="Name" default=""   /@

@text key="ele" text="Elevation" default=""   /@

@multiselect key="source" text="Source(s)" values="Bing;Mapbox Satellite;USGS Topo;MSR Topo;GPS;AK GINA" default="Bing" /@

@multiselect key="source:name" text="Source(s) of name" values="personal_knowledge;survey;USGS Topo;MSR Topo;physical sign" default=""  /@

@text key="note" text="Note" default=""   /@

@/item@

@item name="Riverbank" icon="presets/water.png" type="closedway" @

@key key="waterway" value="riverbank" /@

@multiselect key="source" text="Source(s)" values="Bing;Mapbox;USGS Topo;MSR Topo;GPS;AK GINA" default="Bing" /@

@text key="note" text="Note" default=""   /@

@/item@

@item name="Dam" type="way,node,closedway" @

@key key="waterway" value="dam" /@

@text key="name" text="Name" default=""   /@

@text key="name:th" text="Name:th" default=""/@

@text key="name:en" text="Name:en" default=""/@

@multiselect key="source" text="Source(s)" values="Bing;survey;Mapbox Satellite;USGS Topo;MSR Topo;GPS;AK GINA" default="Bing" delete_if_empty="true"/@

@multiselect key="source:name" text="Source(s) of name" values="personal_knowledge;survey;USGS Topo;MSR Topo;physical sign" default="" delete_if_empty="true" /@

@space/@

@text key="note" text="Note" default=""  /@

@/item@

@/group@

@/presets@

asked 11 Nov '16, 01:10

AlaskaDave's gravatar image

AlaskaDave
5.4k76107164
accept rate: 16%

edited 11 Nov '16, 09:09

scai's gravatar image

scai ♦
33.3k21309459


Hi @AlaskaDave,
Looks like the default="" in the multiselect is causing the problem. I removed the default and source:name came up properly. By the way, as per the documentation (https://josm.openstreetmap.de/wiki/TaggingPresets) delete_if_empty attribute is deprecated. The modified entry looks like as follows: <multiselect key="source:name" text="Source(s) of name" values="personal_knowledge;survey;USGS Topo;MSR Topo;physical sign on bridge" />

However, I could not figure out how to get the default value for optional attributes for nodes/ways with pre-existing tags. Could not find anything in the documentation. I would imagine that it is the normal behavior. If the tags are already present, one may not be required to put a default attribute which is optional.

Hope this helps.
Prime

permanent link

answered 12 Nov '16, 07:28

primej's gravatar image

primej
10614
accept rate: 100%

1

Many thanks. I tried removing the delete_if_empty parameters first and that seemed to do the trick. I did not know that it had been deprecated. My multiselect and combo statements work as expected now even with the default set to "Bing" or some other value. I also added the values_sort="false" parameter to my combo and multiselect directives because that behaviour, new to JOSM for the past several releases AFAIK, was annoying me.

(12 Nov '16, 12:08) AlaskaDave

The main difference that I see with the preset that I maintain (BENELUX) is that I keep all combo and multiselects in the optional part. I do not notice the behaviour that you see.

permanent link

answered 11 Nov '16, 07:01

escada's gravatar image

escada
19.0k16166302
accept rate: 21%

Thanks escada - That's not it. I moved those lines into the optional section and they still exhibit the same behavior.

(11 Nov '16, 08:09) AlaskaDave
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×622
×84
×9

question asked: 11 Nov '16, 01:10

question was seen: 2,663 times

last updated: 12 Nov '16, 12:08

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum