Interface Symbolizer

  • All Known Subinterfaces:
    ExtensionSymbolizer, LineSymbolizer, PointSymbolizer, PolygonSymbolizer, RasterSymbolizer, TextSymbolizer
    All Known Implementing Classes:
    AbstractSymbolizer, LineSymbolizerImpl, PointSymbolizerImpl, PolygonSymbolizerImpl, RasterSymbolizerImpl, TextSymbolizerImpl, VendorSymbolizerImpl

    public interface Symbolizer
    Abstract superclass of the symbolizers defined by the Symbology Encoding specification.

    Please note you are not free to create your own subtype o Symbolizer - we are limited to LineSymbolizer, PointSymbolizer, PolygonSymbolizer, RasterSymbolizer and TextSymbolizer.

    Geometry types other than inherently linear types can also be used. If a point geometry is used, it should be interpreted as a line of "epsilon" (arbitrarily small) length with a horizontal orientation centered on the point, and should be rendered with two end caps. If a polygon is used (or other "area" type), then its closed outline is used as the line string (with no end caps). If a raster geometry is used, its coverage-area outline is used for the line, rendered with no end caps.

    Since:
    GeoAPI 2.2
    Author:
    Open Geospatial Consortium, Johann Sorel (Geomatys), Chris Dillard (SYS Technologies)
    • Method Detail

      • getUnitOfMeasure

        Unit<Length> getUnitOfMeasure()
        Returns a measure unit. This parameter is inherited from GML. Renderers shall use the unit to correctly render symbols.

        Recommended uom definitions are :

        • metre
        • foot
        • pixel

        Returns:
        can be null. If the unit is null than we shall use a the pixel unit
      • setDescription

        void setDescription​(Description description)
        Tile and Abstract of Symbolzer.
        Since:
        SymbologyEncoding 1.1
      • setName

        void setName​(String name)
        Name of symbolizer; not always human readable.

        Please consider getDescription().getTitle() as an alternative if presenting this symbolizer in a user interface.

        Since:
        SymbologyEncoding 1.1
      • getGeometryPropertyName

        String getGeometryPropertyName()
        Returns the name of the geometry feature attribute to use for drawing. May return null (or Expression.NIL) if this symbol is to use the default geometry attribute, whatever it may be. Using null in this fashion is similar to a PropertyName using the XPath expression ".".

        The content of the element gives the property name in XPath syntax. In principle, a fixed geometry could be defined using GML or operators could be defined for computing the geometry from references or literals. However, using a feature property directly is by far the most commonly useful method.

        Returns:
        Geometry attribute name, or null to indicate default geometry
      • getName

        String getName()
        Returns a name for this symbolizer. This can be any string that uniquely identifies this style within a given canvas. It is not meant to be human-friendly. (The "title" property is meant to be human friendly.)
        Returns:
        a name for this style.
      • setUnitOfMeasure

        void setUnitOfMeasure​(Unit<Length> uom)
        Defines a measure unit for the symbolizer. This parameter is inherited from GML. Renderers shall use the unit to correctly render symbols.

        Recommended uom definitions are :

        • metre
        • foot
        • pixel

        Parameters:
        uom - can be null, which indicates usage of the pixel unit.
        Since:
        SymbologyEncoding 1.1
      • getDescription

        Description getDescription()
        Returns the description of this symbolizer.
        Returns:
        Description with usual informations used for user interfaces.
      • accept

        Object accept​(TraversingStyleVisitor visitor,
                      Object extraData)
        Calls the visit method of a StyleVisitor
        Parameters:
        visitor - the style visitor
        Returns:
        value produced
      • setGeometryPropertyName

        void setGeometryPropertyName​(String geometryPropertyName)
        A shortcut to define the geometry expression as a PropertyName Typically, features only have one geometry so, in general, the need to select one is not required. Note: this moves a little away from the SLD spec which provides an XPath reference to a Geometry object, but does follow it in spirit.
      • getGeometry

        Expression getGeometry()
        This defines the geometry to be used for styling.
        The property is optional and if it is absent (null) then the "default" geometry property of the feature should be used.
        Typically, features only have one geometry so, in general, the need to select one is not required.
        The expression can also build a new geometry out of existing attributes or transform an existing geometry. For geometry transformations that do change the geometry locations or that make up geometries out of non geometric attributes it is advised that the Expression implements the SpatialTransformationFunction interface
      • setGeometry

        void setGeometry​(Expression geometry)
        Sets the expression used for styling. See getGeometry() for further details.
      • hasOption

        boolean hasOption​(String key)
        Determines if a vendor option with the specific key has been set on this symbolizer.
      • getOptions

        Map<String,​String> getOptions()
        Map of vendor options for the symbolizer.

        Client code looking for the existence of a single option should use hasOption(String)