[Merkaartor] Templatized tagging committed

Dirk Stöcker openstreetmap at dstoecker.de
Fri Nov 7 13:28:04 GMT 2008

On Fri, 7 Nov 2008, bvh wrote:

> a.
> 	<label text="Edit a Motorway" />
> 	<label text=" " />
> 	...
> 	<label text="Optional Attributes:" />
> 	<label text=" " />
> This kind of constructs are used all over the place to create the appearance
> of a header describing what is going to follow. It would be better if that
> was made explicit by something like
> <description text="Edit a Motorway" />
> ...
> <optionals text="Optional Attributes:"/>

Sounds fine. But not
<optionals text="Optional Attributes:"/>

I would suggest


Thus they can be handled correctly and the editor can choose the text 
itself and if they are displayed at all or not.

> b. A lot of tagging guidelines might only make sense when another tag has
> been set. The current JOSM format has limited support for this :
> group/item constructs a 1 level deep hierarchy of possibilities.
> This breaks down with more complex constraints, like for example places
> of worship. A combobox with denominations makes only sense for certain
> religions and each religion for which it makes sense has it own list of
> denominations. Ideally we would have a way to only present logical
> choices based on what is already known about the feature.

Sounds sensible to me, but I do not known how the selection 
should really look like and how this can be implemented in JOSM.

> The current JOSM presets punts on this and just includes all denominations
> for all religions in the place of worship item.
> I propose the addition of a new optional construct inside each item
> 	<selector type="expr/>
> This would only present the item when expr evaluates to true.
> Then we could have this in the presets file under buildings (simplified)
> 	<item name="Place of worship">
> 	<combo key="religion" (list all religions).../>
> 	</item>
> 	<item name="Christian church">
> 	<selector type="[religion] is christian"/>
> 	<combo key="religion" (list all religions).../>
> 	<combo key="denomination" ... (only christian denoms) />
> 	</item>
> 	<item name="Muslim mosque">
> 	<selector type="[religion] is muslim"/>
> 	<combo key="religion" (list all religions).../>
> 	<combo key="denomination" ... (only Islamic denoms) />
> 	</item>

Anyway I would adapt your method here:

What about that:
a) make the <selector type="[religion] is muslim"/>
    a property of the tags:
    <item name="Muslim mosque" condition="[religion] is muslim">
    And also allow that for condition for other elements:

   <item name="Place of worship">
      <choice key="religion">
        <element value="christian">
        <element value="muslim">
      <choice key="denomination">
        <element condition="[religion] is muslim" value="shia">
        <element condition="[religion] is christian" value="protestant">

This is a bit harder to analyze, but has much more flexibility.

But as said, I'm not yet happy with the "[religion] is muslim" style and 
need to see if that is a good standard (I know it is used in merkaartor 
already :-)

Your <item name="Muslim mosque"> could be done equally with a condition 
directly in item.

> pleasantly surprised how well it works in practice. I understand it
> would be a little more work to implement this in JOSM, but on the
> other hand if it is not implemented at all, it would just ignore the
> selector and present the user with a few more items in the group.

For a start I could restrict implementation to the changed choice/element 
style and ignore condition :-)

> c. There is a lot of repetition in the JOSM format. For example things
> like the layer combobox are repeated a lot. It would be nice if these
> could be defined only once and then just referred to in the items.
> An example could be
> 	<taglist id="roadlevel">
> 	<description text="Road elevation"/>
> 	<combo key="layer" .../>
> 	<check key="bridge" .../>
> 	<check key="tunnel" .../>
> 	</taglist>
> 	...
> 	<item name="Trunk">
> 	<include ref="roadlevel"/>
> 	...
> 	</item>

taglist is a bad name. e.g. set would be better or something else.

The problem is, that I have currently no idea how to implement that yet. I 
need to think about it. And also ask Frederik about it.

> d. Auto tags is something that seems not be supported by the JOSM format.
> For example in some bilangual regions
> the convention is that the name tag consists of the name:lang1 - name:lang2
> For mappers in those areas this is a big time waster that the editor can
> easily automate.  Supporting it could be as simple as
> allowing a computed tag value like :
> 	<key key="name" value="$[name:fr] - $[name:nl]"/>
> We could also use a different XML tag. The advantage is that tools not
> supporting this construct will not get confused.
> 	<autokey key="name" value="$[name:fr] - $[name:nl]"/>
> Please no discussion on if we want to have name tags that are constructed
> this way. In some areas (Brussels for instance I know from personal
> experience), bilangual naming is very strictly enforced where the official
> name really is the concatenation of the French and Dutch name.

I do not like to implement that, but it could be ignored on my side, so I 
have no objections. Again the questions is only the style. Maybe others 
have different opinion here and they implement it.

http://www.dstoecker.eu/ (PGP key available)

More information about the Merkaartor mailing list