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.

Chris W
  • 15,720
  • 2
  • 29
  • 47
four-eyes
  • 3,378
  • 5
  • 33
  • 58
  • 1
    Look at the symbology tab of the properties dialog. Someone has set the descriptions based on the values. – Fezter Apr 30 '15 at 11:51
  • @Fezter it uses a colormap – four-eyes Apr 30 '15 at 12:55
  • Related topic for going the other direction, from table to a map legend: https://gis.stackexchange.com/questions/102956/setting-symbol-descriptions-of-arcmap-layout-legends-from-table and https://gis.stackexchange.com/questions/253069/export-arcmap-symbology-to-table-text-or-other-format – matt wilkie Aug 28 '17 at 19:01

2 Answers2

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.

radouxju
  • 49,636
  • 2
  • 71
  • 144
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?

Chris W
  • 15,720
  • 2
  • 29
  • 47
  • 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 May 06 '15 at 15:56