QGIS API Documentation  2.99.0-Master (40f86b2)
qgspallabeling.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgspallabeling.h
3  Smart labeling for vector layers
4  -------------------
5  begin : June 2009
6  copyright : (C) Martin Dobias
7  email : wonder dot sk at gmail dot com
8 
9  ***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 //Note: although this file is in the core library, it is not part of the stable API
19 //and might change at any time!
20 
21 #ifndef QGSPALLABELING_H
22 #define QGSPALLABELING_H
23 
24 #include "qgis_core.h"
25 #include <QString>
26 #include <QFont>
27 #include <QFontDatabase>
28 #include <QColor>
29 #include <QHash>
30 #include <QList>
31 #include <QPainter>
32 #include <QRectF>
33 #include <QMap>
34 #include "qgsfeature.h"
35 #include "qgsgeometry.h"
36 #include "qgsfields.h"
37 #include "qgspoint.h"
38 #include "qgsmapunitscale.h"
39 #include "qgsstringutils.h"
40 #include "qgstextrenderer.h"
41 #include "qgspropertycollection.h"
42 
43 namespace pal
44 {
45  class Pal;
46  class Layer;
47  class LabelPosition;
48 }
49 
51 class QgsRectangle;
52 class QgsMapToPixel;
53 class QgsFeature;
55 class QgsVectorLayer;
56 class QgsExpression;
57 class QFontMetricsF;
58 class QPainter;
59 class QPicture;
60 class QgsGeometry;
62 class QgsLabelSearchTree;
63 class QgsMapSettings;
64 class QgsLabelFeature;
65 class QgsLabelingEngine;
68 class QgsDxfExport;
71 
72 
76 class CORE_EXPORT QgsLabelPosition
77 {
78  public:
79  QgsLabelPosition( int id, double r, const QVector< QgsPoint > &corners, const QgsRectangle &rect, double w, double h, const QString &layer, const QString &labeltext, const QFont &labelfont, bool upside_down, bool diagram = false, bool pinned = false, const QString &providerId = QString() )
80  : featureId( id )
81  , rotation( r )
82  , cornerPoints( corners )
83  , labelRect( rect )
84  , width( w )
85  , height( h )
86  , layerID( layer )
87  , labelText( labeltext )
88  , labelFont( labelfont )
89  , upsideDown( upside_down )
90  , isDiagram( diagram )
91  , isPinned( pinned )
92  , providerID( providerId )
93  {}
95  : featureId( -1 )
96  , rotation( 0 )
97  , labelRect( QgsRectangle() )
98  , width( 0 )
99  , height( 0 )
100  , layerID( QLatin1String( "" ) )
101  , labelText( QLatin1String( "" ) )
102  , labelFont( QFont() )
103  , upsideDown( false )
104  , isDiagram( false )
105  , isPinned( false )
106  {}
108  double rotation;
109  QVector< QgsPoint > cornerPoints;
111  double width;
112  double height;
113  QString layerID;
114  QString labelText;
115  QFont labelFont;
117  bool isDiagram;
118  bool isPinned;
120  QString providerID;
121 };
122 
123 
127 class CORE_EXPORT QgsPalLayerSettings
128 {
129  public:
133 
135  QgsPalLayerSettings &operator=( const QgsPalLayerSettings &s );
136 
138  static QgsPalLayerSettings fromLayer( QgsVectorLayer *layer );
139 
142  //TODO QGIS 3.0 - move to QgsLabelingEngine
144  {
153  };
154 
156  //TODO QGIS 3.0 - move to QgsLabelingEngine
158  {
171  };
172 
175  //TODO QGIS 3.0 - move to QgsLabelingEngine
177  {
180  };
181 
184  //TODO QGIS 3.0 - move to QgsLabelingEngine, rename to LinePlacementFlag, use Q_DECLARE_FLAGS to make
185  //LinePlacementFlags type, and replace use of pal::LineArrangementFlag
187  {
188  OnLine = 1,
189  AboveLine = 2,
192  BelowLine = 4,
195  MapOrientation = 8,
198  };
199 
201  {
210  QuadrantBelowRight
211  };
212 
214  {
217  ShowAll
218  };
219 
221  {
224  SymbolBelow
225  };
226 
228  {
229  MultiLeft = 0,
232  MultiFollowPlacement
234  };
235 
239  //TODO QGIS 3.0 - Move to QgsLabelingEngine
241  {
242  PolygonInterior,
244  PolygonBoundary,
246  PolygonWhole
250  };
251 
252 
254  enum SizeUnit
255  {
256  Points = 0,
257  MM,
259  Percent
260  };
261 
263  enum Property
264  {
265  // text style
266  Size = 0,
267  Bold = 1,
268  Italic = 2,
269  Underline = 3,
270  Color = 4,
271  Strikeout = 5,
272  Family = 6,
273  FontStyle = 21,
274  FontSizeUnit = 22,
275  FontTransp = 18,
276  FontCase = 27,
277  FontLetterSpacing = 28,
278  FontWordSpacing = 29,
279  FontBlendMode = 30,
280 
281  // text formatting
282  MultiLineWrapChar = 31,
283  MultiLineHeight = 32,
284  MultiLineAlignment = 33,
285  DirSymbDraw = 34,
286  DirSymbLeft = 35,
287  DirSymbRight = 36,
288  DirSymbPlacement = 37,
289  DirSymbReverse = 38,
290  NumFormat = 39,
291  NumDecimals = 40,
292  NumPlusSign = 41,
293 
294  // text buffer
295  BufferDraw = 42,
296  BufferSize = 7,
297  BufferUnit = 43,
298  BufferColor = 8,
299  BufferTransp = 19,
300  BufferJoinStyle = 44,
301  BufferBlendMode = 45,
302 
303  // background
304  ShapeDraw = 46,
305  ShapeKind = 47,
306  ShapeSVGFile = 48,
307  ShapeSizeType = 49,
308  ShapeSizeX = 50,
309  ShapeSizeY = 85,
310  ShapeSizeUnits = 51,
311  ShapeRotationType = 52,
312  ShapeRotation = 53,
313  ShapeOffset = 54,
314  ShapeOffsetUnits = 55,
315  ShapeRadii = 56,
316  ShapeRadiiUnits = 57,
317  ShapeTransparency = 63,
318  ShapeBlendMode = 64,
319  ShapeFillColor = 58,
320  ShapeStrokeColor = 59,
321  ShapeStrokeWidth = 60,
322  ShapeStrokeWidthUnits = 61,
323  ShapeJoinStyle = 62,
324 
325  // drop shadow
326  ShadowDraw = 65,
327  ShadowUnder = 66,
328  ShadowOffsetAngle = 67,
329  ShadowOffsetDist = 68,
330  ShadowOffsetUnits = 69,
331  ShadowRadius = 70,
332  ShadowRadiusUnits = 71,
333  ShadowTransparency = 72,
334  ShadowScale = 73,
335  ShadowColor = 74,
336  ShadowBlendMode = 75,
337 
338  // placement
339  CentroidWhole = 76,
340  OffsetQuad = 77,
341  OffsetXY = 78,
342  OffsetUnits = 80,
343  LabelDistance = 13,
344  DistanceUnits = 81,
345  OffsetRotation = 82,
346  CurvedCharAngleInOut = 83,
347  // (data defined only)
348  PositionX = 9,
349  PositionY = 10,
350  Hali = 11,
351  Vali = 12,
352  Rotation = 14,
353  RepeatDistance = 84,
354  RepeatDistanceUnit = 86,
355  Priority = 87,
356  PredefinedPositionOrder = 91,
357 
358  // rendering
359  ScaleVisibility = 23,
360  MinScale = 16,
361  MaxScale = 17,
362  FontLimitPixel = 24,
363  FontMinPixel = 25,
364  FontMaxPixel = 26,
365  IsObstacle = 88,
366  ObstacleFactor = 89,
367  ZIndex = 90,
368 
369  // (data defined only)
370  Show = 15,
371  AlwaysShow = 20
372  };
373 
378  static const QgsPropertiesDefinition &propertyDefinitions();
379 
380 
381  // whether to label this layer
382  bool enabled;
383 
392 
393  //-- text style
394 
395  QString fieldName;
396 
400 
403  QgsExpression *getLabelExpression();
404 
406 
411 
412  //-- text formatting
413 
414  QString wrapChar;
415  MultiLineAlign multilineAlign; // horizontal alignment of multi-line labels
416 
417  // Adds '<' or '>', or user-defined symbol to the label string pointing to the
418  // direction of the line / polygon ring
419  // Works only if Placement == Line
423  DirectionSymbols placeDirectionSymbol; // whether to place left/right, above or below label
425 
427  int decimals;
428  bool plusSign;
429 
430  //-- placement
431 
433  unsigned int placementFlags;
434 
435  bool centroidWhole; // whether centroid calculated from whole or visible polygon
436  bool centroidInside; // whether centroid-point calculated must be inside polygon
437 
443  QVector< PredefinedPointPosition > predefinedPositionOrder;
444 
448  double dist; // distance from the feature (in mm)
449  bool distInMapUnits; //true if distance is in map units (otherwise in mm)
453 
457 
458  // offset labels of point/centroid features default to center
459  // move label to quadrant: left/down, don't move, right/up (-1, 0, 1)
461 
462  double xOffset; // offset from point in mm or map units
463  double yOffset; // offset from point in mm or map units
464  bool labelOffsetInMapUnits; //true if label offset is in map units (otherwise in mm)
466  double angleOffset; // rotation applied to offset labels
467  bool preserveRotation; // preserve predefined rotation data during label pin/unpin operations
468 
469  double maxCurvedCharAngleIn; // maximum angle between inside curved label characters (defaults to 20.0, range 20.0 to 60.0)
470  double maxCurvedCharAngleOut; // maximum angle between outside curved label characters (defaults to -20.0, range -20.0 to -95.0)
471 
472  int priority; // 0 = low, 10 = high
473 
474  //-- rendering
475 
477  int scaleMin;
478  int scaleMax;
479 
480  bool fontLimitPixelSize; // true is label should be limited by fontMinPixelSize/fontMaxPixelSize
481  int fontMinPixelSize; // minimum pixel size for showing rendered map unit labels (1 - 1000)
482  int fontMaxPixelSize; // maximum pixel size for showing rendered map unit labels (1 - 10000)
483 
484  bool displayAll; // if true, all features will be labelled even though overlaps occur
485  UpsideDownLabels upsidedownLabels; // whether, or how, to show upsidedown labels
486 
487  bool labelPerPart; // whether to label every feature's part or only the biggest one
489 
490  bool limitNumLabels; // whether to limit the number of labels to be drawn
491  int maxNumLabels; // maximum number of labels to be drawn
492 
493  double minFeatureSize; // minimum feature size to be labelled (in mm)
494  bool obstacle; // whether features for layer are obstacles to labels of other layers
495 
500 
504 
506  double zIndex;
507 
508  // called from register feature hook
509  void calculateLabelSize( const QFontMetricsF *fm, QString text, double &labelX, double &labelY, QgsFeature *f = nullptr, QgsRenderContext *context = nullptr );
510 
523  void registerFeature( QgsFeature &f, QgsRenderContext &context, QgsLabelFeature **labelFeature = nullptr, QgsGeometry *obstacleGeometry = nullptr );
524 
525  void readFromLayer( QgsVectorLayer *layer );
526  void writeToLayer( QgsVectorLayer *layer );
527 
531  void readXml( QDomElement &elem );
532 
536  QDomElement writeXml( QDomDocument &doc );
537 
542  QgsPropertyCollection &dataDefinedProperties() { return mDataDefinedProperties; }
543 
548  const QgsPropertyCollection &dataDefinedProperties() const { return mDataDefinedProperties; }
549 
555  void setDataDefinedProperties( const QgsPropertyCollection &collection ) { mDataDefinedProperties = collection; }
556 
561  const QgsTextFormat &format() const { return mFormat; }
562 
568  void setFormat( const QgsTextFormat &format ) { mFormat = format; }
569 
570  // temporary stuff: set when layer gets prepared or labeled
571  QgsFeature *mCurFeat = nullptr;
574  const QgsMapToPixel *xform = nullptr;
576 
580  int mFeaturesToLabel; // total features that will probably be labeled, may be less (figured before PAL)
581  int mFeatsSendingToPal; // total features tested for sending into PAL (relative to maxNumLabels)
582  int mFeatsRegPal; // number of features registered in PAL, when using limitNumLabels
583 
584  private:
585 
589  void readOldDataDefinedPropertyMap( QgsVectorLayer *layer, QDomElement *parentElem );
590 
594  void readOldDataDefinedProperty( QgsVectorLayer *layer, QgsPalLayerSettings::Property p );
595 
596  enum DataDefinedValueType
597  {
598  DDBool,
599  DDInt,
600  DDIntPos,
601  DDDouble,
602  DDDoublePos,
603  DDRotation180,
604  DDTransparency,
605  DDString,
606  DDUnits,
607  DDColor,
608  DDJoinStyle,
609  DDBlendMode,
610  DDPointF
611  };
612 
613  // convenience data defined evaluation function
614  bool dataDefinedValEval( DataDefinedValueType valType,
616  QVariant &exprVal, QgsExpressionContext &context, const QVariant &originalValue = QVariant() );
617 
618  void parseTextStyle( QFont &labelFont,
619  QgsUnitTypes::RenderUnit fontunits,
620  QgsRenderContext &context );
621 
622  void parseTextBuffer( QgsRenderContext &context );
623 
624  void parseTextFormatting( QgsRenderContext &context );
625 
626  void parseShapeBackground( QgsRenderContext &context );
627 
628  void parseDropShadow( QgsRenderContext &context );
629 
632  bool checkMinimumSizeMM( const QgsRenderContext &ct, const QgsGeometry &geom, double minSize ) const;
633 
636  void registerObstacleFeature( QgsFeature &f, QgsRenderContext &context, QgsLabelFeature **obstacleFeature, QgsGeometry *obstacleGeometry = nullptr );
637 
638  QMap<Property, QVariant> dataDefinedValues;
639 
641  QgsPropertyCollection mDataDefinedProperties;
642 
643  QgsExpression *expression = nullptr;
644 
645  QFontDatabase mFontDB;
646 
647  QgsTextFormat mFormat;
648 
649  static const QVector< PredefinedPointPosition > DEFAULT_PLACEMENT_ORDER;
650 
651  static void initPropertyDefinitions();
652 
654  static QgsPropertiesDefinition sPropertyDefinitions;
655 
656 };
657 
660 class CORE_EXPORT QgsLabelCandidate
661 {
662  public:
663  QgsLabelCandidate( const QRectF &r, double c ): rect( r ), cost( c ) {}
664 
665  QRectF rect;
666  double cost;
667 };
668 
669 
670 
671 
676 class CORE_EXPORT QgsLabelingResults
677 {
678  public:
681 
683  QgsLabelingResults( const QgsLabelingResults & ) = delete;
685  QgsLabelingResults &operator=( const QgsLabelingResults &rh ) = delete;
686 
688  QList<QgsLabelPosition> labelsAtPosition( const QgsPoint &p ) const;
690  QList<QgsLabelPosition> labelsWithinRect( const QgsRectangle &r ) const;
691 
692  private:
693 
694  QgsLabelSearchTree *mLabelSearchTree = nullptr;
695 
696  friend class QgsPalLabeling;
699 };
700 
704 class CORE_EXPORT QgsPalLabeling
705 {
706  public:
707 
708  QgsPalLabeling();
709  ~QgsPalLabeling();
710 
711  void numCandidatePositions( int &candPoint, int &candLine, int &candPolygon );
712  void setNumCandidatePositions( int candPoint, int candLine, int candPolygon );
713 
714  enum Search { Chain, Popmusic_Tabu, Popmusic_Chain, Popmusic_Tabu_Chain, Falp };
715 
716  void setSearchMethod( Search s );
717  Search searchMethod() const;
718 
719  bool isShowingCandidates() const;
720  void setShowingCandidates( bool showing );
721 
722  bool isShowingAllLabels() const;
723  void setShowingAllLabels( bool showing );
724 
725  bool isShowingPartialsLabels() const;
726  void setShowingPartialsLabels( bool showing );
727 
729  bool isDrawingOutlineLabels() const;
730  void setDrawingOutlineLabels( bool outline );
731 
737  bool drawLabelRectOnly() const;
738 
745  void setDrawLabelRectOnly( bool drawRect );
746 
749  static bool staticWillUseLayer( QgsVectorLayer *layer );
750 
752  static void drawLabelCandidateRect( pal::LabelPosition *lp, QPainter *painter, const QgsMapToPixel *xform, QList<QgsLabelCandidate> *candidates = nullptr );
753 
755  void loadEngineSettings();
756  void saveEngineSettings();
757 
766  static QgsGeometry prepareGeometry( const QgsGeometry &geometry, QgsRenderContext &context, const QgsCoordinateTransform &ct, QgsGeometry *clipGeometry = nullptr );
767 
776  static bool geometryRequiresPreparation( const QgsGeometry &geometry, QgsRenderContext &context, const QgsCoordinateTransform &ct, QgsGeometry *clipGeometry = nullptr );
777 
785  static QStringList splitToLines( const QString &text, const QString &wrapCharacter );
786 
794  static QStringList splitToGraphemes( const QString &text );
795 
796  protected:
798  static void dataDefinedTextStyle( QgsPalLayerSettings &tmpLyr,
799  const QMap< QgsPalLayerSettings::Property, QVariant > &ddValues );
800 
802  static void dataDefinedTextFormatting( QgsPalLayerSettings &tmpLyr,
803  const QMap< QgsPalLayerSettings::Property, QVariant > &ddValues );
804 
806  static void dataDefinedTextBuffer( QgsPalLayerSettings &tmpLyr,
807  const QMap< QgsPalLayerSettings::Property, QVariant > &ddValues );
808 
810  static void dataDefinedShapeBackground( QgsPalLayerSettings &tmpLyr,
811  const QMap< QgsPalLayerSettings::Property, QVariant > &ddValues );
812 
814  static void dataDefinedDropShadow( QgsPalLayerSettings &tmpLyr,
815  const QMap< QgsPalLayerSettings::Property, QVariant > &ddValues );
816 
817  friend class QgsVectorLayerLabelProvider; // to allow calling the static methods above
818  friend class QgsDxfExport; // to allow calling the static methods above
819 
820  void deleteTemporaryData();
821 
829  static bool checkMinimumSizeMM( const QgsRenderContext &context, const QgsGeometry *geom, double minSize );
830 
832  QHash<QString, QgsVectorLayerLabelProvider *> mLabelProviders;
834  QHash<QString, QgsVectorLayerDiagramProvider *> mDiagramProviders;
836 
838  QgsLabelingEngine *mEngine = nullptr;
839 
840  // list of candidates from last labeling
841  QList<QgsLabelCandidate> mCandidates;
842 
843  friend class QgsPalLayerSettings;
844 };
845 
846 #endif // QGSPALLABELING_H
Label below point, slightly right of center.
QgsRectangle labelRect
Class for parsing and evaluation of expressions (formerly called "search strings").
A rectangle specified with double values.
Definition: qgsrectangle.h:36
Label on bottom-left of point.
A class to query the labeling structure at a given point (small wraper around pal RTree class) ...
UpsideDownLabels upsidedownLabels
double obstacleFactor
Obstacle factor, where 1.0 = default, < 1.0 more likely to be covered by labels, 1.0 less likely to be covered
Label on top-left of point.
QgsLabelCandidate(const QRectF &r, double c)
PredefinedPointPosition
Positions for labels when using the QgsPalLabeling::OrderedPositionsAroundPoint placement mode...
Candidates are placed in predefined positions around a point. Preference is given to positions with g...
QuadrantPosition quadOffset
Class that adds extra information to QgsLabelFeature for text labels.
Container of fields for a vector layer.
Definition: qgsfields.h:39
Label on top of point, slightly right of center.
The QgsVectorLayerLabelProvider class implements a label provider for vector layers.
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:79
bool drawLabels
Whether to draw labels for this layer.
QgsMapUnitScale repeatDistanceMapUnitScale
QHash< QString, QgsVectorLayerDiagramProvider * > mDiagramProviders
hashtable of diagram providers (key = layer ID)
MultiLineAlign multilineAlign
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:136
QHash< QString, QgsVectorLayerLabelProvider * > mLabelProviders
hashtable of label providers, being filled during labeling (key = layer ID)
QVector< PredefinedPointPosition > predefinedPositionOrder
Ordered list of predefined label positions for points.
QVector< QgsPoint > cornerPoints
QgsCoordinateTransform ct
void setFormat(const QgsTextFormat &format)
Sets the label text formatting settings, e.g., font settings, buffer settings, etc.
double zIndex
Z-Index of label, where labels with a higher z-index are rendered on top of labels with a lower z-ind...
QgsStringReplacementCollection substitutions
Substitution collection for automatic text substitution with labels.
Arranges candidates following the curvature of a line feature. Applies to line layers only...
The QgsMapSettings class contains configuration for rendering of the map.
Place direction symbols on left/right of label.
Perform transforms between map coordinates and device coordinates.
Definition: qgsmaptopixel.h:34
Property
Data definable properties.
ObstacleType obstacleType
Controls how features act as obstacles for labels.
const QgsPropertyCollection & dataDefinedProperties() const
Returns a reference to the label&#39;s property collection, used for data defined overrides.
Label on left of point.
Offset distance applies from point geometry.
void setDataDefinedProperties(const QgsPropertyCollection &collection)
Sets the label&#39;s property collection, used for data defined overrides.
QgsPalLayerSettings mInvalidLayerSettings
The QgsVectorLayerDiagramProvider class implements support for diagrams within the labeling engine...
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
struct pal::_chain Chain
Arranges candidates in a circle around a point (or centroid of a polygon). Applies to point or polygo...
Upside-down labels (90 <= angle < 270) are shown upright.
OffsetType
Behavior modifier for label offset and distance, only applies in some label placement modes...
SizeUnit
Units used for option sizes, before being converted to rendered sizes.
A class to represent a point.
Definition: qgspoint.h:37
Offset distance applies from rendered symbol bounds.
const QgsTextFormat & format() const
Returns the label text formatting settings, e.g., font settings, buffer settings, etc...
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.
Place direction symbols on above label.
Stores the settings for rendering of all diagrams for a layer.
unsigned int placementFlags
Placement
Placement modes which determine how label candidates are generated for a feature. ...
The QgsLabelingEngine class provides map labeling functionality.
Arranges candidates over a point (or centroid of a polygon), or at a preset offset from the point...
Contains information about the context of a rendering operation.
The QgsLabelFeature class describes a feature that should be used within the labeling engine...
QgsGeometry extentGeom
QgsLabelPosition(int id, double r, const QVector< QgsPoint > &corners, const QgsRectangle &rect, double w, double h, const QString &layer, const QString &labeltext, const QFont &labelfont, bool upside_down, bool diagram=false, bool pinned=false, const QString &providerId=QString())
QgsMapUnitScale distMapUnitScale
Struct for storing maximum and minimum scales for measurements in map units.
bool fitInPolygonOnly
True if only labels which completely fit within a polygon are allowed.
A collection of string replacements (specified using QgsStringReplacement objects).
OffsetType offsetType
Offset type for layer (only applies in certain placement modes)
bool useSubstitutions
True if substitutions should be applied.
Label below point, slightly left of center.
Class for doing transforms between two map coordinate systems.
LabelPosition is a candidate feature label position.
Definition: labelposition.h:52
Label on top of point, slightly left of center.
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
Label on right of point.
bool isExpression
Is this label made from a expression string, e.g., FieldName || &#39;mm&#39;.
Class that stores computed placement from labeling engine.
LinePlacementFlags
Line placement flags, which control how candidates are generated for a linear feature.
QList< QgsLabelCandidate > mCandidates
Show upside down when rotation is layer- or data-defined.
Container for all settings relating to text rendering.
Represents a vector layer which manages a vector based data sets.
QgsMapUnitScale labelOffsetMapUnitScale
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:95
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the label&#39;s property collection, used for data defined overrides.
ObstacleType
Valid obstacle types, which affect how features within the layer will act as obstacles for labels...
DirectionSymbols placeDirectionSymbol
Arranges candidates scattered throughout a polygon feature. Candidates are rotated to respect the pol...