Save your marriage – use layer files
Layer files are a useful way to recreate legends and get consistent symbology. This post outlines what they are and how to use them.
Geology…who doesn’t love geology? And who doesn’t love geology maps especially? (Ed. – Only heathens…) The image below shows one of the 1:250,000 scale geology maps that cover the country, produced by Geological and Nuclear Sciences (GNS). They are rich in detail and symbology and anyone who uses them frequently will be familiar with the shadings, and colours and patterns that describe our geology underfoot. Here’s an image of the whole map but we’ll only focus on a few aspects:
Here’s an image zoomed in on the Christchurch/Banks Peninsula area:
And here’s a portion of the legend – it’s quite an extensive, custom legend and I can only show a small part to give you the sense of detail but I hope you get the picture:
If I’d like to recreate the look and feel of these data on my own map, I’ll first need the same data. Happily, we have copies of all the data layers that make up these maps – you can find them in J:\Data\QMAP-250K. The main layer of interest is probably the “NZL_GNS_250K_geological_units” feature class, which I’ll show you on the map below (using ArcGIS Pro):
By default, any new layer added is shown as a single symbol for all features, so there’s not much to differentiate one unit from another. Amongst the many attributes is one called “plotName” which is what is usually shown on the maps. So I’ll change the symbology to Unique Values and let it assign a colour to each unit and zoom in, as shown below:
Hmmmm…the same data, yes, but how do I get it to look like the standard geology map from GNS? I’ve got two options. I could go through each symbol, unit by unit and try to match each as best I can. This is painstaking business and fraught with frustration. LOTS of frustration. Something like this could end a marriage. Or make someone quit and join an ashram in southern India. Option two is a lot more feasible.
Layer Files
The good people at GNS went to great lengths to symbolise their maps. So much so that they have made that symbology transportable in the from of layer files. We’ve talked about these once before in a different context. Layer files are sort of front ends on data layers that have captured the symbology choices. If you look in the QMAP-250K > Support > Layerfiles folder you’ll see there is another folder called NZL_GNS_250K_geology (2nd edition). Inside that (have you left a trail of breadcrumbs?) is a collection of files, all ending in .lyr and with names that match the feature class layer names.
These layer files will make it a lot easier to get our symbology to match GNS’s – because it tells Pro (or ArcMap) how to render the data. Note the file sizes – these layers contain no spatial data. Think of them as the saved legend for each of the layers shown on the GNS map. Happily we can import these layer files and use them for our symbology. Here’s how:
- Back in the Symbology tab, click on the three horizontal bars and choose “import symbology”
- Like most things in Pro, this opens a tool that needs to be run. Set the “Symbology Layer” to the layer file in the Support folder and note that it’s already matched an attribute in the layer file with a similar attribute in the feature class:
(Note that you could use any other symbolised feature class or shapefile as the “Symbology Layer”, not just layer files, i.e. if you’ve already symbolised another layer on your map you can import that same symbology so that legends match.)
When I run this tool, here’s the result (with a bit of transparency):
In ArcMap it’s a little more straightforward – from the Symbology tab, click the Import button at upper right and point to the layer file. You’ll be presented with an extra box or two to ensure you line up the right attributes. To fully finish off the map to make it match the GNS map more completely, we would need to do some more work – adding pertinent layers and importing their layer files.
By using layer files I can save myself huge amounts of time and can be quite sure I’ve got the symbology right – that’s their real value.
But it’s not all fun and games. One limitation of layer files is that they don’t adapt to clipped out features. In other words, if I’ve clipped out, say Banks Peninsula from the national scale layer and then imported the layer file, I’d end up with all the geological unit names, not just the ones in Banks Peninsula. Maybe there’s a way around this but I haven’t found it yet. (Anyone out there cracked this?)
Another useful way to use layer files is as a way to preserve all your hard work on making legends. The Pro project document (or the ArcMap map document) saves the legend symbology but it you wanted to use the same legends in another map, or if you share your feature class/shapefile with someone else and you want them to have use the same symbology, go to the Share tab and click “Layer File” in the Save as group:
(in ArcMap, right-click on the layer name in the Table of Contents and choose “Save as Layer File”)
Now, you or anyone else that has the layer and the layer file, can have the same symbology on two different maps.
Not all layers will have layer files, but when they do, they’re a useful way of ensuring consistent symbology. And appearances can be everything.
C