index.rst 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. .. _ysld_reference_symbolizers:
  2. Symbolizers
  3. ===========
  4. The basic unit of visualization is the symbolizer. There are five types of symbolizers: **Point**, **Line**, **Polygon**, **Raster**, and **Text**.
  5. Symbolizers are contained inside :ref:`rules <ysld_reference_rules>`. A rule can contain one or many symbolizers.
  6. .. note:: The most common use case for multiple symbolizers is a geometry (point/line/polygon) symbolizer to draw the features plus a text symbolizer for labeling these features.
  7. .. figure:: img/symbolizers.*
  8. Use of multiple symbolizers
  9. Drawing order
  10. -------------
  11. The order of symbolizers significant, and also the order of your data.
  12. For each feature the rules are evaluated resulting in a list of symbolizers that will be used to draw that feature. The symbolizers are drawn in the order provided.
  13. Consider the following two symbolizers:
  14. .. code-block:: yaml
  15. symbolizers:
  16. - point:
  17. symbols:
  18. - mark:
  19. shape: square
  20. fill-color: '#FFCC00'
  21. - point:
  22. symbols:
  23. - mark:
  24. shape: triangle
  25. fill-color: '#FF3300'
  26. When drawing three points these symbolizers will be applied in order on each feature:
  27. #. Feature 1 is drawn as a square, followed by a triangle:
  28. .. figure:: img/symbolizer-order1.*
  29. Feature 1 buffer rendering
  30. #. Feature 2 is drawn as a square, followed by a triangle. Notice the slight overlap with Feature 1:
  31. .. figure:: img/symbolizer-order2.*
  32. Feature 2 buffer rendering
  33. #. Feature 3 is drawn as a square, followed by a triangle:
  34. .. figure:: img/symbolizer-order3.*
  35. Feature 3 buffer rendering
  36. .. note:: In the final image, Feature 1 and Feature 2 have a slight overlap. This overlap is determined by data order which we have no control over. If you need to control the overlap review the :ref:`ysld_reference_featurestyles` section on managing "z-order".
  37. .. figure:: img/symbolizer-order4.*
  38. Feature style controlling z-order
  39. Matching symbolizers and geometries
  40. -----------------------------------
  41. It is common to match the symbolizer with the type of geometries contained in the layer, but this is not required. The following table illustrates what will happen when a geometry symbolizer is matched up with another type of geometry.
  42. .. list-table::
  43. :class: non-responsive
  44. :header-rows: 1
  45. :stub-columns: 1
  46. * -
  47. - Points
  48. - Lines
  49. - Polygon
  50. - Raster
  51. * - Point Symbolizer
  52. - **Points**
  53. - Midpoint of the lines
  54. - Centroid of the polygons
  55. - Centroid of the raster
  56. * - Line Symbolizer
  57. - n/a
  58. - **Lines**
  59. - Outline (stroke) of the polygons
  60. - Outline (stroke) of the raster
  61. * - Polygon Symbolizer
  62. - n/a
  63. - Will "close" the line and style as a polygon
  64. - **Polygons**
  65. - Will "outline" the raster and style as a polygon
  66. * - Raster Symbolizer
  67. - n/a
  68. - n/a
  69. - n/a
  70. - Transform raster values to color channels for display
  71. * - Text Symbolizer
  72. - Label at point location
  73. - Label at midpoint of lines
  74. - Label at centroid of polygons
  75. - Label at centroid of raster outline
  76. Syntax
  77. ------
  78. The following is the basic syntax common to all symbolizers. Note that the contents of the block are not all expanded here and that each kind of symbolizer provides additional syntax.
  79. ::
  80. geometry: <cql>
  81. uom: <text>
  82. ..
  83. x-composite: <text>
  84. x-composite-base: <boolean>
  85. x-inclusion: <text>
  86. Where:
  87. .. include:: include/symbol.rst
  88. .. include:: include/composite.rst
  89. .. include:: include/inclusion.rst