A Symbolizer for labeling a geometry.
You can create a Label with a Field or a Field name:
def label = new Label("STATE_ABBR")
Or with named parameters:
def label = new Label(property: "name", font: new Font(weight: "bold")))
| Type | Name and description |
|---|---|
protected void |
apply(org.geotools.styling.Symbolizer sym)Apply this Symbolizer to the GeoTools Symbolizer |
Label |
autoWrap(int length)Set the auto wrap length. |
Label |
conflictResolution(boolean bool)Disable label conflict resolution or not. |
Label |
fill(Fill fill)Set how the Label will be filled. |
Label |
font(java.lang.Object font)Set the Font |
Label |
forceLeftToRight(boolean bool)Disable label flipping making labels always follow natural orientation of the line or not. |
Label |
goodnessOfFit(float goodness)Set the goodness of fit parameter (a number between 0 and 1) |
Label |
graphicResize(java.lang.String mode, int margin = 0)Set the graphic resize mode (none, proportional, stretch) and margin. |
Label |
halo(Fill fill, java.lang.Object radius)Add a Halo to this Label |
Label |
labelAllGroup(boolean bool)Make all line segments are labeled instead of just the longest |
Label |
labelObstacle(boolean bol)Set whether to use the Label as an obstacle or not |
Label |
linear(java.lang.Object offset = 0, java.lang.Object gap = null, java.lang.Object igap = null, boolean align = false, boolean follow = false, boolean group = false, java.lang.Object displacement = null, java.lang.Object repeat = null)Set the Line Placement for this Label |
Label |
linear(java.util.Map parameters)Set the Line Placement for this Label |
Label |
maxAngleDelta(float maxAngleDelta)Set the max angle delta |
Label |
maxDisplacement(double maxDisplacement)Set the max displacement |
Label |
point(java.util.List anchor = [0.5, java.util.List displace = [0, java.lang.Object rotate = 0)Set the Point Placement for this Label |
Label |
point(java.util.Map parameters)Set the Point Placement for this Label |
Label |
polygonAlign(java.lang.String value)Set the polygon align option (manual, ortho, mbr) |
protected void |
prepare(org.geotools.styling.Rule rule)Prepare the GeoTools Rule by applying this Symbolizer |
Label |
priority(java.lang.Object priority)Set the priority |
void |
setProperty(java.lang.Object property)Set the Label's Property which can be a String, a Field, or a Function |
Label |
shape(Shape shape)Set the Shape surrounding the Label |
Label |
spaceAround(float distance)Set the space around a Label. |
java.lang.String |
toString()The string representation |
| Methods inherited from class | Name |
|---|---|
interface org.geotools.styling.Symbolizer |
org.geotools.styling.Symbolizer#accept(org.geotools.styling.StyleVisitor), org.geotools.styling.Symbolizer#setName(java.lang.String), org.geotools.styling.Symbolizer#hasOption(java.lang.String), org.geotools.styling.Symbolizer#getOptions(), org.geotools.styling.Symbolizer#getDescription(), org.geotools.styling.Symbolizer#getDescription(), org.geotools.styling.Symbolizer#setDescription(org.opengis.style.Description), org.geotools.styling.Symbolizer#getGeometry(), org.geotools.styling.Symbolizer#setGeometry(org.opengis.filter.expression.Expression), org.geotools.styling.Symbolizer#setUnitOfMeasure(javax.measure.unit.Unit), org.geotools.styling.Symbolizer#getGeometryPropertyName(), org.geotools.styling.Symbolizer#setGeometryPropertyName(java.lang.String), org.geotools.styling.Symbolizer#getName(), org.geotools.styling.Symbolizer#accept(org.opengis.style.StyleVisitor, java.lang.Object), org.geotools.styling.Symbolizer#getUnitOfMeasure() |
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
The Fill
The Font
The Halo
The Point or Line Placement
The priority
The property can be a Field, String, or Function
The Shape
Create a new Label with a property which is a field or attribute with which to generate labels form.
def label = new Label("STATE_ABBR")
property - The field or attributeCreate a new Label with named parameters.
def label = new Label(property: "name", font: new Font(weight: "bold")))
map - A Map of named parameters.Apply this Symbolizer to the GeoTools Symbolizer
sym - The GeoTools SymbolizerSet the auto wrap length. Labels longer than this value will be wrapped.
length - The auto wrap lengthDisable label conflict resolution or not.
bool - Whether disable conflict resolution or notSet how the Label will be filled.
fill - The FillSet the Font
font - A GeoScript Font or an object convertable to a FontDisable label flipping making labels always follow natural orientation of the line or not.
bool - Whether to disable label flippingSet the goodness of fit parameter (a number between 0 and 1)
goodness - The goodness of fit parameter (a number between 0 and 1)Set the graphic resize mode (none, proportional, stretch) and margin.
mode - The graphic resize modemode - The graphic resize modeAdd a Halo to this Label
fill - The Fillradius - The radiusMake all line segments are labeled instead of just the longest
bool - Whether to label all or just the longestSet whether to use the Label as an obstacle or not
bol - Whether to use the Label as an obstacleSet the Line Placement for this Label
offset - The perpendicular offsetgap - The gapigap - The initial gapalign - Whether to align or notfollow - Whether to follow lines or not (true or false)group - Whether to group or notdisplacement - The maximum displacement distancerepeat - The repeat distanceSet the Line Placement for this Label
parameters - A Map of named parameters (offset, gap, igap, align, follow,
group, displacement, repeat)Set the max angle delta
maxAngleDelta - The max angle deltaSet the max displacement
maxDisplacement - The max displacementSet the Point Placement for this Label
anchor - The anchordisplace - The displacementrotate - The rotationSet the Point Placement for this Label
parameters - A Map of named parameters (anchor, displace, and rotate)Set the polygon align option (manual, ortho, mbr)
value - The polygon align option (manual, ortho, mbr)Prepare the GeoTools Rule by applying this Symbolizer
rule - The GeoTools RuleSet the priority
priority - The prioritySet the Label's Property which can be a String, a Field, or a Function
property - The Label's PropertySet the Shape surrounding the Label
shape - The ShapeSet the space around a Label. A negative number will allow labels to overlap. A positive number will create more space between labels
distance - A negative or positive distance between labelsThe string representation
Groovy Documentation