|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectSLD
SLDs
public class SLDs
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 String |
GENERIC_FEATURE_TYPENAME
The type name that can be used in an SLD in the featuretypestyle that matches all feature types. |
Fields inherited from class SLD |
---|
NOTFOUND |
Constructor Summary | |
---|---|
SLDs()
|
Method Summary | |
---|---|
static Color |
color(Expression expr)
|
static String[] |
colors(Rule rule)
Retrieves all colour names defined in a rule |
static Font |
font(TextSymbolizer symbolizer)
|
static Style |
getDefaultStyle(StyledLayerDescriptor sld)
|
static FeatureTypeStyle |
getFeatureTypeStyle(Style s)
gets the first FeatureTypeStyle |
static Rule |
getRasterSymbolizerRule(Style s)
Find the first rule which contains a rastersymbolizer, and return it |
static boolean |
isLine(GeometryDescriptor geometryType)
|
static boolean |
isLine(SimpleFeatureType featureType)
|
static boolean |
isPoint(GeometryDescriptor geometryType)
|
static boolean |
isPoint(SimpleFeatureType featureType)
|
static boolean |
isPolygon(GeometryDescriptor geometryType)
|
static boolean |
isPolygon(SimpleFeatureType featureType)
|
static boolean |
isSemanticTypeMatch(FeatureTypeStyle fts,
String regex)
|
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 Color |
pointFillWithAlpha(PointSymbolizer symbolizer)
Extracts the fill color with a given opacity from the PointSymbolizer . |
static Color |
pointStrokeColorWithAlpha(PointSymbolizer symbolizer)
Extracts the stroke color with a given opacity from the PointSymbolizer . |
static Color |
polyFill(PolygonSymbolizer symbolizer)
|
static int |
size(Graphic graphic)
|
static FontData[] |
textFont(TextSymbolizer symbolizer)
Grabs the font from the first TextSymbolizer. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
public static final String GENERIC_FEATURE_TYPENAME
Constructor Detail |
---|
public SLDs()
Method Detail |
---|
public static int size(Graphic graphic)
public static Color polyFill(PolygonSymbolizer symbolizer)
public static Color color(Expression expr)
public static FontData[] textFont(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[] colors(Rule rule)
rule
- the rule
public static Color pointFillWithAlpha(PointSymbolizer symbolizer)
PointSymbolizer
.
symbolizer
- the point symbolizer from which to get the color.
Color
with transparency if available. Returns null if no color is available.public static Color pointStrokeColorWithAlpha(PointSymbolizer symbolizer)
PointSymbolizer
.
symbolizer
- the point symbolizer from which to get the color.
Color
with transparency if available. Returns null if no color is available.public static Font font(TextSymbolizer symbolizer)
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 FeatureTypeStyle getFeatureTypeStyle(Style s)
public static Rule getRasterSymbolizerRule(Style s)
s
- A style to search in
public static final boolean isPolygon(SimpleFeatureType featureType)
public static final boolean isPolygon(GeometryDescriptor geometryType)
public static final boolean isLine(SimpleFeatureType featureType)
public static final boolean isLine(GeometryDescriptor geometryType)
public static final boolean isPoint(SimpleFeatureType featureType)
public static final boolean isPoint(GeometryDescriptor geometryType)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |