Converting an ArcMap layer file into an SLD document

Most open source GIS programs can open all most common, and quite a few obscure data format (thanks to the gdal library). What they can’t open is the ArcMap layer files (.lyr).  A layer file defines the symbology used to draw the data when it is added to the display and stores information about the symbology, symbology classifications, labeling properties, scale dependency and definition. So what if a data layer is distributed with a layer file?

Well, most likely you’ll have to recreate the legend yourself. A bigger problem is if the data is distributed with the key attributes described in the .lyr file rather then in the attribute table. In other words, if it contains the classification of the layer.

A good example is the Terrestrial Ecoregions of the World data set distributed by WWF. It is available as a shapefile with two .lyr layer files that can be used to symbolize respectively the ecoregions and biomes. The layer file is indispensable; the attribute table only contains a numerical code for the biomes, while the layer file contains he corresponding classification. So without ArcGIS, you will need to recreate the legend and to somehow find out which number in the attribute table correspond to which biome.

If you happen to have access to a computer with ArcGIS, there is a tool that helps you to convert the layer file to a .sld file, ArcMap2SLD. It is a tool for reading out styling information from ArcMap and converting into Styled Layer Descriptor-Files (SLD). This is a OGC (Open Geospatial Consortium) standard for web map-service (WMS) symbolization. It is also a standard that can be used by QGIS.

WWF map of the 14 biomes of the world. For the legend, the original .lyr file was converted to a .sld file using ArcMap2SLD

Not an ideal solution, you still need access to ArcMap, but at least it makes it possible to convert ArcGIS layer files. It also means there is not really an excuse anymore to distribute your data with .lyr files only (and i.m.h.o. , it is always a bad practise to describe key map attributes in the legend file rather then in the attribute table).

And assuming WWF doesn’t mind, you can download two above-mentioned legend files  in SLD format here.

24 thoughts on “Converting an ArcMap layer file into an SLD document

  1. This is the kind of things that perplexes me about ESRI. How difficult is it to implement such a simple feature inside ArcMap itself? We should organize a strike followed by a worldwide boycott of their products. Who is with me?

  2. R W Hofste

    can’t believe ArcGIS does not support SLD export in 2017 but this tool helped me out. Make sure you run the .bat file if you are using a version different than 10.0

  3. tonoarmas

    Usually I need different SLD files for QGIS or Geoserver, one of them uses SLD 1.1 and the other uses SLD 1.0. Does this tool export/import to/from both versions of SLD?

    1. pvangenuchten

      Hi @tonoarmas, qgis mostly uses sld 1.1 where geoserver uses sld 1.0, however newer versions of geoserver have also support for sld 1.1, in geocat bridge we let the user select the sld version to use to export. There is also a new feature that exports a full mxd with data to a geopackage including layer order and styling (sld) which can be read by the qgpkg qgis plugin.

  4. If anyone here has managed a successful conversion of an Esri .style file to a .sld file (importable by QGIS), using ArcGOS 10.4 and the ArcMAP2SLD tool, I would certainly appreciate a workthrough. I seem to be hitting a brick wall somewhere.

Leave a comment