org.geotools.styling
Class SLD

Object
  extended by SLD

public class SLD
extends Object

Utility class for working with GeoTools SLD objects.

This class assumes a subset of the SLD specification:

When you start to branch out to SLD information that contains multiple rules you will need to modify this class.

Module:

Field Summary
static double ALIGN_BOTTOM
           
static double ALIGN_CENTER
           
static double ALIGN_LEFT
           
static double ALIGN_MIDDLE
           
static double ALIGN_RIGHT
           
static double ALIGN_TOP
           
static StyleBuilder builder
           
static int NOTFOUND
          NOTFOUND indicates int value was unavailable
 
Constructor Summary
SLD()
           
 
Method Summary
static Color color(Expression expr)
          Navigate through the expression finding the first mentioned Color.
static Color color(Fill fill)
           
static Color color(LineSymbolizer symbolizer)
          Retrieve color from linesymbolizer if available.
static Color color(PointSymbolizer symbolizer)
          Grabs the color from the first Mark.
static Color color(Stroke stroke)
           
static String[] colors(Rule rule)
           
static String[] colors(Style style)
           
static String colorToHex(Color c)
           
static Style defaultStyle(StyledLayerDescriptor sld)
           
static double doubleValue(Expression expr)
          Deprecated.  
static FeatureTypeStyle featureTypeStyle(StyledLayerDescriptor sld, SimpleFeatureType type)
           
static FeatureTypeStyle featureTypeStyle(Style style, SimpleFeatureType type)
          Returns the feature type style in the style which matched a particular name.
static FeatureTypeStyle[] featureTypeStyles(StyledLayerDescriptor sld)
           
static Fill fill(PointSymbolizer sym)
           
static Fill fill(PolygonSymbolizer sym)
           
static Filter[] filters(Rule[] rule)
           
static Filter[] filters(Style style)
           
static Font font(TextSymbolizer symbolizer)
          Grabs the font from the first TextSymbolizer.
static Style getDefaultStyle(StyledLayerDescriptor sld)
           
static PointPlacement getPlacement(double horizAlign, double vertAlign, double rotation)
           
static Graphic graphic(PointSymbolizer sym)
           
static int intValue(Expression expr)
          Deprecated. Use expr.evaulate( null, Integer.class )
static boolean isSemanticTypeMatch(FeatureTypeStyle fts, String regex)
           
static Color lineColor(LineSymbolizer symbolizer)
          Retrieve linestring color from linesymbolizer if available.
static float[] lineDash(LineSymbolizer symbolizer)
          Grabs the dashes array from the first LineSymbolizer.
static String lineLinecap(LineSymbolizer symbolizer)
          Grabs the linecap from the first LineSymbolizer.
static String lineLinejoin(LineSymbolizer symbolizer)
          Grabs the linejoin from the first LineSymbolizer.
static double lineOpacity(LineSymbolizer symbolizer)
          Grabs the opacity from the first LineSymbolizer.
static LineSymbolizer lineSymbolizer(FeatureTypeStyle fts)
          Retrieve the first LineSymbolizer from the provided Style.
static LineSymbolizer lineSymbolizer(Style style)
          Retrieve the first LineSymbolizer from the provided Style.
static int lineWidth(LineSymbolizer symbolizer)
          Retrieve linestring width from symbolizer if available.
static Mark mark(Graphic graphic)
           
static Mark mark(PointSymbolizer sym)
           
static Style matchingStyle(Style[] styles, SimpleFeatureType schema)
          Returns the first style object which matches a given schema.
static double maxScale(FeatureTypeStyle fts)
          Returns the max scale of the default rule, or Double.NaN if none is set
static double minScale(FeatureTypeStyle fts)
          Returns the min scale of the default rule, or 0 if none is set
static double opacity(Fill fill)
          Retrieve the opacity from the provided fill; or return the default.
static double opacity(RasterSymbolizer rasterSymbolizer)
           
static double opacity(Stroke stroke)
           
static double pointBorderOpacity(PointSymbolizer symbolizer)
          Grabs the point border opacity from the first PointSymbolizer.
static Color pointColor(PointSymbolizer symbolizer)
          Grabs the color from the first Mark.
static Color pointFill(PointSymbolizer symbolizer)
          Grabs the fill from the first Mark.
static URL pointGraphic(Style style)
          Grabs the location of the first external graphic.
static Mark pointMark(Style style)
           
static double pointOpacity(PointSymbolizer symbolizer)
          Grabs the point opacity from the first PointSymbolizer.
static int pointSize(PointSymbolizer symbolizer)
          Grabs the size of the points graphic, if found.
static PointSymbolizer pointSymbolizer(FeatureTypeStyle fts)
          Retrieve the first PointSymbolizer from the provided FeatureTypeStyle.
static PointSymbolizer pointSymbolizer(Style style)
          Retrieve the first PointSymbolizer from the provided Style.
static String pointWellKnownName(PointSymbolizer symbolizer)
          Grabs the well known name of the first Mark that has one.
static int pointWidth(PointSymbolizer symbolizer)
          Grabs the width of the first Mark with a Stroke that has a non-null width.
static double polyBorderOpacity(PolygonSymbolizer symbolizer)
          Grabs the border opacity from the first PolygonSymbolizer.
static Color polyColor(PolygonSymbolizer symbolizer)
          Grabs the color from the first PolygonSymbolizer.
static Color polyFill(PolygonSymbolizer symbolizer)
          Grabs the fill from the first PolygonSymbolizer.
static double polyFillOpacity(PolygonSymbolizer symbolizer)
          Grabs the fill opacity from the first PolygonSymbolizer.
static PolygonSymbolizer polySymbolizer(FeatureTypeStyle fts)
          Retrieve the first PolygonSymbolizer from the provided Style.
static PolygonSymbolizer polySymbolizer(Style style)
          Retrieve the first PolygonSymbolizer from the provided Style.
static int polyWidth(PolygonSymbolizer symbolizer)
          Grabs the color from the first PolygonSymbolizer.
static double rasterOpacity(RasterSymbolizer symbolizer)
          Grabs the opacity from the first RasterSymbolizer.
static double rasterOpacity(Style style)
           
static RasterSymbolizer rasterSymbolizer(FeatureTypeStyle fts)
          Retrieve the first RasterSymbolizer from the provided Style.
static RasterSymbolizer rasterSymbolizer(Style style)
          Retrieve the first RasterSymbolizer from the provided Style.
static Rule[] rules(Style style)
           
static void setLineColour(LineSymbolizer symbolizer, Color colour)
          Sets the Colour for the given Line symbolizer
static void setLineColour(Style style, Color colour)
          Sets the colour for a line symbolizer
static void setPointColour(PointSymbolizer symbolizer, Color colour)
          Sets the Colour for the given point symbolizer
static void setPointColour(Style style, Color colour)
          Sets the Colour for the point symbolizer
static void setPolyColour(PolygonSymbolizer symbolizer, Color colour)
          Sets the Colour for the given polygon symbolizer
static void setPolyColour(Style style, Color colour)
          Sets the colour for a polygon symbolizer
static int size(Mark mark)
           
static String stringValue(Expression expr)
          Deprecated.  
static Stroke stroke(LineSymbolizer sym)
           
static Stroke stroke(PointSymbolizer sym)
           
static Stroke stroke(PolygonSymbolizer sym)
           
static Color strokeColor(Stroke stroke)
          Deprecated. please use color( stroke )
static Style[] styles(StyledLayerDescriptor sld)
           
protected static Symbolizer symbolizer(FeatureTypeStyle fts, Class SYMBOLIZER)
          Retrieve the first SYMBOLIZER from the provided FeatureTypeStyle.
protected static Symbolizer symbolizer(Style style, Class SYMBOLIZER)
          Retrieve the first SYMBOLIZER from the provided Style.
static Symbolizer[] symbolizers(Rule rule)
           
static Symbolizer[] symbolizers(Style style)
           
static Color textFontFill(TextSymbolizer symbolizer)
          Grabs the fontFill from the first TextSymbolizer.
static Color textHaloFill(TextSymbolizer symbolizer)
          Grabs the haloFill from the first TextSymbolizer.
static double textHaloOpacity(TextSymbolizer symbolizer)
          Grabs the halo opacity from the first TextSymbolizer.
static int textHaloWidth(TextSymbolizer symbolizer)
          Grabs the halo width from the first TextSymbolizer.
static Expression textLabel(TextSymbolizer symbolizer)
          Grabs the label from the first TextSymbolizer.
static String textLabelString(TextSymbolizer sym)
           
static TextSymbolizer textSymbolizer(FeatureTypeStyle fts)
          Retrieve the first TextSymbolizer from the provided Style.
static TextSymbolizer textSymbolizer(Style style)
          Retrieve the first TextSymbolizer from the provided Style.
static Color toColor(String htmlColor)
           
static String toHTMLColor(Color color)
          Converts a java.awt.Color into an HTML Colour
static String wellKnownName(Mark mark)
           
static int width(LineSymbolizer symbolizer)
          Retrieve linestring width from symbolizer if available.
static int width(Stroke stroke)
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOTFOUND

public static final int NOTFOUND
NOTFOUND indicates int value was unavailable

See Also:
Constant Field Values

builder

public static final StyleBuilder builder

ALIGN_LEFT

public static final double ALIGN_LEFT
See Also:
Constant Field Values

ALIGN_CENTER

public static final double ALIGN_CENTER
See Also:
Constant Field Values

ALIGN_RIGHT

public static final double ALIGN_RIGHT
See Also:
Constant Field Values

ALIGN_BOTTOM

public static final double ALIGN_BOTTOM
See Also:
Constant Field Values

ALIGN_MIDDLE

public static final double ALIGN_MIDDLE
See Also:
Constant Field Values

ALIGN_TOP

public static final double ALIGN_TOP
See Also:
Constant Field Values
Constructor Detail

SLD

public SLD()
Method Detail

lineColor

public static Color lineColor(LineSymbolizer symbolizer)
Retrieve linestring color from linesymbolizer if available.

Parameters:
symbolizer - Line symbolizer information.
Returns:
Color of linestring, or null if unavailable.

strokeColor

public static Color strokeColor(Stroke stroke)
Deprecated. please use color( stroke )

Parameters:
stroke -
Returns:
SLD.color( stroke )

color

public static Color color(Stroke stroke)

color

public static Color color(Fill fill)

setLineColour

public static void setLineColour(Style style,
                                 Color colour)
Sets the colour for a line symbolizer

Parameters:
style -
colour -

setLineColour

public static void setLineColour(LineSymbolizer symbolizer,
                                 Color colour)
Sets the Colour for the given Line symbolizer

Parameters:
symbolizer -
colour -

color

public static Color color(LineSymbolizer symbolizer)
Retrieve color from linesymbolizer if available.

Parameters:
symbolizer - Line symbolizer information.
Returns:
Color of linestring, or null if unavailable.

lineWidth

public static int lineWidth(LineSymbolizer symbolizer)
Retrieve linestring width from symbolizer if available.

Parameters:
symbolizer - Line symbolizer information.
Returns:
width of linestring, or NOTFOUND

width

public static int width(Stroke stroke)

size

public static int size(Mark mark)

width

public static int width(LineSymbolizer symbolizer)
Retrieve linestring width from symbolizer if available.

Parameters:
symbolizer - Line symbolizer information.
Returns:
width of linestring, or NOTFOUND

lineOpacity

public static double lineOpacity(LineSymbolizer symbolizer)
Grabs the opacity from the first LineSymbolizer.

Parameters:
symbolizer - Line symbolizer information.
Returns:
double of the line stroke's opacity, or NaN if unavailable.

opacity

public static double opacity(Stroke stroke)

opacity

public static double opacity(RasterSymbolizer rasterSymbolizer)

lineLinejoin

public static String lineLinejoin(LineSymbolizer symbolizer)
Grabs the linejoin from the first LineSymbolizer.

Parameters:
symbolizer - Line symbolizer information.
Returns:
String of the line stroke's linejoin, or null if unavailable.

lineLinecap

public static String lineLinecap(LineSymbolizer symbolizer)
Grabs the linecap from the first LineSymbolizer.

Parameters:
symbolizer - Line symbolizer information.
Returns:
String of the line stroke's linecap, or null if unavailable.

lineDash

public static float[] lineDash(LineSymbolizer symbolizer)
Grabs the dashes array from the first LineSymbolizer.

Parameters:
symbolizer - Line symbolizer information.
Returns:
float[] of the line dashes array, or null if unavailable.

pointGraphic

public static URL pointGraphic(Style style)
Grabs the location of the first external graphic.

Parameters:
style - SLD style information.
Returns:
Location of the first external graphic, or null

pointMark

public static Mark pointMark(Style style)

mark

public static Mark mark(PointSymbolizer sym)

mark

public static Mark mark(Graphic graphic)

graphic

public static Graphic graphic(PointSymbolizer sym)

pointSize

public static int pointSize(PointSymbolizer symbolizer)
Grabs the size of the points graphic, if found.

If you are using something fun like symbols you will need to do your own thing.

Parameters:
symbolizer - Point symbolizer information.
Returns:
size of the graphic

pointWellKnownName

public static String pointWellKnownName(PointSymbolizer symbolizer)
Grabs the well known name of the first Mark that has one.

If you are using something fun like symbols you will need to do your own thing.

Parameters:
symbolizer - Point symbolizer information.
Returns:
well known name of the first Mark

wellKnownName

public static String wellKnownName(Mark mark)

pointColor

public static Color pointColor(PointSymbolizer symbolizer)
Grabs the color from the first Mark.

If you are using something fun like symbols you will need to do your own thing.

Parameters:
symbolizer - Point symbolizer information.
Returns:
Color of the point's mark, or null if unavailable.

setPointColour

public static void setPointColour(Style style,
                                  Color colour)
Sets the Colour for the point symbolizer

Parameters:
style -
colour -

setPointColour

public static void setPointColour(PointSymbolizer symbolizer,
                                  Color colour)
Sets the Colour for the given point symbolizer

Parameters:
symbolizer -
colour -

color

public static Color color(PointSymbolizer symbolizer)
Grabs the color from the first Mark.

If you are using something fun like symbols you will need to do your own thing.

Parameters:
symbolizer - Point symbolizer information.
Returns:
Color of the point's mark, or null if unavailable.

pointWidth

public static int pointWidth(PointSymbolizer symbolizer)
Grabs the width of the first Mark with a Stroke that has a non-null width.

If you are using something fun like symbols you will need to do your own thing.

Parameters:
symbolizer - Point symbolizer information.
Returns:
width of the points border

pointBorderOpacity

public static double pointBorderOpacity(PointSymbolizer symbolizer)
Grabs the point border opacity from the first PointSymbolizer.

If you are using something fun like rules you will need to do your own thing.

Parameters:
symbolizer - Point symbolizer information.
Returns:
double of the point's border opacity, or NaN if unavailable.

pointOpacity

public static double pointOpacity(PointSymbolizer symbolizer)
Grabs the point opacity from the first PointSymbolizer.

If you are using something fun like rules you will need to do your own thing.

Parameters:
symbolizer - Point symbolizer information.
Returns:
double of the point's opacity, or NaN if unavailable.

pointFill

public static Color pointFill(PointSymbolizer symbolizer)
Grabs the fill from the first Mark.

If you are using something fun like symbols you will need to do your own thing.

Parameters:
symbolizer - Point symbolizer information.
Returns:
Color of the point's fill, or null if unavailable.

polyWidth

public static int polyWidth(PolygonSymbolizer symbolizer)
Grabs the color from the first PolygonSymbolizer.

If you are using something fun like rules you will need to do your own thing.

Parameters:
symbolizer - Polygon symbolizer information.
Returns:
Color of the polygon's stroke, or null if unavailable.

polyColor

public static Color polyColor(PolygonSymbolizer symbolizer)
Grabs the color from the first PolygonSymbolizer.

If you are using something fun like rules you will need to do your own thing.

Parameters:
symbolizer - Polygon symbolizer information.
Returns:
Color of the polygon's stroke, or null if unavailable.

setPolyColour

public static void setPolyColour(Style style,
                                 Color colour)
Sets the colour for a polygon symbolizer

Parameters:
style -
colour -

setPolyColour

public static void setPolyColour(PolygonSymbolizer symbolizer,
                                 Color colour)
Sets the Colour for the given polygon symbolizer

Parameters:
symbolizer -
colour -

polyFill

public static Color polyFill(PolygonSymbolizer symbolizer)
Grabs the fill from the first PolygonSymbolizer.

If you are using something fun like rules you will need to do your own thing.

Parameters:
symbolizer - Polygon symbolizer information.
Returns:
Color of the polygon's fill, or null if unavailable.

polyBorderOpacity

public static double polyBorderOpacity(PolygonSymbolizer symbolizer)
Grabs the border opacity from the first PolygonSymbolizer.

If you are using something fun like rules you will need to do your own thing.

Parameters:
symbolizer - Polygon symbolizer information.
Returns:
double of the polygon's border opacity, or NaN if unavailable.

polyFillOpacity

public static double polyFillOpacity(PolygonSymbolizer symbolizer)
Grabs the fill opacity from the first PolygonSymbolizer.

If you are using something fun like rules you will need to do your own thing.

Parameters:
symbolizer - Polygon symbolizer information.
Returns:
double of the polygon's fill opacity, or NaN if unavailable.

opacity

public static double opacity(Fill fill)
Retrieve the opacity from the provided fill; or return the default.

Parameters:
fill -
Returns:
opacity from the above fill; or return the Fill.DEFAULT value

rasterOpacity

public static double rasterOpacity(RasterSymbolizer symbolizer)
Grabs the opacity from the first RasterSymbolizer.

If you are using something fun like rules you will need to do your own thing.

Parameters:
symbolizer - Raster symbolizer information.
Returns:
opacity of the first RasterSymbolizer

rasterOpacity

public static double rasterOpacity(Style style)

textSymbolizer

public static TextSymbolizer textSymbolizer(FeatureTypeStyle fts)
Retrieve the first TextSymbolizer from the provided Style.

Parameters:
fts - SLD featureTypeStyle information.
Returns:
TextSymbolizer, or null if not found.

textSymbolizer

public static TextSymbolizer textSymbolizer(Style style)
Retrieve the first TextSymbolizer from the provided Style.

Parameters:
style - SLD style information.
Returns:
TextSymbolizer, or null if not found.

textLabel

public static Expression textLabel(TextSymbolizer symbolizer)
Grabs the label from the first TextSymbolizer.

If you are using something fun like symbols you will need to do your own thing.

Parameters:
symbolizer - Text symbolizer information.
Returns:
Expression of the label's text, or null if unavailable.

textLabelString

public static String textLabelString(TextSymbolizer sym)

textFontFill

public static Color textFontFill(TextSymbolizer symbolizer)
Grabs the fontFill from the first TextSymbolizer.

If you are using something fun like symbols you will need to do your own thing.

Parameters:
symbolizer - Text symbolizer information.
Returns:
Color of the font's fill, or null if unavailable.

textHaloFill

public static Color textHaloFill(TextSymbolizer symbolizer)
Grabs the haloFill from the first TextSymbolizer.

If you are using something fun like symbols you will need to do your own thing.

Parameters:
symbolizer - Text symbolizer information.
Returns:
Color of the halo's fill, or null if unavailable.

textHaloWidth

public static int textHaloWidth(TextSymbolizer symbolizer)
Grabs the halo width from the first TextSymbolizer.

If you are using something fun like symbols you will need to do your own thing.

Parameters:
symbolizer - Text symbolizer information.
Returns:
float of the halo's width, or null if unavailable.

textHaloOpacity

public static double textHaloOpacity(TextSymbolizer symbolizer)
Grabs the halo opacity from the first TextSymbolizer.

If you are using something fun like symbols you will need to do your own thing.

Parameters:
symbolizer - Text symbolizer information.
Returns:
double of the halo's opacity, or NaN if unavailable.

color

public static Color color(Expression expr)
Navigate through the expression finding the first mentioned Color.

If you have a specific Feature in mind please use:


 Object value = expr.getValue( feature );
 return value instanceof Color ? (Color) value : null;
 

Parameters:
expr -
Returns:
First available color, or null.

intValue

public static int intValue(Expression expr)
Deprecated. Use expr.evaulate( null, Integer.class )

This method is here for backward compatability.

Parameters:
expr - DOCUMENT ME!
Returns:
DOCUMENT ME!
See Also:
Filters#intValue(Expression)

stringValue

public static String stringValue(Expression expr)
Deprecated. 

This method is here for backward compatability.

Parameters:
expr - DOCUMENT ME!
Returns:
DOCUMENT ME!
See Also:
Filters#stringValue(Expression)

doubleValue

public static double doubleValue(Expression expr)
Deprecated. 

This method is here for backward compatability.

Parameters:
expr - DOCUMENT ME!
Returns:
DOCUMENT ME!
See Also:
Filters#doubleValue(Expression)

rasterSymbolizer

public static RasterSymbolizer rasterSymbolizer(FeatureTypeStyle fts)
Retrieve the first RasterSymbolizer from the provided Style.

Parameters:
fts - SLD featureTypeStyle information.
Returns:
RasterSymbolizer, or null if not found.

rasterSymbolizer

public static RasterSymbolizer rasterSymbolizer(Style style)
Retrieve the first RasterSymbolizer from the provided Style.

Parameters:
style - SLD style information.
Returns:
RasterSymbolizer, or null if not found.

lineSymbolizer

public static LineSymbolizer lineSymbolizer(FeatureTypeStyle fts)
Retrieve the first LineSymbolizer from the provided Style.

Parameters:
fts - SLD featureTypeStyle information.
Returns:
LineSymbolizer, or null if not found.

lineSymbolizer

public static LineSymbolizer lineSymbolizer(Style style)
Retrieve the first LineSymbolizer from the provided Style.

Parameters:
style - SLD style information.
Returns:
LineSymbolizer, or null if not found.

stroke

public static Stroke stroke(LineSymbolizer sym)

stroke

public static Stroke stroke(PolygonSymbolizer sym)

stroke

public static Stroke stroke(PointSymbolizer sym)

fill

public static Fill fill(PolygonSymbolizer sym)

fill

public static Fill fill(PointSymbolizer sym)

pointSymbolizer

public static PointSymbolizer pointSymbolizer(FeatureTypeStyle fts)
Retrieve the first PointSymbolizer from the provided FeatureTypeStyle.

Parameters:
fts - SLD featureTypeStyle information.
Returns:
PointSymbolizer, or null if not found.

pointSymbolizer

public static PointSymbolizer pointSymbolizer(Style style)
Retrieve the first PointSymbolizer from the provided Style.

Parameters:
style - SLD style information.
Returns:
PointSymbolizer, or null if not found.

polySymbolizer

public static PolygonSymbolizer polySymbolizer(FeatureTypeStyle fts)
Retrieve the first PolygonSymbolizer from the provided Style.

Parameters:
fts - SLD featureTypeStyle information.
Returns:
PolygonSymbolizer, or null if not found.

polySymbolizer

public static PolygonSymbolizer polySymbolizer(Style style)
Retrieve the first PolygonSymbolizer from the provided Style.

Parameters:
style - SLD style information.
Returns:
PolygonSymbolizer, or null if not found.

featureTypeStyle

public static FeatureTypeStyle featureTypeStyle(Style style,
                                                SimpleFeatureType type)
Returns the feature type style in the style which matched a particular name.

Parameters:
style - The style in question.
type - The feature type must be non-null.
Returns:
Teh FeatureTypeStyle object if it exists, otherwise false.

matchingStyle

public static Style matchingStyle(Style[] styles,
                                  SimpleFeatureType schema)
Returns the first style object which matches a given schema.

Parameters:
styles - Array of style objects.
schema - Feature schema.
Returns:
The first object to match the feature type, otherwise null if no match.

symbolizer

protected static Symbolizer symbolizer(Style style,
                                       Class SYMBOLIZER)
Retrieve the first SYMBOLIZER from the provided Style.

Parameters:
style - SLD style information.
SYMBOLIZER - LineSymbolizer.class, PointSymbolizer.class, PolygonSymbolizer.class, RasterSymbolizer.class, or TextSymbolizer.class
Returns:
symbolizer instance from style, or null if not found.

symbolizer

protected static Symbolizer symbolizer(FeatureTypeStyle fts,
                                       Class SYMBOLIZER)
Retrieve the first SYMBOLIZER from the provided FeatureTypeStyle.

Parameters:
fts - the FeatureTypeStyle SLD style information.
SYMBOLIZER - LineSymbolizer.class, PointSymbolizer.class, PolygonSymbolizer.class, RasterSymbolizer.class, or TextSymbolizer.class
Returns:
symbolizer instance from fts, or null if not found.

colorToHex

public static String colorToHex(Color c)

styles

public static Style[] styles(StyledLayerDescriptor sld)

featureTypeStyles

public static FeatureTypeStyle[] featureTypeStyles(StyledLayerDescriptor sld)

featureTypeStyle

public static FeatureTypeStyle featureTypeStyle(StyledLayerDescriptor sld,
                                                SimpleFeatureType type)

defaultStyle

public static Style defaultStyle(StyledLayerDescriptor sld)

filters

public static Filter[] filters(Rule[] rule)

filters

public static Filter[] filters(Style style)

rules

public static Rule[] rules(Style style)

symbolizers

public static Symbolizer[] symbolizers(Style style)

symbolizers

public static Symbolizer[] symbolizers(Rule rule)

colors

public static String[] colors(Style style)

colors

public static String[] colors(Rule rule)

toHTMLColor

public static String toHTMLColor(Color color)
Converts a java.awt.Color into an HTML Colour

Parameters:
color -
Returns:
HTML Color (fill) in hex #RRGGBB

toColor

public static Color toColor(String htmlColor)

font

public static Font font(TextSymbolizer symbolizer)
Grabs the font from the first TextSymbolizer.

If you are using something fun like symbols you will need to do your own thing.

Parameters:
symbolizer - Text symbolizer information.
Returns:
FontData[] of the font's fill, or null if unavailable.

getDefaultStyle

public static Style getDefaultStyle(StyledLayerDescriptor sld)

isSemanticTypeMatch

public static boolean isSemanticTypeMatch(FeatureTypeStyle fts,
                                          String regex)

minScale

public static double minScale(FeatureTypeStyle fts)
Returns the min scale of the default rule, or 0 if none is set


maxScale

public static double maxScale(FeatureTypeStyle fts)
Returns the max scale of the default rule, or Double.NaN if none is set


getPlacement

public static PointPlacement getPlacement(double horizAlign,
                                          double vertAlign,
                                          double rotation)


Copyright © 1996-2009 Geotools. All Rights Reserved.