Fix rendering rules

This commit is contained in:
Victor Shcherb 2011-10-18 01:56:16 +02:00
parent 44a6a749b0
commit cfd20fe776
5 changed files with 463 additions and 179 deletions

View file

@ -5,6 +5,9 @@ import java.util.Map;
public class DefaultRenderingRuleProperties {
private static final String TEXT_LENGTH = "textLength";
private static final String REF = "ref";
private static final String TEXT_SHIELD = "textShield";
private static final String SHADOW_RADIUS = "shadowRadius";
private static final String SHADOW_COLOR = "shadowColor";
private static final String SHADER = "shader";
@ -50,7 +53,7 @@ public class DefaultRenderingRuleProperties {
// order - no sense to make it float
registerRule(map, RenderingRuleProperty.createOutputIntProperty(ORDER));
registerRule(map, RenderingRuleProperty.createInputStringProperty(ORDER));
registerRule(map, RenderingRuleProperty.createInputStringProperty(ORDER_TYPE));
// text properties
registerRule(map, RenderingRuleProperty.createOutputIntProperty(TEXT_WRAP_WIDTH));
@ -59,6 +62,11 @@ public class DefaultRenderingRuleProperties {
registerRule(map, RenderingRuleProperty.createOutputIntProperty(TEXT_SIZE));
registerRule(map, RenderingRuleProperty.createOutputIntProperty(TEXT_ORDER));
registerRule(map, RenderingRuleProperty.createOutputIntProperty(TEXT_MIN_DISTANCE));
registerRule(map, RenderingRuleProperty.createOutputIntProperty(TEXT_LENGTH));
registerRule(map, RenderingRuleProperty.createOutputStringProperty(TEXT_SHIELD));
registerRule(map, RenderingRuleProperty.createOutputStringProperty(REF));
registerRule(map, RenderingRuleProperty.createOutputColorProperty(TEXT_COLOR));

View file

@ -1,6 +1,7 @@
package net.osmand.render;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@ -11,6 +12,8 @@ public class RenderingRule {
private List<RenderingRuleProperty> properties;
private int[] intProperties;
private float[] floatProperties;
private List<RenderingRule> ifElseChildren;
private List<RenderingRule> ifChildren;
private final RenderingRulesStorage storage;
@ -30,6 +33,7 @@ public class RenderingRule {
RenderingRuleProperty property = storage.getProperty(e.getKey());
if (property != null) {
properties.add(property);
if (property.isString()) {
intProperties[i] = storage.getDictionaryValue(e.getValue());
} else if (property.isFloat()) {
@ -41,9 +45,81 @@ public class RenderingRule {
} else {
intProperties[i] = property.parseIntValue(e.getValue());
}
i++;
}
i++;
}
}
private int getPropertyIndex(String property){
for (int i = 0; i < properties.size(); i++) {
RenderingRuleProperty prop = properties.get(i);
if (prop.getAttrName().equals(property)) {
return i;
}
}
return -1;
}
public String getStringPropertyValue(String property) {
int i = getPropertyIndex(property);
if(i >= 0){
return storage.getStringValue(intProperties[i]);
}
return null;
}
public float getFloatPropertyValue(String property) {
int i = getPropertyIndex(property);
if(i >= 0){
return floatProperties[i];
}
return 0;
}
public String getColorPropertyValue(String property) {
int i = getPropertyIndex(property);
if(i >= 0){
return RenderingRuleProperty.colorToString(intProperties[i]);
}
return null;
}
public int getIntPropertyValue(String property) {
int i = getPropertyIndex(property);
if(i >= 0){
return intProperties[i];
}
return -1;
}
public List<RenderingRuleProperty> getProperties() {
return properties;
}
@SuppressWarnings("unchecked")
public List<RenderingRule> getIfChildren() {
return ifChildren != null ? ifChildren : Collections.EMPTY_LIST ;
}
@SuppressWarnings("unchecked")
public List<RenderingRule> getIfElseChildren() {
return ifElseChildren != null ? ifElseChildren : Collections.EMPTY_LIST ;
}
public void addIfChildren(RenderingRule rr){
if(ifChildren == null){
ifChildren = new ArrayList<RenderingRule>();
}
ifChildren.add(rr);
}
public void addIfElseChildren(RenderingRule rr){
if(ifElseChildren == null){
ifElseChildren = new ArrayList<RenderingRule>();
}
ifElseChildren.add(rr);
}
}

View file

@ -54,6 +54,10 @@ public class RenderingRuleProperty {
return type == INT_TYPE;
}
public boolean isColor() {
return type == COLOR_TYPE;
}
public boolean isString() {
return type == STRING_TYPE;
}
@ -91,7 +95,7 @@ public class RenderingRuleProperty {
return -1;
} else if(type == COLOR_TYPE){
try {
return Integer.parseInt(value);
return parseColor(value);
} catch (RuntimeException e) {
log.error("Rendering parse " + e.getMessage());
}
@ -199,5 +203,13 @@ public class RenderingRuleProperty {
}
throw new IllegalArgumentException("Unknown color" + colorString); //$NON-NLS-1$
}
public static String colorToString(int color) {
if ((0xFF000000 & color) == 0xFF000000) {
return "#" + Integer.toHexString(color & 0x00FFFFFF); //$NON-NLS-1$
} else {
return "#" + Integer.toHexString(color); //$NON-NLS-1$
}
}
}

View file

@ -1,7 +1,10 @@
package net.osmand.render;
import gnu.trove.map.hash.TIntObjectHashMap;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
@ -13,33 +16,34 @@ import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import net.osmand.LogUtil;
import org.apache.commons.logging.Log;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
import net.osmand.LogUtil;
import net.osmand.osm.MapRenderingTypes;
import net.osmand.render.OsmandRenderingRulesParser.EffectAttributes;
import net.osmand.render.OsmandRenderingRulesParser.FilterState;
import net.osmand.render.OsmandRenderingRulesParser.RenderingRuleVisitor;
import net.osmand.render.OsmandRenderingRulesParser.SwitchState;
import net.osmand.render.OsmandRenderingRulesParser.TextAttributes;
public class RenderingRulesStorage {
private final static Log log = LogUtil.getLog(RenderingRulesStorage.class);
public final static int POINT_STATE = 1;
public final static int LINE_STATE = 2;
public final static int POLYGON_STATE = 3;
public final static int TEXT_STATE = 4;
public final static int ORDER_STATE = 5;
public final static int POINT_RULES = 1;
public final static int LINE_RULES = 2;
public final static int POLYGON_RULES = 3;
public final static int TEXT_RULES = 4;
public final static int ORDER_RULES = 5;
private final static int LENGTH_RULES = 6;
private final static int SHIFT_TAG_VAL = 16;
List<String> dictionary = new ArrayList<String>();
Map<String, Integer> dictionaryMap = new LinkedHashMap<String, Integer>();
final Map<String, RenderingRuleProperty> properties;
@SuppressWarnings("unchecked")
private TIntObjectHashMap<RenderingRule>[] tagValueGlobalRules = new TIntObjectHashMap[LENGTH_RULES];
private int bgColor = 0;
private int bgNightColor = 0;
private String renderingName;
@ -47,6 +51,8 @@ public class RenderingRulesStorage {
public RenderingRulesStorage(){
// register empty string as 0
getDictionaryValue("");
properties = DefaultRenderingRuleProperties.createDefaultRenderingRuleProperties();
}
@ -81,6 +87,10 @@ public class RenderingRulesStorage {
return bgNightColor;
}
public String getDepends() {
return depends;
}
public void parseRulesFromXmlInputStream(InputStream is) throws SAXException, IOException {
try {
@ -99,68 +109,224 @@ public class RenderingRulesStorage {
}
}
@SuppressWarnings("unchecked")
private void registerGlobalRule(RenderingRule rr, int state, Map<String, String> attrsMap) throws SAXException {
int tag = rr.getIntPropertyValue(DefaultRenderingRuleProperties.TAG);
if(tag == -1){
throw new SAXException("Attribute tag should be specified for root filter " + attrsMap.toString());
}
int value = rr.getIntPropertyValue(DefaultRenderingRuleProperties.VALUE);
if(value == -1){
throw new SAXException("Attribute tag should be specified for root filter " + attrsMap.toString());
}
int key = (tag << SHIFT_TAG_VAL) + value;
RenderingRule toInsert = rr;
RenderingRule previous = tagValueGlobalRules[state].get(key);
if(previous != null){
toInsert = new RenderingRule(Collections.EMPTY_MAP, RenderingRulesStorage.this);
toInsert.addIfElseChildren(previous);
toInsert.addIfElseChildren(rr);
}
tagValueGlobalRules[state].put(key, toInsert);
}
private class GroupRules {
Map<String, String> groupAttributes = new LinkedHashMap<String, String>();
List<RenderingRule> children = new ArrayList<RenderingRule>();
List<GroupRules> childrenGroups = new ArrayList<GroupRules>();
private void addGroupFilter(RenderingRule rr) {
for (RenderingRule ch : children) {
ch.addIfChildren(rr);
}
for(GroupRules gch : childrenGroups){
gch.addGroupFilter(rr);
}
}
public void registerGlobalRules(int state) throws SAXException {
for (RenderingRule ch : children) {
registerGlobalRule(ch, state, groupAttributes);
}
for(GroupRules gch : childrenGroups){
gch.registerGlobalRules(state);
}
}
}
private class RenderingRulesHandler extends DefaultHandler {
private final SAXParser parser;
private int state;
Stack<Object> stack = new Stack<Object>();
Map<String, String> attrsMap = new LinkedHashMap<String, String>();
public RenderingRulesHandler(SAXParser parser){
this.parser = parser;
}
@Override
public void startElement(String uri, String localName, String name, Attributes attributes) throws SAXException {
name = parser.isNamespaceAware() ? localName : name;
boolean stateChanged = false;
if("filter".equals(name)){ //$NON-NLS-1$
FilterState st = parseFilterAttributes(attributes);
stack.push(st);
attrsMap.clear();
if (stack.size() > 0 && stack.peek() instanceof GroupRules) {
GroupRules parent = ((GroupRules) stack.peek());
attrsMap.putAll(parent.groupAttributes);
}
parseAttributes(attributes, attrsMap);
RenderingRule renderingRule = new RenderingRule(attrsMap, RenderingRulesStorage.this);
if (stack.size() > 0 && stack.peek() instanceof GroupRules) {
GroupRules parent = ((GroupRules) stack.peek());
parent.children.add(renderingRule);
} else if (stack.size() > 0 && stack.peek() instanceof RenderingRule) {
RenderingRule parent = ((RenderingRule) stack.peek());
parent.addIfElseChildren(renderingRule);
} else {
registerGlobalRule(renderingRule, state, attrsMap);
}
stack.push(renderingRule);
} else if("groupFilter".equals(name)){ //$NON-NLS-1$
attrsMap.clear();
RenderingRule renderingRule = new RenderingRule(attrsMap, RenderingRulesStorage.this);
if (stack.size() > 0 && stack.peek() instanceof GroupRules) {
GroupRules parent = ((GroupRules) stack.peek());
parent.addGroupFilter(renderingRule);
} else if (stack.size() > 0 && stack.peek() instanceof RenderingRule) {
((RenderingRule) stack.peek()).addIfChildren(renderingRule);
} else {
throw new SAXException("Group filter without parent");
}
stack.push(renderingRule);
} else if("group".equals(name)){ //$NON-NLS-1$
GroupRules groupRules = new GroupRules();
if (stack.size() > 0 && stack.peek() instanceof GroupRules) {
GroupRules parent = ((GroupRules) stack.peek());
groupRules.groupAttributes.putAll(parent.groupAttributes);
parent.childrenGroups.add(groupRules);
}
parseAttributes(attributes, groupRules.groupAttributes);
stack.push(groupRules);
} else if("order".equals(name)){ //$NON-NLS-1$
state = ORDER_STATE;
state = ORDER_RULES;
stateChanged = true;
} else if("text".equals(name)){ //$NON-NLS-1$
state = TEXT_STATE;
state = TEXT_RULES;
stateChanged = true;
} else if("point".equals(name)){ //$NON-NLS-1$
state = POINT_STATE;
state = POINT_RULES;
stateChanged = true;
} else if("line".equals(name)){ //$NON-NLS-1$
state = LINE_STATE;
state = LINE_RULES;
stateChanged = true;
} else if("polygon".equals(name)){ //$NON-NLS-1$
state = POLYGON_STATE;
} else if("switch".equals(name)){ //$NON-NLS-1$
SwitchState st = new SwitchState();
stack.push(st);
} else if("case".equals(name)){ //$NON-NLS-1$
FilterState st = parseFilterAttributes(attributes);
((SwitchState)stack.peek()).filters.add(st);
} else if("renderer".equals(name)){ //$NON-NLS-1$
state = POLYGON_RULES;
stateChanged = true;
} else if("renderingStyle".equals(name)){ //$NON-NLS-1$
String dc = attributes.getValue("defaultColor");
int defaultColor = 0;
if(dc != null && dc.length() > 0){
bgColor = RenderingRuleProperty.parseColor(dc);
}
String dnc = attributes.getValue("defaultNightColor");
int defautNightColor = defaultColor;
bgNightColor = defaultColor;
if(dnc != null && dnc.length() > 0){
bgNightColor = RenderingRuleProperty.parseColor(dnc);
}
renderingName = attributes.getValue("name");
depends = attributes.getValue("depends");
} else if("renderer".equals(name)){ //$NON-NLS-1$
throw new SAXException("Rendering style is deprecated and no longer supported.");
} else {
log.warn("Unknown tag" + name); //$NON-NLS-1$
log.warn("Unknown tag : " + name); //$NON-NLS-1$
}
if(stateChanged){
tagValueGlobalRules[state] = new TIntObjectHashMap<RenderingRule>();
}
}
private Map<String, String> parseAttributes(Attributes attributes, Map<String, String> m) {
for (int i = 0; i < attributes.getLength(); i++) {
String name = parser.isNamespaceAware() ? attributes.getLocalName(i) : attributes.getQName(i);
m.put(name, attributes.getValue(i));
}
return m;
}
@Override
public void endElement(String uri, String localName, String name) throws SAXException {
name = parser.isNamespaceAware() ? localName : name;
if ("filter".equals(name)) { //$NON-NLS-1$
} else if("switch".equals(name)){ //$NON-NLS-1$
stack.pop();
} else if("group".equals(name)){ //$NON-NLS-1$
GroupRules group = (GroupRules) stack.pop();
if (stack.size() == 0) {
group.registerGlobalRules(state);
}
} else if("groupFilter".equals(name)){ //$NON-NLS-1$
stack.pop();
}
}
}
public int getTagValueKey(String tag, String value){
int itag = getDictionaryValue(tag);
int ivalue = getDictionaryValue(value);
return (itag << SHIFT_TAG_VAL) | ivalue;
}
public String getValueString(int tagValueKey){
return getStringValue(tagValueKey & ((1 << SHIFT_TAG_VAL) - 1));
}
public String getTagString(int tagValueKey){
return getStringValue(tagValueKey >> SHIFT_TAG_VAL);
}
private void printDebug(int state, PrintStream out){
for(int key : tagValueGlobalRules[state].keys()) {
RenderingRule rr = tagValueGlobalRules[state].get(key);
out.print("\n\n"+getTagString(key) + " : " + getValueString(key));
printRenderingRule("", rr, out);
}
}
private void printRenderingRule(String indent, RenderingRule rr, PrintStream out){
indent += " ";
out.print("\n"+indent);
for(RenderingRuleProperty p : rr.getProperties()){
out.print(" " + p.getAttrName() + "= ");
if(p.isString()){
out.print("\"" + rr.getStringPropertyValue(p.getAttrName()) + "\"");
} else if(p.isFloat()){
out.print(rr.getFloatPropertyValue(p.getAttrName()));
} else if(p.isColor()){
out.print(rr.getColorPropertyValue(p.getAttrName()));
} else if(p.isIntParse()){
out.print(rr.getIntPropertyValue(p.getAttrName()));
}
}
for(RenderingRule rc : rr.getIfElseChildren()){
printRenderingRule(indent, rc, out);
}
}
public static void main(String[] args) throws SAXException, IOException {
RenderingRulesStorage storage = new RenderingRulesStorage();
storage.parseRulesFromXmlInputStream(RenderingRulesStorage.class.getResourceAsStream("new_default.render.xml"));
storage.printDebug(TEXT_RULES, System.out);
}
}

View file

@ -86,7 +86,7 @@
<filter tag="aerialway" value="" order="68" />
<filter tag="power" value="" order="68" />
<filter tag="administrative" value="" order="62" />
<filter tag="waterway" order="18" />
<filter tag="waterway" value="" order="18" />
<filter tag="highway" value="motorway" order="57" />
<filter tag="highway" value="trunk" order="56" />
@ -302,16 +302,16 @@
<filter minzoom="14" maxzoom="14" textSize="12" textColor="#6666ff" textDy="7" tag="aerialway" value="station" />
<filter minzoom="15" textSize="12" textColor="#6666ff" textDy="7" tag="aerialway" value="station" />
<filter minzoom="16" maxzoom="16" textSize="13" textColor="#444444" textWrapWidth="16" textMinDistance="40" tag="building" />
<filter minzoom="17" maxzoom="17" textSize="13" textColor="#444444" textWrapWidth="16" tag="building" />
<filter minzoom="18" textSize="15" textColor="#444444" textWrapWidth="16" tag="building" />
<filter minzoom="16" maxzoom="16" textSize="13" textColor="#444444" textWrapWidth="16" textMinDistance="40" tag="building" value=""/>
<filter minzoom="17" maxzoom="17" textSize="13" textColor="#444444" textWrapWidth="16" tag="building" value=""/>
<filter minzoom="18" textSize="15" textColor="#444444" textWrapWidth="16" tag="building" value=""/>
<filter minzoom="15" textSize="12" textColor="#000033" textDy="7" textWrapWidth="12" tag="man_made" value="lighthouse" />
<filter minzoom="17" textSize="12" textColor="#734a08" textDy="7" textWrapWidth="20" tag="man_made" value="windmill" />
<filter minzoom="15" textSize="12" textColor="#0000ff" textWrapWidth="30" tag="leisure" value="marina" />
<filter minzoom="15" textSize="12" textHaloRadius="1" textWrapWidth="15" tag="leisure" />
<filter minzoom="15" textSize="12" textHaloRadius="1" textWrapWidth="15" tag="leisure" value="" />
<filter minzoom="16" textSize="12" textColor="#734a08" textDy="7" textWrapWidth="30" tag="amenity" value="fire_station" />
@ -572,7 +572,7 @@
<filter minzoom="16" icon="information" tag="tourism" value="information" />
<filter minzoom="16" icon="viewpoint" tag="tourism" value="viewpoint" />
<filter minzoom="16" icon="geocache_found" tag="geocache" value="found" />
<filter minzoom="16" icon="geocache_not_found" tag="geocache" />
<filter minzoom="16" icon="geocache_not_found" tag="geocache" value="" />
<filter minzoom="17" icon="vending_machine" tag="amenity" value="vending_machine" />
<filter minzoom="16" icon="shop_alcohol" tag="shop" value="alcohol" />
<filter minzoom="16" icon="shop_kiosk" tag="shop" value="kiosk" />
@ -662,7 +662,7 @@
<group>
<filter minzoom="12" tag="aeroway" value="aerodrome" />
<filter minzoom="12" tag="aeroway" value="airport" />
<groupFilter minzoom="10" color="#80cccccc">
<groupFilter color="#80cccccc">
<filter nightMode="true" color="#80B0B0B0"/>
</groupFilter>
</group>
@ -676,153 +676,173 @@
<filter nightMode="true" color="#B0B0B0"/>
</filter>
<!-- TODO START -->
<switch>
<case nightMode="true" color="#560000"/>
<case nightMode="false" color="#bbbbbb"/>
<filter minzoom="13">
<filter tag="power" value="station" />
<filter tag="power" value="sub_station" />
</filter>
</switch>
<group>
<filter minzoom="13" tag="power" value="station" />
<filter minzoom="13" tag="power" value="sub_station" />
<groupFilter color="#bbbbbb">
<filter nightMode="true" color="#560000"/>
</groupFilter>
</group>
<!-- natural -->
<switch>
<case nightMode="true" color="#b0004333"/>
<case nightMode="false" color="#b0b6fdb6"/>
<filter minzoom="12" tag="natural" value="park" />
</switch>
<filter minzoom="12" tag="natural" value="park" color="#b0b6fdb6">
<filter nightMode="true" color="#b0004333"/>
</filter>
<switch>
<case nightMode="true" color="#330099"/>
<case nightMode="false" color="#b5d0d0"/>
<group>
<filter minzoom="1" tag="natural" value="coastline" />
<filter minzoom="4" tag="natural" value="water" />
<filter minzoom="4" tag="natural" value="lake" />
<filter minzoom="4" tag="natural" value="bay" />
</switch>
<!-- ZM 12 -->
<filter minzoom="11" shader="beach" tag="natural" value="beach" />
<!-- ZM 10 -->
<filter minzoom="9" shader="glacier" color_2="#99ccff" strokeWidth_2="2" tag="natural" value="glacier" />
<filter nightMode="true" minzoom="9" shader="glacier" color_2="#497CAF" strokeWidth_2="2" tag="natural" value="glacier" />
<filter minzoom="12" color="#ffffc0" tag="natural" value="heath" />
<filter nightMode="true" minzoom="12" color="#004333" tag="natural" value="heath" />
<filter minzoom="10" color="#f2efe9" tag="natural" value="land" />
<filter nightMode="true" minzoom="10" color="#004333" tag="natural" value="land" />
<groupFilter color="#b5d0d0">
<filter nightMode="true" color="#330099"/>
</groupFilter>
</group>
<filter minzoom="11" tag="natural" shader="beach" value="beach"/>
<filter minzoom="9" shader="glacier" color_2="#99ccff" strokeWidth_2="2" tag="natural" value="glacier">
<filter nightMode="true" color_2="#497CAF" strokeWidth_2="2"/>
</filter>
<group>
<filter minzoom="10" color="#f2efe9" tag="natural" value="land" />
<filter minzoom="12" color="#ffffc0" tag="natural" value="heath" />
<groupFilter nightMode="true" color="#004333"/>
</group>
<filter minzoom="12" shader="marsh" tag="natural" value="marsh" />
<filter nightMode="true" minzoom="12" shader="marsh" color="#004333" tag="natural" value="marsh" />
<filter minzoom="12" shader="mud" tag="natural" value="mud" />
<filter nightMode="true" minzoom="12" color="#004333" tag="natural" value="mud" />
<filter minzoom="12" shader="scrub" tag="natural" value="scrub" />
<filter nightMode="true" minzoom="12" color="#004333" tag="natural" value="scrub" />
<filter minzoom="10" shader="marsh" tag="natural" value="wetland" />
<filter nightMode="true" minzoom="10" shader="marsh" color="#004333" tag="natural" value="wetland" />
<!-- ZM10 -->
<!-- ZM10 -->
<filter minzoom="9" color="#aed1a0" tag="natural" value="wood" />
<filter nightMode="true" minzoom="9" color="#000034" tag="natural" value="wood" />
<!-- man made -->
<filter minzoom="16" color="#bca9a9" tag="building" />
<filter nightMode="true" minzoom="16" color="#560000" tag="building" />
<filter minzoom="16" color="#dddddd" tag="building" value="garages" />
<filter nightMode="true" minzoom="16" color="#560000" tag="building" value="garages" />
<filter minzoom="16" color="#dddddd" tag="building" value="garages" >
<filter nightMode="true" color="#560000" />
</filter>
<filter minzoom="16" color="#bca9a9" tag="building" value="">
<filter nightMode="true" color="#560000"/>
</filter>
<!-- leisure -->
<switch>
<case nightMode="true" color="#560000"/>
<case nightMode="false" color="#33cc99"/>
<filter minzoom="13" tag="leisure" value="stadium">
<filter tag="leisure" value="sports_centre" />
<filter tag="leisure" value="stadium" />
</filter>
</switch>
<group>
<filter minzoom="13" tag="leisure" value="stadium" />
<filter tag="leisure" value="sports_centre" />
<groupFilter color="#33cc99">
<filter nightMode="true" color="#560000"/>
</groupFilter>
</group>
<filter minzoom="12" color="#b5e3b5" tag="leisure" value="golf_course" />
<filter nightMode="true" minzoom="12" color="#004333" tag="leisure" value="golf_course" />
<filter minzoom="12" color="#74dcba" color_2="#888888" strokeWidth_2="1" tag="leisure" value="track" />
<filter nightMode="true" minzoom="12" color="#004333" color_2="#888888" strokeWidth_2="1" tag="leisure" value="track" />
<filter minzoom="12" color="#8ad3af" color_2="#888888" strokeWidth_2="1" tag="leisure" value="pitch" />
<filter nightMode="true" minzoom="12" color="#004333" color_2="#888888" strokeWidth_2="1" tag="leisure" value="pitch" />
<!-- ZM 10 -->
<filter minzoom="9" shader="nr" color="#abdf96" tag="leisure" value="nature_reserve" />
<filter minzoom="9" nightMode="true" color="#000034" tag="leisure" value="nature_reserve" />
<group>
<filter minzoom="12" color="#b5e3b5" tag="leisure" value="golf_course" />
<filter minzoom="12" color="#74dcba" color_2="#888888" strokeWidth_2="1" tag="leisure" value="track" />
<filter minzoom="12" color="#8ad3af" color_2="#888888" strokeWidth_2="1" tag="leisure" value="pitch" />
<groupFilter nightMode="true" color="#004333" />
</group>
<switch>
<case nightMode="true" color="#b0004333"/>
<case nightMode="false" color="#b0b6fdb6"/>
<filter minzoom="12">
<filter tag="leisure" value="park" />
<filter tag="leisure" value="recreation_ground" />
</filter>
</switch>
<!-- ZM 10 -->
<filter minzoom="9" shader="nr" color="#abdf96" tag="leisure" value="nature_reserve">
<filter nightMode="true" shader="" color="#000034">
</filter>
<filter minzoom="15" color="#ccfff1" tag="leisure" value="playground" />
<filter minzoom="15" nightMode="true" color="#004333" tag="leisure" value="playground" />
<filter minzoom="12" color="#cfeca8" tag="leisure" value="garden" />
<filter minzoom="12" nightMode="true" color="#004333" tag="leisure" value="garden" />
<filter minzoom="12" color="#cfeca8" tag="leisure" value="common" />
<filter minzoom="12" nightMode="true" color="#004333" tag="leisure" value="common" />
<group>
<filter minzoom="12" tag="leisure" value="park" />
<filter minzoom="12" tag="leisure" value="recreation_ground" />
<groupFilter color="#b0b6fdb6">
<filter nightMode="true" color="#b0004333"/>
</groupFilter>
</group>
<group>
<filter minzoom="15" color="#ccfff1" tag="leisure" value="playground" />
<filter minzoom="12" color="#cfeca8" tag="leisure" value="garden" />
<filter minzoom="12" color="#cfeca8" tag="leisure" value="common" />
<groupFilter nightMode="true" color="#004333" />
</group>
<!-- amenity -->
<filter minzoom="15" color="#f0f0d8" color_2="#d4a89e" strokeWidth_2="1" tag="amenity" value="kindergarten" />
<filter minzoom="15" nightMode="true" color="#66004B" color_2="#d4a89e" strokeWidth_2="1" tag="amenity" value="kindergarten" />
<filter minzoom="15" color="#f0f0d8" color_2="#d4a89e" strokeWidth_2="1" tag="amenity" value="school" />
<filter minzoom="15" nightMode="true" color="#66004B" color_2="#d4a89e" strokeWidth_2="1" tag="amenity" value="school" />
<filter minzoom="15" color="#f0f0d8" color_2="#d4a89e" strokeWidth_2="1" tag="amenity" value="college" />
<filter minzoom="15" nightMode="true" color="#66004B" color_2="#d4a89e" strokeWidth_2="1" tag="amenity" value="college" />
<filter minzoom="16" color="#bca9a9" tag="amenity" value="library" />
<filter minzoom="16" nightMode="true" color="#560000" tag="amenity" value="library" />
<filter minzoom="15" color="#f0f0d8" color_2="#d4a89e" strokeWidth_2="1" tag="amenity" value="university" />
<filter minzoom="15" nightMode="true" color="#66004B" color_2="#d4a89e" strokeWidth_2="1" tag="amenity" value="university" />
<filter minzoom="15" color="#f6eeb7" tag="amenity" value="parking" />
<filter minzoom="15" nightMode="true" color="#66004B" tag="amenity" value="parking" />
<filter minzoom="15" color="#f6eeb7" tag="amenity" value="bicycle_parking" />
<filter minzoom="15" nightMode="true" color="#66004B" tag="amenity" value="bicycle_parking" />
<filter minzoom="15" color="#f0f0d8" color_2="#d4a89e" strokeWidth_2="1" tag="amenity" value="hospital" />
<filter minzoom="15" nightMode="true" color="#560000" color_2="#d4a89e" strokeWidth_2="1" tag="amenity" value="hospital" />
<filter minzoom="15" color="#cc9999" tag="amenity" value="cinema" />
<filter minzoom="15" nightMode="true" color="#560000" tag="amenity" value="cinema" />
<group>
<filter minzoom="15" color="#f0f0d8" color_2="#d4a89e" strokeWidth_2="1" tag="amenity" value="kindergarten" />
<filter minzoom="15" color="#f0f0d8" color_2="#d4a89e" strokeWidth_2="1" tag="amenity" value="school" />
<filter minzoom="15" color="#f0f0d8" color_2="#d4a89e" strokeWidth_2="1" tag="amenity" value="college" />
<filter minzoom="15" color="#f0f0d8" color_2="#d4a89e" strokeWidth_2="1" tag="amenity" value="university" />
<filter minzoom="15" color="#f6eeb7" tag="amenity" value="bicycle_parking" />
<filter minzoom="15" color="#f6eeb7" tag="amenity" value="parking" />
<groupFilter nightMode="true" color="#66004B" />
</group>
<group>
<filter minzoom="16" color="#bca9a9" tag="amenity" value="library" />
<filter minzoom="15" color="#f0f0d8" color_2="#d4a89e" strokeWidth_2="1" tag="amenity" value="hospital" />
<filter minzoom="15" color="#cc9999" tag="amenity" value="cinema" />
<groupFilter nightMode="true" color="#66004B" />
</group>
<!-- tourism -->
<filter minzoom="13" color="#f2caea" tag="tourism" value="attraction" />
<filter minzoom="13" nightMode="true" color="#66004B" tag="tourism" value="attraction" />
<filter minzoom="13" color="#a0ccff99" tag="tourism" value="camp_site" />
<filter minzoom="13" nightMode="true" color="#a0004333" tag="tourism" value="camp_site" />
<filter minzoom="13" color="#a0ccff99" tag="tourism" value="caravan_site" />
<filter minzoom="13" nightMode="true" color="#a0004333" tag="tourism" value="caravan_site" />
<filter minzoom="13" color="#a0ccff99" tag="tourism" value="picnic_site" />
<filter minzoom="13" nightMode="true" color="#a0004333" tag="tourism" value="picnic_site" />
<filter minzoom="12" maxzoom="15" color="#f2caea" color_2="#734a08" strokeWidth_2="1" pathEffect_2="9_3" tag="tourism" value="theme_park" />
<filter minzoom="12" maxzoom="15" nightMode="true" color="#66004B" color_2="#734a08" strokeWidth_2="1" pathEffect_2="9_3" tag="tourism" value="theme_park" />
<filter minzoom="16" color="#f2caea" color_2="#734a08" strokeWidth_2="2" pathEffect_2="9_3" tag="tourism" value="theme_park" />
<filter minzoom="16" nightMode="true" color="#66004B" color_2="#734a08" strokeWidth_2="2" pathEffect_2="9_3" tag="tourism" value="theme_park" />
<filter minzoom="12" shader="zoo" tag="tourism" value="zoo" />
<filter minzoom="12" nightMode="true" color="#66004B" color_2="#734a08" strokeWidth_2="2" pathEffect_2="9_3" tag="tourism" value="zoo" />
<filter minzoom="13" color="#f2caea" tag="tourism" value="attraction">
<filter nightMode="true" color="#66004B"/>
</filter>
<filter minzoom="12" maxzoom="15" color="#f2caea" color_2="#734a08" strokeWidth_2="1" pathEffect_2="9_3" tag="tourism" value="theme_park">
<filter nightMode="true" color="#66004B"/>
</filter>
<filter minzoom="16" color="#f2caea" color_2="#734a08" strokeWidth_2="2" pathEffect_2="9_3" tag="tourism" value="theme_park">
<filter nightMode="true" color="#66004B"/>
</filter>
<filter minzoom="12" shader="zoo" tag="tourism" value="zoo">
<filter nightMode="true" color="#66004B"/>
</filter>
<filter minzoom="13" color="#a0ccff99" tag="tourism" value="camp_site">
<filter nightMode="true" color="#a0004333"/>
</filter>
<filter minzoom="13" color="#a0ccff99" tag="tourism" value="caravan_site">
<filter nightMode="true" color="#a0004333"/>
</filter>
<filter minzoom="13" color="#a0ccff99" tag="tourism" value="picnic_site" >
<filter nightMode="true" color="#a0004333"/>
</filter>
<!-- military -->
<filter minzoom="12" color="#ff8f8f" tag="military" value="barracks" />
<filter minzoom="12" nightMode="true" color="#560000" tag="military" value="barracks" />
<filter minzoom="12" color="#ff8f8f" tag="military" value="barracks">
<filter nightMode="true" color="#560000"/>
</filter>
<filter minzoom="10" shader="danger" tag="military" value="danger_area" />
<!-- landuse -->
<filter minzoom="10" color="#c8b084" tag="landuse" value="allotments" />
<filter minzoom="10" nightMode="true" color="#66004B" tag="landuse" value="allotments" />
<filter minzoom="10" color="#b5d0d0" tag="landuse" value="basin" />
<filter minzoom="10" nightMode="true" color="#330099" tag="landuse" value="basin" />
<filter minzoom="10" color="#c8b084" tag="landuse" value="allotments">
<filter nightMode="true" color="#66004B"/>
</filter>
<filter minzoom="10" color="#b5d0d0" tag="landuse" value="basin">
<filter nightMode="true" color="#330099"/>
</filter>
<!-- ZM 10 -->
<filter minzoom="9" maxzoom="12" color="#8dc56c" tag="landuse" value="forest">
<filter nightMode="true" color="#000034" />
</filter>
<filter minzoom="13" shader="forest" color="#8dc56c" tag="landuse" value="forest">
<filter nightMode="true" color="#000034" shader=""/>
</filter>
<!-- ZM 10 -->
<filter minzoom="9" maxzoom="12" color="#8dc56c" tag="landuse" value="forest" />
<filter minzoom="9" maxzoom="12" nightMode="true" color="#000034" tag="landuse" value="forest" />
<filter minzoom="13" shader="forest" color="#8dc56c" tag="landuse" value="forest" />
<filter minzoom="13" nightMode="true" color="#000034" tag="landuse" value="forest" />
<!-- ZM 12 -->
<filter minzoom="14" color="#dfd1d6" tag="landuse" value="garages" />
<filter minzoom="14" nightMode="true" color="#560000" tag="landuse" value="garages" />
<!-- TODO END -->
<group tag="landuse" value="garages">
<filter minzoom="12" hmRendered="true" color="#dfd1d6" />
<filter minzoom="14" color="#dfd1d6" />
<groupFilter nightMode="true" color="#560000" />
</group>
<group>
<filter minzoom="12" color="#ead8bd" tag="landuse" value="farm" />
<filter minzoom="12" color="#ead8bd" tag="landuse" value="farmland" />
@ -842,7 +862,7 @@
</group>
<group>
<filter minzoom="10" hmRendered="true" color="#dfd1d6" tag="landuse" value="industrial"/ >
<filter minzoom="10" hmRendered="true" color="#dfd1d6" tag="landuse" value="industrial" />
<filter minzoom="11" color="#dfd1d6" tag="landuse" value="industrial"/>
<filter minzoom="12" color="#dfd1d6" tag="landuse" value="railway" />
<filter minzoom="12" color="#9d9d6c" tag="landuse" value="landfill" />
@ -881,7 +901,7 @@
<filter hmRendered="true">
<filter minzoom="10" color="#aed1a0" />
</filter>
<filter minzoom="9" color="#aed1a0" >
<filter minzoom="9" color="#aed1a0" />
<groupFilter nightMode="true" color="#000034"/>
</filter>
@ -956,7 +976,7 @@
</groupFilter>
</group>
<!-- TODO START -->
<!-- TODO START ->
<group>
<filter tag="highway" value="tertiary" maxzoom="13" />
<filter tag="highway" value="tertiary_link" maxzoom="13" />
@ -967,17 +987,17 @@
<filter minzoom="13" maxzoom="13" strokeWidth="6" />
<switch>
<case layer="-1" pathEffect="4_4" />
<case /> <!-- all other cases -->
<case /> <!- all other cases ->
<filter>
<filter minzoom="14" maxzoom="14" strokeWidth="6" />
<filter minzoom="15" maxzoom="15" strokeWidth="8" />
<filter minzoom="16" maxzoom="16" strokeWidth="10" />
<!-- radius 0 to avoid showing many black lines, but removed again due to bad visibility on some backgrounds -->
<!- radius 0 to avoid showing many black lines, but removed again due to bad visibility on some backgrounds ->
<filter minzoom="17" maxzoom="17" strokeWidth="13" />
<filter minzoom="18" strokeWidth="18" />
</filter>
</switch>
<!-- bridge -->
<!- bridge ->
<switch>
<case nightMode="false" color="#000000" />
<case nightMode="true" color="#ffffff" />
@ -1001,23 +1021,23 @@
<case nightMode="true" color="#9F9F9F" color_2="#9F9F9F" shadowColor="#666666" shadowRadius="1" />
<case nightMode="false" color="#ffffff" color_2="#ffffff" shadowColor="#464646" shadowRadius="1" />
<filter>
<!-- ZM <filter minzoom="12" maxzoom="12" strokeWidth="3" /> -->
<!- ZM <filter minzoom="12" maxzoom="12" strokeWidth="3" /> ->
<filter minzoom="13" maxzoom="13" strokeWidth="4" />
<switch>
<case layer="-1" pathEffect="4_4" />
<case /> <!-- all other cases -->
<case /> <!- all other cases ->
<filter>
<filter minzoom="14" maxzoom="14" strokeWidth="6" />
<filter minzoom="15" maxzoom="15" strokeWidth="8" />
<filter minzoom="16" maxzoom="16" strokeWidth="10" />
<!-- radius 0 to avoid showing many black lines, but removed again due to bad visibility on some backgrounds -->
<!- radius 0 to avoid showing many black lines, but removed again due to bad visibility on some backgrounds ->
<filter minzoom="17" maxzoom="17" strokeWidth="13" />
<filter minzoom="18" strokeWidth="18" />
</filter>
</switch>
</filter>
</switch>
<!-- bridge -->
<!- bridge ->
<switch>
<case nightMode="false" color="#000000" color_2="#ffffff" shadowColor="#464646" />
<case nightMode="true" color="#ffffff" color_2="#9F9F9F" shadowColor="#666666" />
@ -1041,10 +1061,10 @@
<case layer="-1" pathEffect="4_4" />
<case layer="1" nightMode="false" cap_2="SQUARE" color="#000000" />
<case layer="1" nightMode="true" cap_2="SQUARE" color="#000000" />
<case /> <!-- all other cases -->
<case /> <!- all other cases ->
<filter>
<!-- ZM <filter minzoom="13" maxzoom="13" strokeWidth="2" />
<filter minzoom="14" maxzoom="14" strokeWidth="3" />-->
<!- ZM <filter minzoom="13" maxzoom="13" strokeWidth="2" />
<filter minzoom="14" maxzoom="14" strokeWidth="3" /> ->
<object minzoom="15" maxzoom="15" strokeWidth="4">
<object layer="1" cap_2="SQUARE" strokeWidth="6" strokeWidth_2="4" />
</object>
@ -1053,11 +1073,11 @@
<filter minzoom="18" strokeWidth="12"/>
</filter>
</switch>
<!-- bridge -->
<!- bridge ->
<switch>
<filter layer="1" cap_2="SQUARE">
<!--ZM <filter minzoom="13" maxzoom="14" strokeWidth="5" strokeWidth_2="3" /> -->
<!- ZM <filter minzoom="13" maxzoom="14" strokeWidth="5" strokeWidth_2="3" /> ->
<filter minzoom="16" maxzoom="16" strokeWidth="7" strokeWidth_2="5" />
<filter minzoom="17" maxzoom="17" strokeWidth="10" strokeWidth_2="8" />
@ -1066,7 +1086,7 @@
</switch>
</filter>
</switch>
<!-- TODO END -->
<!- TODO END -->
<filter tag="highway" value="cycleway">
<filter layer="1" minzoom="14" maxzoom="15" color="#0000ff" strokeWidth="1" pathEffect="2_2" />
@ -1082,7 +1102,7 @@
<filter minzoom="12" color="#ffcc00" strokeWidth="1" pathEffect="4_3" />
</filter>
<filter pathEffect="6_3" tag="highway" value="path" color="#000000"/>
<filter pathEffect="6_3" tag="highway" value="path" color="#000000">
<filter minzoom="12" maxzoom="12" hmRendered="true" strokeWidth="0.5" />
<filter minzoom="13" strokeWidth="1"/>
<groupFilter nightMode="true" color="#787878"/>
@ -1103,10 +1123,12 @@
</filter>
<filter layer="1" minzoom="14" maxzoom="14" color="#00ff00" strokeWidth="1" pathEffect="2_2" tag="highway" value="bridleway" />
<filter layer="1" minzoom="15" color="#88ffffff" strokeWidth="2" color_2="#00ff00" strokeWidth_2="2" pathEffect_2="2_2" tag="highway" value="bridleway" />
<filter minzoom="12" maxzoom="12" hmRendered="true" color="#00ff00" strokeWidth="0.5" pathEffect="2_2" tag="highway" value="bridleway" />
<filter minzoom="13" color="#00ff00" strokeWidth="1" pathEffect="2_2" tag="highway" value="bridleway" />
<filter tag="highway" value="bridleway">
<filter layer="1" minzoom="14" maxzoom="14" color="#00ff00" strokeWidth="1" pathEffect="2_2" />
<filter layer="1" minzoom="15" color="#88ffffff" strokeWidth="2" color_2="#00ff00" strokeWidth_2="2" pathEffect_2="2_2" />
<filter minzoom="12" maxzoom="12" hmRendered="true" color="#00ff00" strokeWidth="0.5" pathEffect="2_2" />
<filter minzoom="13" color="#00ff00" strokeWidth="1" pathEffect="2_2" />
</filter>
@ -1286,7 +1308,7 @@
<filter minzoom="12" maxzoom="13" color="#aaaaaa" strokeWidth="1" />
<filter minzoom="14" maxzoom="15" color="#aaaaaa" strokeWidth="2" />
<filter minzoom="16" color="#aaaaaa" strokeWidth="4" />
</<groupFilter>>
</groupFilter>
</group>
<filter minzoom="12" maxzoom="13" color="#f2efe9" strokeWidth="1" tag="man_made" value="pier" />