Preparing ArcGIS Layer Files for Publication

While optional, publishing ArcGIS layer files with your data can be very beneficial. They enable the user to easily add the data to an ArcMap Project, and give you an opportunity to provide optimal symbology, dataset groupings, titles, or usage tips. For state agency users with access to a GDRS, layer files ensure that the data can be included in the DNR's "Quick Layers" tool. For these reasons, we strongly encourage publishers to include layer files within their resource.

Since Quick Layers will display the layer file title exactly as written, use plain English in the layer file title, with mixed case and spaces between the words. For example: "Minnesota County Boundaries.lyr"

Also note that layer files will only work with the data formats you provide; they will not be created for additional formats that the Commons automatically generates. For example, if you provide your dataset in file geodatabase format with a layer file, the Commons will automatically generate and publish a shapefile version of the data, but the shapefile version will not include a layer file.

Methods for Generating ArcGIS Layer Files with Relative Paths

Layer files must have relative paths set in order to work with the data you are publishing. There are several methods to create a layer file with relative paths. None is preferred, but some methods allow greater flexibility than others.

Using ArcMap

  1. Set to relative paths, via either method described below. The first method customizes your ArcMap so that new map documents you create are automatically set up with relative paths enabled. The second method just sets up the relative paths within the current map document.
  2. Right-click the layer of interest in the Table of Contents and Save as a Layer File
  3. Browse to your preferred output location
  4. If desired, use the drop-down to save to an earlier version of ArcMap.
    • All layer files should be forward compatible, so there should be no issues with choosing an earlier version of ArcMap, and it may make the layer file more accessible to users of earlier versions. The same is true of geodatabases, although significant compatibility changes occurred at 10.0 when an API was released to allow developer access to the data.

Set All Map Documents to Store Relative Paths

  1. In ArcMap, go to Customize Menu > ArcMap Options
  2. Towards the middle of the dialog, check on Make relative paths the default for new map documents.

Setting Relative Paths in all ArcMap Documents

Toggling Relative Paths in a Single Map Document

  1. In ArcMap, go to File Menu > Map Document Properties
  2. Towards the bottom of the dialog, check on Pathnames: Store relative pathnames to data sources.

Setting Relative Paths in ArcMap

Using ArcToolbox Tools

From within ArcMap:

  1. Open ArcToolbox
  2. Navigate to Data Management Tools > Layers and Table Views  > Save to Layer File
  3. Input Layer: The drop down list is populated from the data layers in the ArcMap Table of Contents. Select a layer from the drop down list.
  4. Output Layer: Navigate to your preferred output location, keeping in mind that  the relationship between where the layer file is stored and where the data is will be preserved when you choose relative paths. Often storing the layer file alongside the data source, such as in the "fgdb" folder, is desirable.
  5. Check on: Store Relative Paths
  6. Layer Version: Choose the ArcMap version most commonly used; this means if a new version was just released it may make most sense to save to the previous version.

From within ArcCatalog:

ArcCatalog does not have access to layers in memory like ArcMap unless they are generated during the active session. See the steps below to prepare symbology and save to a Layer File.

  1. Open ArcToolbox
  2. Navigate to Data Management Tools > Layers and Table Views 
  3. Open  Make Feature Layer or other Make ______ Layer Tool (fill in the blank as appropriate for the layer type) and run the tool, making note of the Output Layer name.
  4. Open Save to Layer File Tool
  5. Input Layer: Choose from the drop down (populated from Layers created in this ArcCatalog Session).
  6. Output Layer: Navigate to your preferred output location, keeping in mind the relationship between where the layer file is stored and the data will be preserved when you choose relative paths.
  7. Check on: Store Relative Paths
  8. Layer Version: Choose the ArcMap version most commonly used; this means if a new version was just released it may make most sense to save to the previous version.

Checking that paths are relative

If you leave your data and layer file in the same place as they were originally generated, it can be difficult to know for sure that the paths are in fact relative. Here are a few ways to check them:

  • If they are on a network drive, remap the drive to a different drive letter and open the layer file and note if the path has changed (which would indicate success), or add it to ArcMap and see if it can find its source.
  • If it is on your local machine, create a new folder or rename the parent directory and attempt to load the layer in ArcMap. Or, open the layer file properties in ArcCatalog and note the source; if successful, it should have the renamed parent directory in the path.