コード例 #1
0
 def to_css(self):
   css = ""
   for symbol in self.symbols:
     symbolclass = utils.symbolclass_from_symbolnode(symbol)
     if symbolclass:
       css += symbolclass.to_css("*")
   return css
コード例 #2
0
 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"
コード例 #3
0
 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
コード例 #4
0
  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