You are not logged in.

#1 2021-07-10 15:15:09

HeinerSchaefer
Member
Registered: 2010-07-18
Posts: 30

JOSM preset: key depending on the type - possible?

I try to build a JOSM preset for Kneipp water cures.
https://wiki.openstreetmap.org/wiki/Tag … water_cure

Here I need to add an item for the foot basin.
This can be type=node,closedway:

        <item name="Foot basins of a Kneipp facility" type="node,closedway" preset_name_label="true" >
            <text key="name" text="Name" default="" />
            <key key="kneipp_water_cure" value="foot" />
            
            <key key="natural" value="water" />
        </item>

The problem is the key natural=water.
It's only allowed on closedway, in this context.

Is there any way to make the key natural=water dependet on type=closedway?
So that it's not added if type=node.

Offline

#2 2021-07-10 21:10:50

AlaskaDave
Member
From: Homer, Alaska ; Chiang Mai
Registered: 2013-09-21
Posts: 455
Website

Re: JOSM preset: key depending on the type - possible?

As far as I know, there is no way to build any decision-making logic into a Preset. I'm no expert but I have developed many of my own custom presets and have often wished for a way to make simple decisions within the XML code.

Someone else may provide more information but one definition of the XML file structure is as follows: "They are plain text files that don't do anything in and of themselves except to describe the transportation, structure, and storage of data." That would indicate to me that the XML format was never meant to be used programmatically.

Cheers,
Dave

Offline

#3 2021-07-11 08:44:03

HeinerSchaefer
Member
Registered: 2010-07-18
Posts: 30

Re: JOSM preset: key depending on the type - possible?

So I need to do, what I don't like:

        <item name="Foot basins of a Kneipp facility" type="closedway" preset_name_label="true" >
            <text key="name" text="Name" default="" />
            <key key="kneipp_water_cure" value="foot" />
            
            <key key="natural" value="water" />
        </item>
        <item name="Foot basins of a Kneipp facility (node only)" type="node" preset_name_label="true" >
            <text key="name" text="Name" default="" />
            <key key="kneipp_water_cure" value="foot" />
        </item>

I hoped, that there is an option to tell JOSM via this XML file how to handle keys depending on the selection.
node selected: this set of keys
closedway selected: another set of keys

In this case this would help.
But I have no idea if it's really needed often.

Last edited by HeinerSchaefer (2021-07-11 17:13:35)

Offline

#4 2021-07-11 16:31:06

AlaskaDave
Member
From: Homer, Alaska ; Chiang Mai
Registered: 2013-09-21
Posts: 455
Website

Re: JOSM preset: key depending on the type - possible?

I understand what you want to do but I repeat: you cannot use XML to make a decision to do tag an object differently based on whether it's a node or a closed way.

Offline

Board footer

Powered by FluxBB