|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectSLD
public class SLD
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.
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 |
---|
public static final int NOTFOUND
NOTFOUND
indicates int value was unavailable
public static final StyleBuilder builder
public static final double ALIGN_LEFT
public static final double ALIGN_CENTER
public static final double ALIGN_RIGHT
public static final double ALIGN_BOTTOM
public static final double ALIGN_MIDDLE
public static final double ALIGN_TOP
Constructor Detail |
---|
public SLD()
Method Detail |
---|
public static Color lineColor(LineSymbolizer symbolizer)
symbolizer
- Line symbolizer information.
public static Color strokeColor(Stroke stroke)
stroke
-
public static Color color(Stroke stroke)
public static Color color(Fill fill)
public static void setLineColour(Style style, Color colour)
style
- colour
- public static void setLineColour(LineSymbolizer symbolizer, Color colour)
symbolizer
- colour
- public static Color color(LineSymbolizer symbolizer)
symbolizer
- Line symbolizer information.
public static int lineWidth(LineSymbolizer symbolizer)
symbolizer
- Line symbolizer information.
public static int width(Stroke stroke)
public static int size(Mark mark)
public static int width(LineSymbolizer symbolizer)
symbolizer
- Line symbolizer information.
public static double lineOpacity(LineSymbolizer symbolizer)
symbolizer
- Line symbolizer information.
public static double opacity(Stroke stroke)
public static double opacity(RasterSymbolizer rasterSymbolizer)
public static String lineLinejoin(LineSymbolizer symbolizer)
symbolizer
- Line symbolizer information.
public static String lineLinecap(LineSymbolizer symbolizer)
symbolizer
- Line symbolizer information.
public static float[] lineDash(LineSymbolizer symbolizer)
symbolizer
- Line symbolizer information.
public static URL pointGraphic(Style style)
style
- SLD style information.
public static Mark pointMark(Style style)
public static Mark mark(PointSymbolizer sym)
public static Mark mark(Graphic graphic)
public static Graphic graphic(PointSymbolizer sym)
public static int pointSize(PointSymbolizer symbolizer)
If you are using something fun like symbols you will need to do your own thing.
symbolizer
- Point symbolizer information.
public static String pointWellKnownName(PointSymbolizer symbolizer)
If you are using something fun like symbols you will need to do your own thing.
symbolizer
- Point symbolizer information.
public static String wellKnownName(Mark mark)
public static Color pointColor(PointSymbolizer symbolizer)
If you are using something fun like symbols you will need to do your own thing.
symbolizer
- Point symbolizer information.
public static void setPointColour(Style style, Color colour)
style
- colour
- public static void setPointColour(PointSymbolizer symbolizer, Color colour)
symbolizer
- colour
- public static Color color(PointSymbolizer symbolizer)
If you are using something fun like symbols you will need to do your own thing.
symbolizer
- Point symbolizer information.
public static int pointWidth(PointSymbolizer symbolizer)
If you are using something fun like symbols you will need to do your own thing.
symbolizer
- Point symbolizer information.
public static double pointBorderOpacity(PointSymbolizer symbolizer)
If you are using something fun like rules you will need to do your own thing.
symbolizer
- Point symbolizer information.
public static double pointOpacity(PointSymbolizer symbolizer)
If you are using something fun like rules you will need to do your own thing.
symbolizer
- Point symbolizer information.
public static Color pointFill(PointSymbolizer symbolizer)
If you are using something fun like symbols you will need to do your own thing.
symbolizer
- Point symbolizer information.
public static int polyWidth(PolygonSymbolizer symbolizer)
If you are using something fun like rules you will need to do your own thing.
symbolizer
- Polygon symbolizer information.
public static Color polyColor(PolygonSymbolizer symbolizer)
If you are using something fun like rules you will need to do your own thing.
symbolizer
- Polygon symbolizer information.
public static void setPolyColour(Style style, Color colour)
style
- colour
- public static void setPolyColour(PolygonSymbolizer symbolizer, Color colour)
symbolizer
- colour
- public static Color polyFill(PolygonSymbolizer symbolizer)
If you are using something fun like rules you will need to do your own thing.
symbolizer
- Polygon symbolizer information.
public static double polyBorderOpacity(PolygonSymbolizer symbolizer)
If you are using something fun like rules you will need to do your own thing.
symbolizer
- Polygon symbolizer information.
public static double polyFillOpacity(PolygonSymbolizer symbolizer)
If you are using something fun like rules you will need to do your own thing.
symbolizer
- Polygon symbolizer information.
public static double opacity(Fill fill)
fill
-
public static double rasterOpacity(RasterSymbolizer symbolizer)
If you are using something fun like rules you will need to do your own thing.
symbolizer
- Raster symbolizer information.
public static double rasterOpacity(Style style)
public static TextSymbolizer textSymbolizer(FeatureTypeStyle fts)
fts
- SLD featureTypeStyle information.
public static TextSymbolizer textSymbolizer(Style style)
style
- SLD style information.
public static Expression textLabel(TextSymbolizer symbolizer)
If you are using something fun like symbols you will need to do your own thing.
symbolizer
- Text symbolizer information.
public static String textLabelString(TextSymbolizer sym)
public static Color textFontFill(TextSymbolizer symbolizer)
If you are using something fun like symbols you will need to do your own thing.
symbolizer
- Text symbolizer information.
public static Color textHaloFill(TextSymbolizer symbolizer)
If you are using something fun like symbols you will need to do your own thing.
symbolizer
- Text symbolizer information.
public static int textHaloWidth(TextSymbolizer symbolizer)
If you are using something fun like symbols you will need to do your own thing.
symbolizer
- Text symbolizer information.
public static double textHaloOpacity(TextSymbolizer symbolizer)
If you are using something fun like symbols you will need to do your own thing.
symbolizer
- Text symbolizer information.
public static Color color(Expression expr)
If you have a specific Feature in mind please use:
Object value = expr.getValue( feature );
return value instanceof Color ? (Color) value : null;
expr
-
public static int intValue(Expression expr)
expr
- DOCUMENT ME!
Filters#intValue(Expression)
public static String stringValue(Expression expr)
expr
- DOCUMENT ME!
Filters#stringValue(Expression)
public static double doubleValue(Expression expr)
expr
- DOCUMENT ME!
Filters#doubleValue(Expression)
public static RasterSymbolizer rasterSymbolizer(FeatureTypeStyle fts)
fts
- SLD featureTypeStyle information.
public static RasterSymbolizer rasterSymbolizer(Style style)
style
- SLD style information.
public static LineSymbolizer lineSymbolizer(FeatureTypeStyle fts)
fts
- SLD featureTypeStyle information.
public static LineSymbolizer lineSymbolizer(Style style)
style
- SLD style information.
public static Stroke stroke(LineSymbolizer sym)
public static Stroke stroke(PolygonSymbolizer sym)
public static Stroke stroke(PointSymbolizer sym)
public static Fill fill(PolygonSymbolizer sym)
public static Fill fill(PointSymbolizer sym)
public static PointSymbolizer pointSymbolizer(FeatureTypeStyle fts)
fts
- SLD featureTypeStyle information.
public static PointSymbolizer pointSymbolizer(Style style)
style
- SLD style information.
public static PolygonSymbolizer polySymbolizer(FeatureTypeStyle fts)
fts
- SLD featureTypeStyle information.
public static PolygonSymbolizer polySymbolizer(Style style)
style
- SLD style information.
public static FeatureTypeStyle featureTypeStyle(Style style, SimpleFeatureType type)
style
- The style in question.type
- The feature type must be non-null.
public static Style matchingStyle(Style[] styles, SimpleFeatureType schema)
styles
- Array of style objects.schema
- Feature schema.
protected static Symbolizer symbolizer(Style style, Class SYMBOLIZER)
style
- SLD style information.SYMBOLIZER
- LineSymbolizer.class, PointSymbolizer.class,
PolygonSymbolizer.class, RasterSymbolizer.class, or TextSymbolizer.class
protected static Symbolizer symbolizer(FeatureTypeStyle fts, Class SYMBOLIZER)
fts
- the FeatureTypeStyle SLD style information.SYMBOLIZER
- LineSymbolizer.class, PointSymbolizer.class,
PolygonSymbolizer.class, RasterSymbolizer.class,
or TextSymbolizer.class
public static String colorToHex(Color c)
public static Style[] styles(StyledLayerDescriptor sld)
public static FeatureTypeStyle[] featureTypeStyles(StyledLayerDescriptor sld)
public static FeatureTypeStyle featureTypeStyle(StyledLayerDescriptor sld, SimpleFeatureType type)
public static Style defaultStyle(StyledLayerDescriptor sld)
public static Filter[] filters(Rule[] rule)
public static Filter[] filters(Style style)
public static Rule[] rules(Style style)
public static Symbolizer[] symbolizers(Style style)
public static Symbolizer[] symbolizers(Rule rule)
public static String[] colors(Style style)
public static String[] colors(Rule rule)
public static String toHTMLColor(Color color)
color
-
public static Color toColor(String htmlColor)
public static Font font(TextSymbolizer symbolizer)
If you are using something fun like symbols you will need to do your own thing.
symbolizer
- Text symbolizer information.
public static Style getDefaultStyle(StyledLayerDescriptor sld)
public static boolean isSemanticTypeMatch(FeatureTypeStyle fts, String regex)
public static double minScale(FeatureTypeStyle fts)
public static double maxScale(FeatureTypeStyle fts)
public static PointPlacement getPlacement(double horizAlign, double vertAlign, double rotation)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |