.. _anchor-configuration-renderstyles: ========== Map styles ========== Style resources are used to obtain information on how to render geo objects (mostly features, but also coverages) into maps. The most common use case is to reference them from a layer configuration, in order to describe how the layer is to be rendered. This chapter assumes the reader is familiar with basic SLD/SE terms. The style configurations do not depend on any other resource. In contrast to other deegree configurations the style configurations do not have a custom format. You can use standard SLD or SE documents (1.0.0 and 1.1.0 are supported), with a couple of deegree specific extensions, which are described below. Please refer to the SLD_ and SE_ specifications for reference. Additionally this page contains specific examples below. .. _SLD: http://www.opengeospatial.org/standards/sld .. _SE: http://www.opengeospatial.org/standards/se In deegree terms, each SLD or SE file will create a *style store*. In case of an SE file (usually beginning at the FeatureTypeStyle or CoverageStyle level) the style store only contains one style, in case of an SLD file the style store may contain multiple styles, each identified by the layer (only NamedLayers make sense here) and the name of the style (only UserStyles make sense) when referenced later. .. figure:: images/workspace-overview-style.png :figwidth: 80% :width: 80% :target: _images/workspace-overview-style.png Style resources define how geo objects are rendered .. tip:: When defining styles, take note of the log file. Upon startup the log will warn you about potential problems or errors during parsing, and upon rendering warnings will be emitted when rendering is unsuccessful eg. because you had a typo in a geometry property name. When you're seeing an empty map when expecting a fancy one, check the log before reporting a bug. deegree will tolerate a lot of syntactical errors in your style files, but you're more likely to get a good result when your files validate and you have no warnings in the log. ^^^^^^^^ Overview ^^^^^^^^ From the point of view of the Symbology Encoding Standard, there are 5 kinds of symbolizations, which can be present in a map image: * **Point symbolizations** * **Line symbolizations** * **Polygon symbolizations** * **Text symbolizations** * **Raster symbolizations** The first 4 symbolizations usually represent vector feature objects. Raster symbolization is used to visualize raster data. This documentation chapter describes, how those symbolizations can be realized using OGC symbology encoding. It will lead from the underlying basics to some more complex constructions for map visulization. ^^^^^^ Basics ^^^^^^ ________________ General Layout ________________ The general structure of an SE-Style contains: .. code-block:: xml It is constructed like this: .. code-block:: xml plan:yourFeatureType ... .. Tip:: Before you start, always remember that every style is read top-down. So be aware the second will overpaint the first one, the third overpaints the second and so on ___________________ Symbolization Rules ___________________ Every specific map visualization needs its own symbolization rule. Rules are defined within the **** element. Each rule can consist of at least one symbolizer. Every rule has its own name and description elements. The description elements are used to create the legend caption from it. Depending on the type of symbolization to create, one of the following symbolizers can be used: * * * * * Symbolizers can have an uom-attribute (units of measure), which determines the unit of all values set inside the Symbolizer. The following values for UoM are supported within deegree: * uom="pixel" * uom="meter" * uom="mm" The default value is "pixel". Within every symbolizer (except rastersymbolizers), a geometry property used for the rendering, can be specified with the **** element. If there is no geometry specified the first geometry property of the FeatureType will be used. Each of the (Vector-)Symbolizer-elements has its dimensions, which are described in more detail below: * **** has only one dimension: the -element (to style the stroke). * **** has two dimensions: the (to sytle the stroke of the polygon) and the -element (to style the inside of the polygon). * **** can also contain both dimensions: the (to style the stroke of the point) and the -element (to style the inside of the point). * **** has three dimensions: the