Index: src/uk/me/parabola/mkgmap/osmstyle/SequenceRule.java =================================================================== --- src/uk/me/parabola/mkgmap/osmstyle/SequenceRule.java (revision 339) +++ src/uk/me/parabola/mkgmap/osmstyle/SequenceRule.java (working copy) @@ -42,6 +42,11 @@ } return null; } + + public List resolveTypes(Element el) + { + return null; + } /** * Add a rule to this sequence. We do a quick check for impossible Index: src/uk/me/parabola/mkgmap/osmstyle/ActionRule.java =================================================================== --- src/uk/me/parabola/mkgmap/osmstyle/ActionRule.java (revision 339) +++ src/uk/me/parabola/mkgmap/osmstyle/ActionRule.java (working copy) @@ -61,6 +61,11 @@ } return null; } + + public List resolveTypes(Element el) + { + return null; + } public String toString() { StringBuilder fmt = new StringBuilder(); Index: src/uk/me/parabola/mkgmap/osmstyle/RuleSet.java =================================================================== --- src/uk/me/parabola/mkgmap/osmstyle/RuleSet.java (revision 339) +++ src/uk/me/parabola/mkgmap/osmstyle/RuleSet.java (working copy) @@ -18,8 +18,10 @@ import java.util.Formatter; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; import java.util.Set; +import java.util.Vector; import uk.me.parabola.mkgmap.reader.osm.Element; import uk.me.parabola.mkgmap.reader.osm.GType; @@ -79,6 +81,36 @@ return foundType; } + public List resolveTypes(Element el) { + List foundTypes = null; + for (String tagKeys : el) { + + String keyValue[] = tagKeys.split("="); + + if(keyValue != null && keyValue.length > 1 && keyValue[1] != null) + { + String values[] = keyValue[1].split(";"); + + for(int i = 0; i < values.length ;i++) + { + String tagKey = keyValue[0].concat("=").concat(values[i]); + + Rule rule = rules.get(tagKey); + if (rule != null) { + GType type = rule.resolveType(el); + if(type != null) + { + if(foundTypes == null) + foundTypes = new Vector(); + foundTypes.add(type); + } + } + } + } + } + return foundTypes; + } + public void addAll(RuleSet rs) { for (Map.Entry ent : rs.entrySet()) add(ent.getKey(), ent.getValue()); Index: src/uk/me/parabola/mkgmap/osmstyle/FixedRule.java =================================================================== --- src/uk/me/parabola/mkgmap/osmstyle/FixedRule.java (revision 339) +++ src/uk/me/parabola/mkgmap/osmstyle/FixedRule.java (working copy) @@ -16,6 +16,8 @@ */ package uk.me.parabola.mkgmap.osmstyle; +import java.util.List; + import uk.me.parabola.mkgmap.reader.osm.Element; import uk.me.parabola.mkgmap.reader.osm.GType; import uk.me.parabola.mkgmap.reader.osm.Rule; @@ -35,6 +37,11 @@ public GType resolveType(Element el) { return gtype; } + + public List resolveTypes(Element el) + { + return null; + } public String toString() { return gtype.toString(); Index: src/uk/me/parabola/mkgmap/osmstyle/ExpressionRule.java =================================================================== --- src/uk/me/parabola/mkgmap/osmstyle/ExpressionRule.java (revision 339) +++ src/uk/me/parabola/mkgmap/osmstyle/ExpressionRule.java (working copy) @@ -16,6 +16,8 @@ */ package uk.me.parabola.mkgmap.osmstyle; +import java.util.List; + import uk.me.parabola.mkgmap.osmstyle.eval.Op; import uk.me.parabola.mkgmap.reader.osm.Element; import uk.me.parabola.mkgmap.reader.osm.GType; @@ -42,6 +44,11 @@ return null; } + + public List resolveTypes(Element el) + { + return null; + } public String toString() { return exression.toString() + ' ' + gtype; Index: src/uk/me/parabola/mkgmap/osmstyle/StyledConverter.java =================================================================== --- src/uk/me/parabola/mkgmap/osmstyle/StyledConverter.java (revision 339) +++ src/uk/me/parabola/mkgmap/osmstyle/StyledConverter.java (working copy) @@ -179,21 +179,25 @@ public void convertNode(Node node) { preConvertRules(node); - GType foundType = nodeRules.resolveType(node); - if (foundType == null) + List foundTypes = nodeRules.resolveTypes(node); + if (foundTypes == null) return; + + for(int i=0; i < foundTypes.size(); i++) + { + GType foundType = foundTypes.get(i); + + // If the node does not have a name, then set the name from this + // type rule. + log.debug("node name", node.getName()); + if (node.getName() == null) { + node.setName(foundType.getDefaultName()); + log.debug("after set", node.getName()); + } - // If the node does not have a name, then set the name from this - // type rule. - log.debug("node name", node.getName()); - if (node.getName() == null) { - node.setName(foundType.getDefaultName()); - log.debug("after set", node.getName()); + postConvertRules(node, foundType); + addPoint(node, foundType); } - - postConvertRules(node, foundType); - - addPoint(node, foundType); } /** Index: src/uk/me/parabola/mkgmap/reader/osm/Rule.java =================================================================== --- src/uk/me/parabola/mkgmap/reader/osm/Rule.java (revision 339) +++ src/uk/me/parabola/mkgmap/reader/osm/Rule.java (working copy) @@ -16,6 +16,8 @@ */ package uk.me.parabola.mkgmap.reader.osm; +import java.util.List; + /** * A rule takes an element and returns the correct garmin type for it. * Immplementations can be simple or complex as needed. @@ -32,4 +34,5 @@ * @return Enough information to represent this as a garmin type. */ public GType resolveType(Element el); + public List resolveTypes(Element el); }