Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

If you want to manually edit the SLD for the selected Layer then click on the Advanced tab. 

Note

If you manually edit the SLD via the Advanced tab and you add entries that cannot be handled by the SLD Style Editor then the Advanced tab will be your only option.

Image RemovedImage Added

Table of Contents

...

Here you can manually configure the style of your OGC Layer. Astun supply some default SLD files in the folder specified in the iShare Settings General tab SldSnippetDefinitionPath. For more information on SLD please refer to the GeoServer documentation which has plenty of examples http://docs.geoserver.org/stable/en/user/styling/sld-cookbook/index.html.

Toolbar

There is a Toolbar at the top of the Editing pane for common functions:

...

  • Undo - the last action
  • Redo - the last action
  • Cut - the selected data
  • Copy - the selected data to the clipboard
  • Paste - from the clipboard into the cursor position
  • Currently available snippets - allows you to insert a selected snippet at the current cursor position.
  • Format the SLD - clicking this button will format the SLD for you.Import an external SLD - clicking this button will open the File Explorer for you to browse to an external SLD to load. 


Code Block
titleExample Area SLD
collapsetrue
<Rule>
	<Name>Ward</Name>
	<PolygonSymbolizer>
		<Fill>
			<CssParameter name="fill">#008000</CssParameter>
			<CssParameter name="fill-opacity">0.25</CssParameter>
		</Fill>
		<Stroke>
			<CssParameter name="stroke">#004000</CssParameter>
			<CssParameter name="stroke-width">2</CssParameter>
			<CssParameter name="stroke-opacity">1</CssParameter>
		</Stroke>
	</PolygonSymbolizer>
	<TextSymbolizer>
		<Label>
			<ogc:PropertyName>name</ogc:PropertyName>
		</Label>
		<Font>
			<CssParameter name="font-family">arlrdbd</CssParameter>
			<CssParameter name="font-size">11</CssParameter>
		</Font>
		<LabelPlacement>
			<PointPlacement>
				<AnchorPoint>
					<AnchorPointX>0.5</AnchorPointX>
					<AnchorPointY>0.5</AnchorPointY>
				</AnchorPoint>
				<Displacement>
					<DisplacementX>0</DisplacementX>
					<DisplacementY>0</DisplacementY>
				</Displacement>
			</PointPlacement>
		</LabelPlacement>
		<Fill>
			<CssParameter name="fill">#004000</CssParameter>
		</Fill>
		<Halo>
			<Radius>0</Radius>
			<Fill>
				<CssParameter name="fill"></CssParameter>
			</Fill>
		</Halo>
	</TextSymbolizer>
</Rule>

...

Status
colourYellow
title5.8.2+
 
Status
colourYellow
title5.6.30+

You may have the Layer styled in QGIS and you can save the SLD from QGIS and then import it into the SLD Style Editor.

...

Any Rules with empty literals (typically added automatically by QGIS) will be removed upon Import e.g.

Paste code macro
<Rule>
  <Name></Name>
  <Description>
	<Title>ogc_fid is ''</Title>
  </Description>
  <Filter xmlns:ogc="http://www.opengis.net/ogc">
	<PropertyIsEqualTo>
	  <PropertyName>ogc_fid</PropertyName>
	  <Literal></Literal>
	</PropertyIsEqualTo>
  </Filter>
  <PolygonSymbolizer>
	<Fill>
	  <SvgParameter name="fill">#96ce6e</SvgParameter>
	</Fill>
	<Stroke>
	  <SvgParameter name="stroke">#000001</SvgParameter>
	  <SvgParameter name="stroke-width">1</SvgParameter>
	  <SvgParameter name="stroke-linejoin">bevel</SvgParameter>
	</Stroke>
  </PolygonSymbolizer>
</Rule>
  • In Studio, select the Layer to which you wish to apply the SLD and click Modify Style.
  • Select the Advanced tab.
  • Click on the Import an external SLD icon on the toolbar.
  • Click OK to return to the Layer.

  • Save your changes.

Using an existing SLD - Prior to Import function

Prior to iShare V5.6.30 or V5.8.2 you may still use an existing SLD that you wish to use to style your OGC Layer in iShare but you will first need to follow the steps below:

  • In Studio, select the Layer to which you wish to apply the SLD and click Modify Style.
  • Select the Advanced tab.
  • Edit the original SLD in in a text editor, such as Notepad++ - see Steps 4-7 below for Using an SLD exported from QGIS.
Note
Prior to V5.6.0 you could only have one Rule per OGC Layer.

Using Multiple Rules

Status
colourYellow
title5.6.0+

...

Code Block
titleMultiple Rules
collapsetrue
<Rule>
  <Name>Unitary Authorities</Name>
  <Filter>
    <PropertyIsEqualTo>
      <PropertyName>descriptio</PropertyName>
      <Literal>Unitary Authority</Literal>
    </PropertyIsEqualTo>
  </Filter>
  <PolygonSymbolizer>
    <Stroke>
      <CssParameter name="stroke">#FF0000</CssParameter>
      <CssParameter name="stroke-width">2</CssParameter>
      <CssParameter name="stroke-opacity">1</CssParameter>
    </Stroke>
  </PolygonSymbolizer>
</Rule>
<Rule>
  <Name>Districts</Name>
  <Filter>
    <PropertyIsEqualTo>
      <PropertyName>descriptio</PropertyName>
      <Literal>District</Literal>
    </PropertyIsEqualTo>
  </Filter>
  <PolygonSymbolizer>
    <Stroke>
      <CssParameter name="stroke">#000066</CssParameter>
      <CssParameter name="stroke-width">2</CssParameter>
      <CssParameter name="stroke-opacity">1</CssParameter>
    </Stroke>
  </PolygonSymbolizer>
</Rule>
<Rule>
  <Name>Counties</Name>
  <Filter>
    <PropertyIsEqualTo>
      <PropertyName>descriptio</PropertyName>
      <Literal>County</Literal>
    </PropertyIsEqualTo>
  </Filter>
  <PolygonSymbolizer>
    <Stroke>
      <CssParameter name="stroke">#0000FF</CssParameter>
      <CssParameter name="stroke-width">2</CssParameter>
      <CssParameter name="stroke-opacity">1</CssParameter>
    </Stroke>
  </PolygonSymbolizer>
</Rule>
<Rule>
  <Name>Metropolitan Districts</Name>
  <Filter>
    <PropertyIsEqualTo>
      <PropertyName>descriptio</PropertyName>
      <Literal>Metropolitan District</Literal>
    </PropertyIsEqualTo>
  </Filter>
  <PolygonSymbolizer>
    <Stroke>
      <CssParameter name="stroke">#006600</CssParameter>
      <CssParameter name="stroke-width">2</CssParameter>
      <CssParameter name="stroke-opacity">1</CssParameter>
    </Stroke>
  </PolygonSymbolizer>
</Rule>
<Rule>
  <Name>London Boroughs</Name>
  <Filter>
    <PropertyIsEqualTo>
      <PropertyName>descriptio</PropertyName>
      <Literal>London Borough</Literal>
    </PropertyIsEqualTo>
  </Filter>
  <PolygonSymbolizer>
    <Stroke>
      <CssParameter name="stroke">#6600FF</CssParameter>
      <CssParameter name="stroke-width">2</CssParameter>
      <CssParameter name="stroke-opacity">1</CssParameter>
    </Stroke>
  </PolygonSymbolizer>
</Rule>
<Rule>
  <Name>Greater London Authority</Name>
  <Filter>
    <PropertyIsEqualTo>
      <PropertyName>descriptio</PropertyName>
      <Literal>Greater London Authority</Literal>
    </PropertyIsEqualTo>
  </Filter>
  <PolygonSymbolizer>
    <Stroke>
      <CssParameter name="stroke">#00FFFF</CssParameter>
      <CssParameter name="stroke-width">2</CssParameter>
      <CssParameter name="stroke-opacity">1</CssParameter>
    </Stroke>
  </PolygonSymbolizer>
</Rule>

...

Open the DB Manager in QGIS, find the Layer you wish to style and select Add to canvas.

...

Image Removed

...

Now select the Layer in the Layers Panel in QGIS, right click and select Properties.

...

Image Removed

...

You will see a Style button with a drop down selection.

Select Save Style > SLD File... and save it to a location of your choice.

If you have iShare V5.6.30 or V5.8.2 (or greater) then you can stop here and use the Import an external SLD function in the SLD Style Editor on the Advanced tab.

...

Image Removed

...

These steps are only required if your iShare version is prior to V5.6.30 or V5.8.2.

Now we need to extract the information from this SLD and paste it into the SLD Style Editor.

Open the SLD in a text editor e.g. Notepad++

Now you need to remove all references to the namespace in our example below this is se:

...

Image Removed

...

Image Removed

...

Now you need to extract just the <Rule> information.

Our example above just has one Rule but yours may have several so, if you are using v5.6.0 or above, then you can extract them all.

Now you can paste this information into the Advanced tab of the SLD Style Editor - replacing any existing entries.

...

Image Removed

...

Click OK to return to the Layer

...