styles.rst 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. .. _sld_reference_styles:
  2. Styles
  3. ======
  4. The style elements specify the styling to be applied to a layer.
  5. UserStyle
  6. ---------
  7. The **UserStyle** element defines styling for a layer.
  8. The ``<UserStyle>`` element contains the following elements:
  9. .. list-table::
  10. :widths: 25 15 60
  11. * - **Tag**
  12. - **Required?**
  13. - **Description**
  14. * - ``<Name>``
  15. - No
  16. - The name of the style,
  17. used to reference it externally.
  18. (Ignored for catalog styles.)
  19. * - ``<Title>``
  20. - No
  21. - The title of the style.
  22. * - ``<Abstract>``
  23. - No
  24. - The description for the style.
  25. * - ``<IsDefault>``
  26. - No
  27. - Whether the style is the default one for a named layer.
  28. Used in SLD **Library Mode**.
  29. Values are ``1`` or ``0`` (default).
  30. * - ``<FeatureTypeStyle>``
  31. - 1..N
  32. - Defines the symbology for rendering a single feature type.
  33. FeatureTypeStyle
  34. ----------------
  35. The **FeatureTypeStyle** element specifies the styling
  36. that is applied to a single feature type of a layer.
  37. It contains a list of rules which determine the symbology
  38. to be applied to each feature of a layer.
  39. The ``<FeatureTypeStyle>`` element contains the following elements:
  40. .. list-table::
  41. :widths: 25 15 60
  42. * - **Tag**
  43. - **Required?**
  44. - **Description**
  45. * - ``<Name>``
  46. - No
  47. - Not used at present
  48. * - ``<Title>``
  49. - No
  50. - The title for the style.
  51. * - ``<Abstract>``
  52. - No
  53. - The description for the style.
  54. * - ``<FeatureTypeName>``
  55. - No
  56. - Identifies the feature type the style is to be applied to.
  57. Omitted if the style applies to all features in a layer.
  58. * - ``<Rule>``
  59. - 1..N
  60. - A styling rule to be evaluated. See :ref:`sld_reference_rules`
  61. Usually a layer contains only a single feature type, so the ``<FeatureTypeName>``
  62. is omitted.
  63. Any number of ``<FeatureTypeStyle>`` elements can be specified in a style.
  64. In GeoServer each one is rendered into a separate image buffer.
  65. After all features are rendered the buffers are composited to form the final layer image.
  66. The compositing is done in the order the FeatureTypeStyles are
  67. given in the SLD, with the first one on the bottom
  68. (the "Painter's Model").
  69. This effectively creates "virtual layers",
  70. which can be used to achieve styling effects such as cased lines.