org.deegree.graphics.sld
Interface PointPlacement

All Known Implementing Classes:
PointPlacement_Impl

public interface PointPlacement

Incarnation of a sld:PointPlacement-element. For a PointPlacement, the anchor point of the label and a linear displacement from the point can be specified, to allow a graphic symbol to be plotted directly at the point. This might be useful to label a city, for example. For a LinePlacement, a perpendicular offset can be specified, to allow the line itself to be plotted also. This might be useful for labelling a road or a river, for example.

Version:
$Revision: 1.8 $ $Date: 2004/04/27 15:40:16 $
Author:
Andreas Poth, Markus Schneider

Method Summary
 double[] getAnchorPoint(Feature feature)
          The AnchorPoint element of a PointPlacement gives the location inside of a label to use for anchoring the label to the main-geometry point.
 double[] getDisplacement(Feature feature)
          The Displacement element of a PointPlacement gives the X and Y displacements from the main-geometry point to render a text label.
 double getRotation(Feature feature)
          The Rotation of a PointPlacement gives the clockwise rotation of the label in degrees from the normal direction for a font (left-to-right for Latin- derived human languages at least).
 boolean isAuto()
          Returns whether the placement should be optimized or not.
 void setAnchorPoint(double[] anchorPoint)
           
 void setAuto(boolean auto)
          
 void setDisplacement(double[] displacement)
           
 void setRotation(double rotation)
           
 

Method Detail

getAnchorPoint

public double[] getAnchorPoint(Feature feature)
                        throws FilterEvaluationException
The AnchorPoint element of a PointPlacement gives the location inside of a label to use for anchoring the label to the main-geometry point.

The coordinates are given as two floating-point numbers in the AnchorPointX and AnchorPointY elements each with values between 0.0 and 1.0 inclusive. The bounding box of the label to be rendered is considered to be in a coorindate space from 0.0 (lower-left corner) to 1.0 (upper-right corner), and the anchor position is specified as a point in this space. The default point is X=0, Y=0.5, which is at the middle height of the left-hand side of the label. A system may choose different anchor points to de-conflict labels.

Parameters:
feature - specifies the Feature to be used for evaluation of the underlying 'sld:ParameterValueType'
Returns:
2 double values: x ([0]) and y ([0])
Throws:
FilterEvaluationException - if the evaluation fails

setAnchorPoint

public void setAnchorPoint(double[] anchorPoint)
Parameters:
anchorPoint - anchorPoint for the PointPlacement
See Also:


getDisplacement

public double[] getDisplacement(Feature feature)
                         throws FilterEvaluationException
The Displacement element of a PointPlacement gives the X and Y displacements from the main-geometry point to render a text label.

This will often be used to avoid over-plotting a graphic symbol marking a city or some such feature. The displacements are in units of pixels above and to the right of the point. A system may reflect this displacement about the X and/or Y axes to de-conflict labels. The default displacement is X=0, Y=0.

Parameters:
feature - specifies the Feature to be used for evaluation of the underlying 'sld:ParameterValueType'
Returns:
2 double values: x ([0]) and y ([0])
Throws:
FilterEvaluationException - if the evaluation fails

setDisplacement

public void setDisplacement(double[] displacement)
Parameters:
displacement -
See Also:


getRotation

public double getRotation(Feature feature)
                   throws FilterEvaluationException
The Rotation of a PointPlacement gives the clockwise rotation of the label in degrees from the normal direction for a font (left-to-right for Latin- derived human languages at least).

Parameters:
feature - specifies the Feature to be used for evaluation of the underlying 'sld:ParameterValueType'
Returns:
double value describing the rotation parameter
Throws:
FilterEvaluationException - if the evaluation fails

setRotation

public void setRotation(double rotation)
Parameters:
rotation - the rotation to be set for the PointPlacement
See Also:
getRotation(Feature)

isAuto

public boolean isAuto()
Returns whether the placement should be optimized or not.

Returns:
true, if it should be optimized

setAuto

public void setAuto(boolean auto)

Parameters:
auto -