Hi,
Here's a patch to fix the not-contained filter with 'mkgmap:' prefixed tags
(e.g. mkgmap:us_interstate as used in relations of the default style ). The
current implementation produces duplicate Interstates and US highways when
a way is part of multiple relations.
Feedback is welcome.
Thanks, Ben
diff --git a/src/uk/me/parabola/mkgmap/osmstyle/actions/NotContainedFilter.java b/src/uk/me/parabola/mkgmap/osmstyle/actions/NotContainedFilter.java
index cd4e88e5..ca43e017 100644
--- a/src/uk/me/parabola/mkgmap/osmstyle/actions/NotContainedFilter.java
+++ b/src/uk/me/parabola/mkgmap/osmstyle/actions/NotContainedFilter.java
@@ -11,6 +11,7 @@
*/
package uk.me.parabola.mkgmap.osmstyle.actions;
+import java.util.Arrays;
import java.util.regex.Pattern;
import uk.me.parabola.mkgmap.reader.osm.Element;
@@ -57,7 +58,8 @@ public class NotContainedFilter extends ValueFilter {
else
quotedSeparator = Pattern.quote(";");
// set the tag short value
- tagKey = TagDict.getInstance().xlate(temp[1]);
+ String tag = String.join(":", Arrays.copyOfRange(temp, 1, temp.length));
+ tagKey = TagDict.getInstance().xlate(tag);
}
public String doFilter(String value, Element el) {
diff --git a/test/uk/me/parabola/mkgmap/osmstyle/actions/NotContainedFilterTest.java b/test/uk/me/parabola/mkgmap/osmstyle/actions/NotContainedFilterTest.java
index aaf98bd9..b468a00c 100644
--- a/test/uk/me/parabola/mkgmap/osmstyle/actions/NotContainedFilterTest.java
+++ b/test/uk/me/parabola/mkgmap/osmstyle/actions/NotContainedFilterTest.java
@@ -49,6 +49,15 @@ public class NotContainedFilterTest {
assertNull(s);
}
+ @Test
+ public void test2ndArgContainedColonInTag() {
+ NotContainedFilter filter = new NotContainedFilter(":mkgmap:ref");
+ Element el = new Way(1);
+ el.addTag("mkgmap:ref", "x;y;z");
+ String s = filter.doFilter("x", el);
+ assertNull(s);
+ }
+
@Test
public void testNonDefaultDelimiterNotContained() {
NotContainedFilter filter = new NotContainedFilter("#:ref");
_______________________________________________
mkgmap-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo/%(_internal_name)s