SLD (Styled Layer Descriptor) format is an OGC (Open Geospatial Consortium) standard ideal for describing the style of map layers. Below are a few examples of its implementation for Geoconcept Web vector layers. To find out more about this standard consult http://www.opengeospatial.org/standards/sld
Tip | |
---|---|
To enable display of objects as a function of the value of a field, as in the examples that follow, it is necessary to activate them in the definition of the fields of the vector layers, by clicking on Show. |
The "societe" field has a value of "CVG" or "CICG".
<sld:StyledLayerDescriptor xmlns:sld="http://www.opengis.net/sld" version="1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml"> <sld:NamedLayer> <sld:Name/> <sld:UserStyle> <sld:Name>Style</sld:Name> <sld:IsDefault>1</sld:IsDefault> <sld:FeatureTypeStyle> <sld:Rule> <ogc:Filter> <ogc:PropertyIsEqualTo> <ogc:PropertyName>societe</ogc:PropertyName> <ogc:Literal>CVG</ogc:Literal> </ogc:PropertyIsEqualTo> </ogc:Filter> <sld:MinScaleDenominator>1</sld:MinScaleDenominator> <sld:MaxScaleDenominator>12</sld:MaxScaleDenominator> <sld:LineSymbolizer> <sld:Stroke> <sld:CssParameter name="stroke">#000000</sld:CssParameter> <sld:CssParameter name="stroke-opacity">1</sld:CssParameter> <sld:CssParameter name="stroke-width">2</sld:CssParameter> <sld:CssParameter name="stroke-linecap">round</sld:CssParameter> </sld:Stroke> </sld:LineSymbolizer> </sld:Rule> <sld:Rule> <ogc:Filter> <ogc:PropertyIsEqualTo> <ogc:PropertyName>societe</ogc:PropertyName> <ogc:Literal>CICG</ogc:Literal> </ogc:PropertyIsEqualTo> </ogc:Filter> <sld:MinScaleDenominator>1</sld:MinScaleDenominator> <sld:MaxScaleDenominator>12</sld:MaxScaleDenominator> <sld:LineSymbolizer> <sld:Stroke> <sld:CssParameter name="stroke">#990099</sld:CssParameter> <sld:CssParameter name="stroke-opacity">1</sld:CssParameter> <sld:CssParameter name="stroke-width">2</sld:CssParameter> <sld:CssParameter name="stroke-linecap">round</sld:CssParameter> </sld:Stroke> </sld:LineSymbolizer> </sld:Rule> </sld:FeatureTypeStyle> </sld:UserStyle> </sld:NamedLayer> </sld:StyledLayerDescriptor>
The "genre_de_client" field has a value of "", "Consommateur" or "En attente".
<sld:StyledLayerDescriptor xmlns:sld="http://www.opengis.net/sld" version="1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml"> <sld:NamedLayer> <sld:Name/> <sld:UserStyle> <sld:Name>Style</sld:Name> <sld:IsDefault>1</sld:IsDefault> <sld:FeatureTypeStyle> <sld:Rule> <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"> <ogc:PropertyIsEqualTo> <ogc:PropertyName>genre_de_client</ogc:PropertyName> <ogc:Literal/> </ogc:PropertyIsEqualTo> </ogc:Filter> <sld:MinScaleDenominator>1</sld:MinScaleDenominator> <sld:MaxScaleDenominator>9</sld:MaxScaleDenominator> <sld:PointSymbolizer> <sld:Graphic> <sld:ExternalGraphic> <sld:OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="/geoconcept-web/Image/showImage.do?id=290"/> <sld:Format>image/png</sld:Format> <sld:GraphicXOffset>-15</sld:GraphicXOffset> <sld:GraphicYOffset>-15</sld:GraphicYOffset> </sld:ExternalGraphic> <sld:Opacity>1</sld:Opacity> <sld:Size>30</sld:Size> </sld:Graphic> </sld:PointSymbolizer> </sld:Rule> <sld:Rule> <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"> <ogc:PropertyIsEqualTo> <ogc:PropertyName>genre_de_client</ogc:PropertyName> <ogc:Literal>Consommateur</ogc:Literal> </ogc:PropertyIsEqualTo> </ogc:Filter> <sld:MinScaleDenominator>1</sld:MinScaleDenominator> <sld:MaxScaleDenominator>9</sld:MaxScaleDenominator> <sld:PointSymbolizer> <sld:Graphic> <sld:ExternalGraphic> <sld:OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="/geoconcept-web/Image/showImage.do?id=289"/> <sld:Format>image/png</sld:Format> <sld:GraphicXOffset>-10</sld:GraphicXOffset> <sld:GraphicYOffset>-10</sld:GraphicYOffset> </sld:ExternalGraphic> <sld:Opacity>1</sld:Opacity> <sld:Size>20</sld:Size> </sld:Graphic> </sld:PointSymbolizer> </sld:Rule> <sld:Rule> <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"> <ogc:PropertyIsEqualTo> <ogc:PropertyName>genre_de_client</ogc:PropertyName> <ogc:Literal>En attente</ogc:Literal> </ogc:PropertyIsEqualTo> </ogc:Filter> <sld:MinScaleDenominator>1</sld:MinScaleDenominator> <sld:MaxScaleDenominator>9</sld:MaxScaleDenominator> <sld:PointSymbolizer> <sld:Graphic> <sld:Mark> <sld:WellKnownName>square</sld:WellKnownName> <sld:Fill> <sld:CssParameter name="fill">#FFFF00</sld:CssParameter> </sld:Fill> <sld:Stroke> <sld:CssParameter name="stroke">#000000</sld:CssParameter> <sld:CssParameter name="stroke-width">1</sld:CssParameter> </sld:Stroke> </sld:Mark> <sld:Size>20</sld:Size> </sld:Graphic> </sld:PointSymbolizer> </sld:Rule> </sld:FeatureTypeStyle> </sld:UserStyle> </sld:NamedLayer> </sld:StyledLayerDescriptor>
The "statut" field has a value of "Vert" or "Violet". Text labels displayed are sourced by the "delai_projete" and "source_d_energie" fields.
<?xml version="1.0" encoding="UTF-8"?> <sld:StyledLayerDescriptor xmlns:sld="http://www.opengis.net/sld" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd"> <sld:NamedLayer> <sld:Name>Note</sld:Name> <sld:UserStyle> <sld:Name>Style</sld:Name> <sld:IsDefault>1</sld:IsDefault> <sld:FeatureTypeStyle> <sld:Rule> <ogc:Filter> <ogc:PropertyIsEqualTo> <ogc:PropertyName>statut</ogc:PropertyName> <ogc:Literal>Vert</ogc:Literal> </ogc:PropertyIsEqualTo> </ogc:Filter> <sld:MinScaleDenominator>1</sld:MinScaleDenominator> <sld:MaxScaleDenominator>9</sld:MaxScaleDenominator> <sld:PointSymbolizer> <sld:Graphic> <Mark> <WellKnownName>circle</WellKnownName> <Fill> <CssParameter name="fill">#00FF00</CssParameter> </Fill> </Mark> <Size>24</Size> </sld:Graphic> <sld:Label> <ogc:PropertyName>delai_projete</ogc:PropertyName> <![CDATA[ ]]> <ogc:PropertyName>source_d_energie</ogc:PropertyName> </sld:Label> <Fill> <CssParameter name="fill">#000000</CssParameter> </Fill> <Font> <CssParameter name="font-size">10</CssParameter> </Font> <LabelPlacement> <Displacement> <DisplacementX>0</DisplacementX> <DisplacementY>15</DisplacementY> </Displacement> </LabelPlacement> </sld:PointSymbolizer> </sld:Rule> <sld:Rule> <ogc:Filter> <ogc:PropertyIsEqualTo> <ogc:PropertyName>statut</ogc:PropertyName> <ogc:Literal>Violet</ogc:Literal> </ogc:PropertyIsEqualTo> </ogc:Filter> <sld:MinScaleDenominator>1</sld:MinScaleDenominator> <sld:MaxScaleDenominator>9</sld:MaxScaleDenominator> <sld:PointSymbolizer> <sld:Graphic> <Mark> <WellKnownName>circle</WellKnownName> <Fill> <CssParameter name="fill">#9020FF</CssParameter> </Fill> </Mark> <Size>24</Size> </sld:Graphic> <sld:Label> <ogc:PropertyName>delai_projete</ogc:PropertyName> <![CDATA[ ]]> <ogc:PropertyName>source_d_energie</ogc:PropertyName> </sld:Label> <Fill> <CssParameter name="fill">#000000</CssParameter> </Fill> <Font> <CssParameter name="font-size">10</CssParameter> </Font> <LabelPlacement> <Displacement> <DisplacementX>0</DisplacementX> <DisplacementY>15</DisplacementY> </Displacement> </LabelPlacement> </sld:PointSymbolizer> </sld:Rule> </sld:FeatureTypeStyle> </sld:UserStyle> </sld:NamedLayer> </sld:StyledLayerDescriptor>