How to Create a Styled Layer Descriptor (SLD) using Arc2Earth

If you decide to use GeoServer to deploy your Web Services, you will find that part of the process includes creating an SLD or Styled Layer Descriptor for portrayal of the data you intend to publish.  A natural symbology for such layers is an ESRI layer file format.   Using this format initially presented a problem, though; creating an SLD for data with a complicated symbology scheme, such as a geologic map, is not trivial using XML editing software-- even if you have a template to work from.  Many times, conversion from RGB to Hexidecimal is required for each entry in your symbology layer.  Even if one uses a built-in formula converter in Excel (or from various websites), a large amount of hand entry is still required.

In my search for an automated way to process my layer files to SLDs, I came across a software add-in for ArcMap called Arc2Earth.  According to the documentation, it looked like Arc2Earth was going to solve this issue for me. 

Arc2Earth is available in several different Editions:  Community, Professional, Publisher, and Enterprise.  The SLD Tool was available in the Community version, so I decided to give it a try.  I was very impressed with the outcome, the SLDs needed very little customization.

Using the tool

Simply install the Arc2Earth plug-in (for the Community version with the temporary serial number, you will need to click the link at www.arc2earth.com) and add it to your toolbar.  Open the ArcMap project containing the layer or layers you intend to export as SLDs.  Select the layer in the catalog tree.  In the Arc2Earth toolbar, select Export > Export Layer Style to SLD and chose the location on your directory where the file should be located.

 

Screenshot of ArcMap interface with Arc2Earth toolbar present

 

It does not take long for the tool to run.  When it is finished, you can open your .sld in any XML or text editor.  For our applications, we use XMLSpy, but there are many free open source software packages available online. 

One thing to note is that the Arc2Earth plug-in adds an outline (stroke) to polygon layers, so if you are working with polygon layers, it may need to be tailored.  Also, you may want to customize the heading for your SLD, or change the schema location. Below is an example of an SLD created by Arc2Earth.

<?xml version="1.0" encoding="ISO-8859-1"?> 

<StyledLayerDescriptor xmlns:xlink='http://www.w3.org/1999/xlink' 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 StyledLayerDescriptor.xsd' xmlns='http://www.opengis.net/sld' > 

                <NamedLayer> 
                                <Name><![CDATA[GeologicAge]]></Name> 
                                <UserStyle> 
                                                <FeatureTypeStyle> 
                                                                <Rule> 
                                                                                <Name><![CDATA[Holocene]]></Name> 
                                                                                <Title><![CDATA[Holocene]]></Title> 
                                                                                <ogc:Filter> 
                                                                                                <ogc:PropertyIsEqualTo> 
                                                                                                                <ogc:PropertyName>representativeage_uri</ogc:PropertyName> 
                                                                                                                <ogc:Literal><![CDATA[http://resource.geosciml.org/classifier/ics/ischart/Holocene]]></ogc:Literal> 
                                                                                                </ogc:PropertyIsEqualTo> 
                                                                                </ogc:Filter> 
                                                                                <PolygonSymbolizer> 
                                                                                                <Fill> 
                                                                                                                <CssParameter name="fill" >#f9f97f</CssParameter> 
                                                                                                                <CssParameter name="fill-opacity" >1</CssParameter> 
                                                                                                </Fill> 
                                                                                                <Stroke> 
                                                                                                                <CssParameter name="stroke" >#f0f0f0</CssParameter> 
                                                                                                                <CssParameter name="stroke-width" >0.4</CssParameter> 
                                                                                                                <CssParameter name="stroke-opacity" >1</CssParameter> 
                                                                                                </Stroke> 
                                                                                </PolygonSymbolizer> 
                                                                </Rule> 
                                                                <Rule> 
                                                                                <Name><![CDATA[Quaternary]]></Name> 
                                                                                <Title><![CDATA[Quaternary]]></Title> 
                                                                                <ogc:Filter> 
                                                                                                <ogc:PropertyIsEqualTo> 
                                                                                                                <ogc:PropertyName>representativeage_uri</ogc:PropertyName> 
                                                                                                                <ogc:Literal><![CDATA[http://resource.geosciml.org/classifier/ics/ischart/Quaternary]]></ogc:Literal> 
                                                                                                </ogc:PropertyIsEqualTo> 
                                                                                </ogc:Filter>
                                                                                <PolygonSymbolizer>
                                                                                                <Fill>
                                                                                                                <CssParameter name="fill" >#f9f97f</CssParameter>
                                                                                                                <CssParameter name="fill-opacity" >1</CssParameter>
                                                                                                </Fill>
                                                                                                <Stroke>
                                                                                                                <CssParameter name="stroke" >#6e6e6e</CssParameter>
                                                                                                                <CssParameter name="stroke-width" >0</CssParameter>
                                                                                                                <CssParameter name="stroke-opacity" >1</CssParameter>