Example: Import CTG Grid Cell File and Style

In this example we import a CTG LULC Grid Cell file containing raster data showing land use and land cover and then we use Style to provide a more understandable display.  See also the companion Example: Import GIRAS vector LULC File and Style topic.


LULC (Land Use Land Cover) data for locations in the United States has been provided by the USGS (U.S. Geological Survey) over the years using several different formats.   Legacy LULC data sets are often found that use two different formats for LULC data for the same region: the GIRAS (Geographical Information Retrieval and Analysis System) vector format, and  CTG (Composite Theme Grid) raster format.


Files in either CTG or GIRAS format do not use three-letter extensions.  For example, downloading and then decompressing any compressed files for the San Francisco 100K LULC data set from USGS will result in five files, as seen in Windows File Explorer:



One of the files, the grid_cell file, is raster data in CTG format.   The other four files contain vector data in GIRAS format.   


It is not always easy to remember that the grid_cell file uses a different format, so Manifold users will rename the grid_cell file to grid_cell.ctg to indicate it is a raster file in CTG format, a different format used than the other four files.  



The grid_cell.ctg file can then be imported into Manifold using the CTG dataport.




To import from LULC CTG format:


  1. Choose File-Import from the main menu.

  2. In the Import dialog browse to the location of the file.

  3. Rename the grid_cell file to grid_cell.ctg and double-click on the file.

  4. A table and four images will be created.



The four images each use a different tile column in the grid_cell Tiles table.




Double-clicking open the grid_cell Tiles table we can see the four different tile fields used by the images.




We can double-click one of the images open to view it.   For a more interesting display, we first create a new data source using a Bing street maps imageserver as shown in the Example: An Imageserver Tutorial topic,  we create a map and drag and drop the Bing layer into the map, and then we drag and drop the grid_cell LULC image into the map.


CTG format stores projection information so the image has been imported with the correct coordinate system.  It appears in the right place, showing the parts of the San Francisco Bay region and neatly aligned with the background Bing map.  However, the image needs to be styled to provide useful colors.   To do that we click on the grid_cell LULC image layer to make sure it is the active layer and then we launch the Edit - Style dialog.




In the Style dialog we check the Common color channel box and then choose unique values as the Method to use.   We press the Tally button to load up the palette pane with all of the different unique pixel values in the image.  We click the down triangle symbol by the palette button and choose the Land Cover palette, and then we press the Land Cover button to load that palette into the color wells.   Press Apply.   No need to close the Style dialog, as we will be using it in the steps ahead and it remains alive as we move back and forth between the dialog and the map.



That applies the Land Cover palette to the different pixel values in the image.   That is better than black tones, but we can improve the display by adapting the default palette with a few changes in the Style dialog.



Back in the Style dialog we click on the first color well row to highlight it, and then we scroll down to the last row and shift-click that last row to highlight all of the rows.  We right-click onto the highlighted rows and choose Reverse from the context menu.   




That reverses the order in which the palette is applied to the unique pixel values in the palette pane.    We press Apply to see how that looks in the map.




Even better.  Now the portions of the image that we know are forested regions are green, and those portions that correspond to city regions are not green.   Next, we will eliminate the wrong colors that are used for ocean and bay regions.   Those should be blue.




From the classification table given in the Notes below (documentation easily found online at various USGS sites) we know that pixels with a value of 54 represent bays or lakes.  We double-click into the green color well for that pixel value and we change the color to light blue.





Scrolling up to the top of the palette pane we likewise change the color for pixel values of 0 and 2000000102 to light blue as well. From the table in the Notes section below we know those values code for water as well.   We press Apply to see how that looks in the map.



Much better!   We now have a clear display of land use and land cover in the Bay area.   The ocean and bay regions are blue as well.    If we were interested in a particular set of pixels for land use, we could consult the table in the Notes to find a category of interest and color those pixel values a contrasting color, such as bright red, to see where they are.


As interesting as the above display may be, if we do not intend to use the land use image on its own but want to keep displaying it in a map using Bing as a background, we may as well use the color of water regions displayed by Bing.     The easiest way to do that is to double-click into the color wells for the pixel values that represent water and to change the color to transparent color, represented with a hatch pattern.




We do that first for the 54 pixel value.




We then scroll up and change the color for pixel values of 0 and 2000000102 to transparent color as well.   We then press Apply.




In the map we see that all pixels colored in transparent color have disappeared.   The Bing background now shows through in water regions of the image.



If we like, we can easily add other layers from other imageservers like seen in the Example: Spectacular Images and Data from Web Servers  topic.  In the map above we have added a Google satellite imageserver layer below the grid_cell LULC layer, and above the image layer we have added a Google imageserver that provides streets and labels with transparent background.


The image seen above is the same map published in larger size on the Data Sources page on the Manifold website.   Especially in the larger view we can see how the land use raster image aligns very well with the satellite imagery.



Classification Codes - The value for each pixel in the grid_cell LULC is a classification code that can be matched to a palette color to provide a more understandable display, as illustrated above.  USGS defines the following codes:


1 Urban or Built-Up Land

11 Residential

12 Commercial Services

13 Industrial

14 Transportation, Communications

15 Industrial and Commercial

16 Mixed Urban or Built-Up Land

17 Other Urban or Built-Up Land


2 Agricultural Land

21 Cropland and Pasture

22 Orchards, Groves, Vineyards, Nurseries

23 Confined Feeding Operations

24 Other Agricultural Land


3 Rangeland

31 Herbaceous Rangeland

32 Shrub and Brush Rangeland

33 Mixed Rangeland


4 Forest Land

41 Deciduous Forest Land

42 Evergreen Forest Land

43 Mixed Forest Land


5 Water

51 Streams and Canals

52 Lakes

53 Reservoirs

54 Bays and Estuaries


6 Wetland

61 Forested Wetlands

62 Non-forested Wetlands


7 Barren Land

71 Dry Salt Flats

72 Beaches

73 Sandy Areas Other than Beaches

74 Bare Exposed Rock

75 Strip Mines, Quarries, and Gravel Pits

76 Transitional Areas

77 Mixed Barren Land


8 Tundra

81 Shrub and Brush Tundra

82 Herbaceous Tundra

83 Bare Ground

84 Wet Tundra

85 Mixed Tundra


9 Perennial Snow and Ice

91 Perennial Snowfields

92 Glaciers


Oceans may be coded with a value of 2000000102 or 0.


See Also



CTG, LULC Grid Cell


GIRAS, LULC Vector Format


Example: Spectacular Images and Data from Web Servers


Example: An Imageserver Tutorial


Example: Import GIRAS vector LULC File and Style