예제 #1
0
 def __init__(self, color=None, size=6, type='circle', opacity=1.0, rotation=0):
   Symbolizer.__init__(self)
   self.color = Color(color) if color else None
   self.size = Expression(size)
   self.type = type
   self.opacity = Expression(opacity)
   self.rotation = Expression(rotation)
   self._stroke = None
예제 #2
0
파일: label.py 프로젝트: ecor/geoscript-py
 def _pointPlacement(self, anchor, displace, rotate):
     f = self.factory
     ap = f.createAnchorPoint(
         Expression(anchor[0]).expr,
         Expression(anchor[1]).expr)
     dp = f.createDisplacement(
         Expression(displace[0]).expr,
         Expression(displace[1]).expr)
     return f.createPointPlacement(ap, dp, Expression(rotate).expr)
예제 #3
0
    def _colormap(self):
        f = self.factory
        map = f.createColorMap()
        map.setType(_type[self.interpolate])

        for v in self.values:
            entry = f.createColorMapEntry()
            entry.setQuantity(Expression(v[0]).expr)

            col = Color(v[1])
            entry.setColor(col.expr)
            entry.setOpacity(Expression(col._color.alpha / 255.0).expr)

            map.addColorMapEntry(entry)

        return map
예제 #4
0
 def __init__(self,
              color='#000000',
              width=1,
              dash=None,
              cap=None,
              join=None,
              opacity=1.0):
     Symbolizer.__init__(self)
     self.color = Color(color)
     self.width = Expression(width)
     self.opacity = Expression(opacity)
     self.dash = dash
     self.cap = Expression(cap) if cap else None
     self.join = Expression(join) if join else None
     self._hatch = None
     self._icon = None
예제 #5
0
파일: icon.py 프로젝트: ecor/geoscript-py
    def __init__(self, url, format=None, size=None):
        Symbolizer.__init__(self)
        self.url = toURL(url)

        if not format:
            format = mimetypes.guess_type(url)[0]

        self.format = format
        self.size = Expression(size) if size else None
예제 #6
0
 def __init__(self, fill=None, radius=1):
   Symbolizer.__init__(self)
   if fill:
     if not isinstance(fill, Fill):
       fill = Fill(Color(fill))
   else:
     fill = Fill('#ffffff')
   self.fill = fill
   self.radius = Expression(radius)
예제 #7
0
파일: hatch.py 프로젝트: ecor/geoscript-py
    def __init__(self, name, stroke=None, size=None):
        Symbolizer.__init__(self)
        self.name = name
        if not stroke:
            from geoscript.style.stroke import Stroke
            stroke = Stroke()

        self.stroke = stroke
        self.size = Expression(size if size else 8)
예제 #8
0
파일: label.py 프로젝트: ecor/geoscript-py
    def line(self,
             offset=0,
             gap=None,
             igap=None,
             align=False,
             follow=False,
             group=False,
             displace=None,
             repeat=None):
        """
    Sets the label placement relative to a line. 

    The ``offset`` argument specifies the perpindicular distance from the line at
    which to position the label. 

    The ``align`` argument specifies whether to align the label along the line. The
    ``follow`` argument specifies whether to curve the label in order to force it
    to follow the line. 
    
    >>> label = Label('foo').linear(align=True, follow=True)
    """
        f = self.factory
        lp = f.createLinePlacement(Expression(offset).expr)
        lp.setAligned(align)
        #lp.setRepeated(repeat)
        if gap:
            lp.setGap(Expression(gap).expr)
        if igap:
            lp.setInitialGap(Expression(igap).expr)
        self._placement = lp

        self.options['followLine'] = follow
        self.options['group'] = group
        if displace:
            self.options['maxDisplacement'] = displace
        if repeat:
            self.options['repeat'] = repeat
        return self
예제 #9
0
 def __init__(self, value=1.0):
     Symbolizer.__init__(self)
     self.value = Expression(value)
예제 #10
0
 def __init__(self, color=None, opacity=1.0):
     Symbolizer.__init__(self)
     self.color = Color(color) if color else None
     self.opacity = Expression(opacity)
     self._icon = None
     self._hatch = None