Package org.geotools.renderer.label
Class LabelIndex
Object
LabelIndex
Stores label envelopes and detects interference by overlap or proximity.
Backed by LabelQuadtree for O(log n) spatial pruning with true early-exit on first hit. Pass
margin large enough to contain any label that may be positioned outside the display area (e.g. with
partialsEnabled).
- Author:
- Andrea Aime
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLabel(LabelCacheItem item, Rectangle2D bounds) Adds a label into the index.booleanlabelsWithinDistance(Rectangle2D bounds, double distance) Returns true if any label in the index is withindistanceofbounds.voidreserveArea(List<Rectangle2D> reserved) Reserves the areas indicated by these rectangles.
-
Constructor Details
-
LabelIndex
- Parameters:
displayArea- rendering area in screen coordinatesmargin- extra space beyond displayArea to accommodate labels outside the display area
-
-
Method Details
-
labelsWithinDistance
Returns true if any label in the index is withindistanceofbounds. The bounds are expanded by the distance (no curved buffer). -
addLabel
Adds a label into the index. -
reserveArea
Reserves the areas indicated by these rectangles.
-