def to_css(self): css = "" for symbol in self.symbols: symbolclass = utils.symbolclass_from_symbolnode(symbol) if symbolclass: css += symbolclass.to_css("*") return css
def classifier_to_css(self, classifier): selector = self.classifier_conditions_to_css(classifier) symbol = classifier[0] symbolclass = utils.symbolclass_from_symbolnode(symbol) css = "/* CLASSIFIER INFO {0} */\n".format(str(classifier.attrib)) if symbolclass: css += symbolclass.to_css(selector) return css + "\n"
def to_sld(self): feature_type_style = ET.Element("FeatureTypeStyle") for symbol in self.symbols: rule = ET.SubElement(feature_type_style, "Rule") symbolclass = utils.symbolclass_from_symbolnode(symbol) if symbolclass: symbolizer = symbolclass.to_sld() rule.append(symbolizer) return feature_type_style
def classifier_to_sld(self, classifier): rule = ET.Element("Rule") fltr = self.classifier_conditions_to_sld(classifier) if fltr: rule.append(fltr) symbolclass = utils.symbolclass_from_symbolnode(classifier[0]) #css = "/* CLASSIFIER INFO {0} */\n".format(str(classifier.attrib)) if symbolclass: symbolizer = symbolclass.to_sld() rule.append(symbolizer) return rule