Usage of SID

Feedback


SLD (Styled-Layer Descriptor) defines a variety of styles can be symbolize the WMS service, including the style predefined by the WMS service and the style predefined by the client. Predefined style (STYLES) is the SLD built-in the WMS service, i.e., the <Style> node of the Capabilities XML document. In addition to styles predefined by the WMS service, the client can apply the customized SLD for the WMS service so as to render the layer. Users can add the appropriate parameters to use SLD with GetMap operation. SuperMap iServer currently supports the SLD function in WMS 1.1.1, you can configure the SLD information for points, lines, regions, and text layers. Two methods for styles as follows:

The SLD file is the XML format, which follows the OGC SLD standard, so that it can be understood by the server and the client. A SLD file can define multiple SLD styles. A SLD style defines the symbolization rule of the specified WMS layer. A style can have multiple rules. Each rule can contain multiple filters and multiple symbolizers.

Usage of Predefined STYLES

The predefined styles are built in the WMS service, which are present as the <Style> node of the Capabilities XML document. About publishing SLD as styles predefined by the SuperMap iServer service, please see Adding WMS Service Interface. The predefined styles are requested by STYLES=style_list, and the request method is as follows:

<ServiceRoot>?VERSION=version&REQUEST=GetMap&LAYERS=&STYLES=&SRS=&BBOX=&WIDTH=&HEIGHT=&FORMAT=

ServiceRoot is the service URI root directory. Please see Setting the Service URI.

SuperMap iServer contains a SLD file used for rendering the region layer: %SuperMap iServer_HOME%\webapps\iserver\WEB-INF\config\region.sld by default, defines a style named World, and starts an iServer service (i.e., released in the form of the predefined style). After the SuperMap iServer WMS 1.1.1 service is started on the local machine, then the URL used the GetMap request of this style is: http://localhost:8090/iserver/services/maps/wms111/WorldMap_Day?VERSION=1.1.1&REQUEST=GetMap&layers=0.10&STYLES=World&SRS=EPSG:4326&BBOX=-180.0,-90.0,180.0,90.0&WIDTH=800&HEIGHT=400&FORMAT=image/png. The response result of this request is as follows:

Usage of Customized STYLES

The client can apply the customized SLD on the WMS service so as to render the layer. There are two ways to render the layer with the customized SLD:

Render the requested map by introducing the URI of the SLD document, i.e., adding the SLD = sld_xml_uri GetMap parameters in the GetMap request, in which sld_xml_uri must can be accessed by the WMS server. The request method is as follows:

<ServiceRoot>?VERSION=version&REQUEST=GetMap&LAYERS=&STYLES=&SRS=&BBOX=&WIDTH=&HEIGHT=&FORMAT=&SLD=

ServiceRoot is the service URI root directory. Please see Setting the Service URI.

Render the requested map by introducing the practical content of the SLD document, i.e., adding the SLD_BODY=sld_xml_body parameters in the GetMap request, in which sld_body_xml must be encoded by URI. The request method is as follows:

<ServiceRoot>?VERSION=version&REQUEST=GetMap&LAYERS=&STYLES=&SRS=&BBOX=&WIDTH=&HEIGHT=&FORMAT=&SLD_BODY=

ServiceRoot is the service URI root directory. Please see Setting the Service URI.

The following is a SLD document:

 <?xml version="1.0" encoding="UTF-8"?>

<sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld"

        xmlns:sld="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc"

        xmlns:gml="http://www.opengis.net/gml" version="1.0.0">

        <sld:UserLayer>

                <sld:UserStyle>

                        <sld:Name>lineStyle</sld:Name>

                        <sld:FeatureTypeStyle>

                                <sld:FeatureTypeName>Feature</sld:FeatureTypeName>

                                <sld:Rule>

                                        <sld:LineSymbolizer>

                                                <sld:Stroke>

                                                        <sld:CssParameter name="stroke">#0000FF

                                                        </sld:CssParameter>

                                                        <sld:CssParameter name="stroke-width">0.1</sld:CssParameter>

                                                </sld:Stroke>

                                        </sld:LineSymbolizer>

                                </sld:Rule>

                        </sld:FeatureTypeStyle>

                </sld:UserStyle>

        </sld:UserLayer>

</sld:StyledLayerDescriptor>

The sample with the above GetMap request of SLD_BODY is as follows:

http://localhost:8090/iserver/services/maps/wms111/World?VERSION=1.1.1&REQUEST=GetMap&LAYERS=0.10&STYLES=lineStyle&SRS=EPSG%3A4326&BBOX=-180.0,-90.0,180.0,90.0&WIDTH=800&HEIGHT=400&FORMAT=image/png&SLD_BODY=%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csld%3AStyledLayerDescriptor%20xmlns%3D%22http%3A%2F%2Fwww.opengis.net%2Fsld%22%20xmlns%3Asld%3D%22http%3A%2F%2Fwww.opengis.net%2Fsld%22%20xmlns%3Aogc%3D%22http%3A%2F%2Fwww.opengis.net%2Fogc%22%20xmlns%3Agml%3D%22http%3A%2F%2Fwww.opengis.net%2Fgml%22%20version%3D%221.0.0%22%3E%3Csld%3AUserLayer%3E%3Csld%3AUserStyle%3E%3Csld%3AName%3ElineStyle%3C%2Fsld%3AName%3E%3Csld%3AFeatureTypeStyle%3E%3Csld%3AFeatureTypeName%3EFeature%3C%2Fsld%3AFeatureTypeName%3E%3Csld%3ARule%3E%3Csld%3ALineSymbolizer%3E%3Csld%3AStroke%3E%3Csld%3ACssParameter%20name%3D%22stroke%22%3E%230000FF%3C%2Fsld%3ACssParameter%3E%3Csld%3ACssParameter%20name%3D%22stroke-width%22%3E0.1%3C%2Fsld%3ACssParameter%3E%3C%2Fsld%3AStroke%3E%3C%2Fsld%3ALineSymbolizer%3E%3C%2Fsld%3ARule%3E%3C%2Fsld%3AFeatureTypeStyle%3E%3C%2Fsld%3AUserStyle%3E%3C%2Fsld%3AUserLayer%3E%3C%2Fsld%3AStyledLayerDescriptor%3E

The response result of the request is as follows, you can see the line layer: OceanBoundary@World is rendered by blue:

Match Rules of STYLES and SLD/SLD_BODY

User can specify a styles parameter in the GetMap request, or a SLD (SLD_BODY) parameter. Match rules of two parameters are shown in the following table:

Table 1 Match relationship of STYLES and SLD/SLD_BODY in the GetMap request

Whether the request contains the STYLES=style_list parameters Whether the request contains the SLD=sld_xml_uri(SLD_BODY=sld_xml_body) parameters Whether the style name of STYLES matches with the style name of SLD (SLD_BODY) Which kind of style will be used for rendering the WMS map

Mandatory

Optional

  Use the style in STYLES to render the corresponding layer in the LAYERS=layer_list.

Mandatory

Mandatory

Mandatory

Use the style in SLD (SLD_BODY) to render the corresponding layer in the LAYERS=layer_list.

Mandatory

Mandatory

Optional

Use the style in STYLES=style_list to render the corresponding layer in the LAYERS=layer_list.

Optional

Mandatory

  SLD (SLD_BODY) must contain the named layer, using the style in the SLD (SLD_BODY) to render layers identified by the named layer in SLD (SLD_BODY).