3

I'm using ArcGIS 10 and I downloaded a Raster layer from here: http://bioval.jrc.ec.europa.eu/products/glc2000/products.php

When I unzip it I get the following files:

  • 1 Aux-File (15KB)
  • 1 ArcGIS-Layer (14KB)
  • 1 Tif Image (37MB)
  • 1 .lyr file (XML Document) (6KB)
  • 1 .tif file (XML Document) (15KB)
  • 1 .tif.aux file (XML Document) (5KB)
  • 1 .tif.ovr file (OVR File) (1.8MB)
  • 1 .tif.vat file (DBF File) (2KB)

When I open the .lyr Layer in ArcGIS I get a nice colormap with a good legend (as can be seen in the Table of Contents). Looking at the Attribute Table I see only numbers, no description.

Look

Where does the .lyr file gets its information from?! I need its information to create a legend and to know which number is what.

3

2 Answers 2

1

The colormap is included inside the tif file. You can query it using gdalinfo.

The unique value in the attribute table should be sorted in the same order as the color map, but I would rather start from a copy of the existing lyr to create a legend instead of creating a new legend from scratch.

1
  • Yep, I was just wondering wether it is possible to extract the information for later processing :)
    – four-eyes
    Commented May 6, 2015 at 15:58
1

A layer (lyr) file is saved symbology. It does not 'get' it's information from anywhere, it is the information. At some point someone went through and symbolized each unique value in the raster to a certain color and labeled it with the LUC class. Once they had that symbology and labeling set up, they saved it out as a lyr file which allows you to load the same raster data in and view it the same way. They've used a lyr file instead of a colormap because the latter can't store legend values/labels, just pixel values mapped to color values.

A lyr file itself is binary, so you can't read anything out of it. There are two possible sources for the information you seek. Sometimes a separate raster attribute table (or just a generic table) is provided which gives the key between the coded raster values and their labels/other attributes. It may be provided within a gdb (I've seen this with BLM PLSS data, but not in your case) or available as a separate download somewhere on the site. The information might (should, really) also be contained within metadata.

Your other alternative is to create such a lookup table yourself by copy/pasting the labels, since I'm not aware of any way to export that data in a tabular/text format. I'm not entirely clear why you say you need the info to create a legend, since you can create one using the data already properly symbolized by the lyr file - unless you just want a text table for something other than a map.

Related: What is layer file (*.lyr) in ArcGIS Desktop?

1
  • Thanks for the explanation. I though since that file exists I can extract the information from somewhere. I was just wondering. Working with that file, it is possible to do it "by hand" (assigning something to a value). But what if there are many many values. Thats why I asked!
    – four-eyes
    Commented May 6, 2015 at 15:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.