ARCMAP2SLD: An open source tool that converts a layer mapping style in an mxd to an OGC SLD file

Source: Internet
Author: User

In a project, the user uses GeoServer as the GIS server (for reasons of course it is free to save money, verified may also be performance and stability, etc.), but the data collected in the hand is in ESRI format, which is matter, Because GeoServer is directly capable of supporting ESRI's shape file and arcsde two data formats, the user's mapping is also well-equipped with 40 or so of the layers and thematic map styles in the esri,mxd. Most of the styles on the web for publishing services in GeoServer are recommended to be reconfigured in udig, and then export the SLD file and add it to geoserver. Because of the time is tense, also do not want to spend a lot of energy to do this repetitive work, so I think there is no tool can directly put the layer in the mxd into a SLD, so Baidu, things so people wish, still really found! It took about 1 hours to get this tool down, all the style files finished 1 minutes to complete, add to GeoServer, take data a test, fully positive solution.

The following is a special introduction to this tool:


1.ARCMAP2SLD, open Source tools

The tool was first developed by a student at the Munich University of Technology in 2006, the classmate named Albrecht Weiser, and the project is sponsored by the Association for Geographical Information Development, So the source is open. This version of the development is supported by the ArcGIS 9.0 version, and then after another German Lat/lon, Bonn Supplement, can support to ArcView3.3 version, the latest version of the tool is 1.3.0, can support to ArcGIS 10. This tool is still maintained by the original author in development.

More information about this tool can be found at the website: http://arcmap2sld.i3mainz.hs-mainz.de/ArcMap2SLDConverter_Eng.htm

Tool Download Address: http://wald.intevation.org/projects/arcmap2sld/, download the different version according to your own situation


2. Download and debug

After I got the latest version, I opened it with vs 2012 on the machine, and I ran an error because I had ArcGIS 10.1 installed on my device, and I only had desktop, Project reference should be 10.0 DLL, so reported an authorization when ProductCode error, found that this error is due to the version DLL reference is not caused, and then let a mastery Microsoft colleague to all the relevant components are re-reference, the relevant configuration file lil bit location, Some of the coding that was caused by the German conversion was also adjusted, and it took about 30 minutes to run out, presumably after the operation:


3. Test results

When the tool is running, you need to open an mxd (note, only open one), will automatically read in the MXD layer, in this interface, only need to specify a converted SLD file storage path, click on the lower left corner of the button, will start the conversion work (do not know where the control, After running the size and development of the project is not quite the same, anyway can run, I did not tune this), for the conversion file to save the way, there are two, all styles stored in a file, separated by the layer, this setting in the upper left corner "Extras" menu, Since the GeoServer Publishing Service requires a separate style file, I chose to store it separately, and the converted style file is probably like this:

Classbreaks Render
<?xml version= "1.0" encoding= "iso-8859-1" standalone= "yes"?>
<sld:styledlayerdescriptor version= "1.0.0" xmlns:sld= "HTTP://WWW.OPENGIS.NET/SLD" xmlns:ogc= "http// WWW.OPENGIS.NET/OGC "xmlns:xlink=" Http://www.w3.org/1999/xlink ">
<sld:NamedLayer>
<sld:Name>grid200_avg</sld:Name>
<sld:UserStyle>
<sld:Name>Style1</sld:Name>
<sld:FeatureTypeStyle>
<sld:FeatureTypeName>grid200_avg</sld:FeatureTypeName>
<sld:Rule>
<sld:name>.00-.10</sld:name>
<sld:title>.00-.10</sld:title>
<ogc:Filter>
<ogc:PropertyIsBetween>
<ogc:PropertyName>BCOVERWH_4</ogc:PropertyName>
<ogc:LowerBoundary>
<ogc:Literal>0</ogc:Literal>
</ogc:LowerBoundary>
<ogc:UpperBoundary>
<ogc:Literal>0.0994</ogc:Literal>
</ogc:UpperBoundary>
</ogc:PropertyIsBetween>
</ogc:Filter>
<sld:PolygonSymbolizer>
<sld:Fill>
<sld:cssparameter name= "Fill" > #FFFF80 </sld:CssParameter>
<sld:cssparameter name= "Fill-opacity" >1</sld:CssParameter>
</sld:Fill>
</sld:PolygonSymbolizer>
</sld:Rule>
<sld:Rule>
<sld:name>.11-.20</sld:name>
<sld:title>.11-.20</sld:title>
<ogc:Filter>
<ogc:PropertyIsBetween>
<ogc:PropertyName>BCOVERWH_4</ogc:PropertyName>
<ogc:LowerBoundary>
<ogc:Literal>0.099401</ogc:Literal>
</ogc:LowerBoundary>
<ogc:UpperBoundary>
<ogc:Literal>0.200012496477616</ogc:Literal>
</ogc:UpperBoundary>
</ogc:PropertyIsBetween>
</ogc:Filter>
<sld:PolygonSymbolizer>
<sld:Fill>
<sld:cssparameter name= "Fill" > #FAD155 </sld:CssParameter>
<sld:cssparameter name= "Fill-opacity" >1</sld:CssParameter>
</sld:Fill>
</sld:PolygonSymbolizer>
</sld:Rule>
<sld:Rule>
<sld:name>.21-.35</sld:name>
<sld:title>.21-.35</sld:title>
<ogc:Filter>
<ogc:PropertyIsBetween>
<ogc:PropertyName>BCOVERWH_4</ogc:PropertyName>
<ogc:LowerBoundary>
<ogc:Literal>0.200013496477616</ogc:Literal>
</ogc:LowerBoundary>
<ogc:UpperBoundary>
<ogc:Literal>0.351116688634112</ogc:Literal>
</ogc:UpperBoundary>
</ogc:PropertyIsBetween>
</ogc:Filter>
<sld:PolygonSymbolizer>
<sld:Fill>
<sld:cssparameter name= "Fill" > #F2A72E </sld:CssParameter>
<sld:cssparameter name= "Fill-opacity" >1</sld:CssParameter>
</sld:Fill>
</sld:PolygonSymbolizer>
</sld:Rule>
<sld:Rule>
<sld:name>.36-.50</sld:name>
<sld:title>.36-.50</sld:title>
<ogc:Filter>
<ogc:PropertyIsBetween>
<ogc:PropertyName>BCOVERWH_4</ogc:PropertyName>
<ogc:LowerBoundary>
<ogc:Literal>0.351117688634112</ogc:Literal>
</ogc:LowerBoundary>
<ogc:UpperBoundary>
<ogc:Literal>0.5</ogc:Literal>
</ogc:UpperBoundary>
</ogc:PropertyIsBetween>
</ogc:Filter>
<sld:PolygonSymbolizer>
<sld:Fill>
<sld:cssparameter name= "Fill" > #AD5313 </sld:CssParameter>
<sld:cssparameter name= "Fill-opacity" >1</sld:CssParameter>
</sld:Fill>
</sld:PolygonSymbolizer>
</sld:Rule>
<sld:Rule>
<sld:Name>.51-1.00</sld:Name>
<sld:Title>.51-1.00</sld:Title>
<ogc:Filter>
<ogc:PropertyIsBetween>
<ogc:PropertyName>BCOVERWH_4</ogc:PropertyName>
<ogc:LowerBoundary>
<ogc:Literal>0.500001</ogc:Literal>
</ogc:LowerBoundary>
<ogc:UpperBoundary>
<ogc:Literal>1</ogc:Literal>
</ogc:UpperBoundary>
</ogc:PropertyIsBetween>
</ogc:Filter>
<sld:PolygonSymbolizer>
<sld:Fill>
<sld:cssparameter name= "Fill" > #730000 </sld:CssParameter>
<sld:cssparameter name= "Fill-opacity" >1</sld:CssParameter>
</sld:Fill>
</sld:PolygonSymbolizer>
</sld:Rule>
</sld:FeatureTypeStyle>
</sld:UserStyle>
</sld:NamedLayer>
</sld:StyledLayerDescriptor>






ARCMAP2SLD: An open source tool that converts a layer mapping style in an mxd to an OGC SLD file

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.