Hello guys.

   I'm new to this list and now just starting explore Osmosis' great
powers, so please help me understand what's going on here.
   What I want to archive is process Greece's Crete island OSM data
applying the following logic on the way:
1) If a node has "name:en" tag, put its value into "name" tag,
overwriting whatever the latter contains. If not, then...
2) If a node has "name:el" tag AND doesn't already have "name" tag,
put its value into "name" tag, overwriting whatever the latter
contains. If not, then...
3) If a node has "int_name" tag AND doesn't already have "name" tag,
put its value into "name" tag, overwriting whatever the latter
contains. If not, then...
4) If a node has "name:ru" tag AND doesn't already have "name" tag,
put its value into "name" tag, overwriting whatever the latter
contains. Stop.
  In other words, I have a prioritized list of names (from most
important to lesser ones):
name:en, name:el, int_name, name:ru
   (and so on; the sequence can be changed later as my demands change).
   So, I have these rules for translations:

<?xml version="1.0" encoding="UTF-8"?>
<translations>

<translation>
 <name>Crete -- name:en - name</name>
 <match mode="and">
  <tag k="name:en" v=".+" match_id="myname"/>
  <!--<notag k="name" value=".+"/>-->
 </match>
 <output>
  <copy-all/>
  <tag k="name" from_match="myname" v="{0}"/>
 </output>
</translation>

<translation>
 <name>Crete -- name:el - name</name>
 <match mode="and">
  <tag k="name:el" v=".+" match_id="myname"/>
  <notag k="name" value=".+"/>
 </match>
 <output>
  <copy-all/>
  <tag k="name" from_match="myname" v="{0}"/>
 </output>
</translation>

<translation>
 <name>Crete -- int_name - name</name>
 <match mode="and">
  <tag k="int_name" v=".+" match_id="myname"/>
  <notag k="name" value=".+"/>
 </match>
 <output>
  <copy-all/>
  <tag k="name" from_match="myname" v="{0}"/>
 </output>
</translation>

<translation>
 <name>Crete -- name:ru - name</name>
 <match mode="and">
  <tag k="name:ru" v=".+" match_id="myname"/>
  <notag k="name" value=".*"/>
 </match>
 <output>
  <copy-all/>
  <tag k="name" from_match="myname" v="{0}"/>
 </output>
</translation>

</translations>

   As you can see:
1) First rule have "notag" commented out since I write "name:en" value
into "name" tag unconditionally.
2) All subsequent rules contain "notag" condition.
   And this is my question. Do I understand correctly that the whole
<match mode="and"> fails if a node contains "name" tag? I have
different results here and all <output>s still fire even when "name"
tags exist. I need an opposite behaviour.
   I have searched through official Osmosis wiki docs and examples and
also had general internet search and found some "notag" examples which
suppose to be working, but still my case fails me here... Please lead
me by this road.

_______________________________________________
osmosis-dev mailing list
osmosis-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/osmosis-dev

Reply via email to