English

How To: Isolate the data portion of a USGS DRG (i.e., remove collar information)

Summary

United States Geological Survey digital raster graphics (DRGs) are often provided with their collars intact. It may be desirable to remove this part of the images, particularly where several DRGs are to be tiled together.

Procedure

  1. Uncompress the DRG file after it is downloaded.
  2. Check and see if there is a .fgd file in the data directory. This file contains background information on the DRG, such as projection and the data extents inside the collar.
  3. Determine the lower left, upper left, upper right, and lower right coordinates of the data either from the .fgd file or from the image itself (look at the corners). Make a text file with these coordinates.

    For example, the .frg file contains the following information in the Spatial Domain section:

     Bounding Coordinates  

    1.5.1.1 WEST BOUNDING COORDINATE: -88.375000
    1.5.1.2 EAST BOUNDING COORDINATE: -88.250000
    1.5.1.3 NORTH BOUNDING COORDINATE: 41.750000
    1.5.1.4 SOUTH BOUNDING COORDINATE: 41.625000

    Make a text file called COORD.TXT with the values as follows
    (West South, West North, East North, East South):

    -88.375000 41.625000
    -88.375000 41.750000
    -88.250000 41.750000
    -88.250000 41.625000

  4. These coordinates need to be converted to Universal Transverse Mercator (UTM) to align over the data. The UTM zone the data is located in can be determined from the .fgd file.

    For example, this information is in the .fgd file in the Spatial Reference Information section:

      4.1.2.2.2.1   UTM ZONE NUMBER:  16

  5. Make a projection file called GEOG2UTM.PRJ to use when converting the decimal degree units of the data area coordinates to UTM.

      input 
    projection geographic
    units dd
    datum nad27
    parameters
    output
    projection utm
    units meters
    zone 16
    datum nad27
    parameters
    end

  6. Project the geographic coordinates to UTM.

    Code:
    Usage: PROJECT <COVER | FILE> <input> <output> {projection_file}
    Arc: project file coord.txt output.txt geog2utm.prj


    The contents of OUTPUT.TXT should be something like this: 

    385455.1963 4608841.8819
    385676.7404 4622719.9991
    396069.9634 4622561.4366
    395868.5676 4608683.4007

  7. Use these coordinates to create a generate file called MAKEPOLY.GEN that will be used to generate a polygon. The first line will be the polygon ID; its coordinates should fall within the range of the extremes.

     101,390000.0000,4615000.0000        
    385455.1963,4608841.8819
    385676.7404,4622719.9991
    396069.9634,4622561.4366
    395868.5676,4608683.4007
    385455.1963,4608841.8819
    end
    end

  8. Generate the polygon coverage.

    Code:
    Arc: GENERATE clipbox
    generate: INPUT makepoly.gen
    generate: POLYGONS
    generate: QUIT

    Arc: CLEAN clipbox clipboxcln

  9. This polygon can be used to clip the image, but it will clip out based on the bounding box, not the actual arc. This would result in slivers of collar data appearing at the corners of the clipped image. (The command would be Arc: rectify drg.tif drgclip.tif # # clipbox.)
    Therefore, the image must be converted to a grid for further processing.

    Code:
    Arc: IMAGEGRID drg.tif drggrid

  10. Clip the data area out using the clip coverage.

    Code:
    Grid: gridclip drggrid drgclip cover clipboxcln

  11. To preserve the colors of the DRG in the grid, a colormap file must be made. The color definitions are located in the .fgd file.

                           USGS DRG Color Palette

    Digital Number Color Red Green Blue

    0 Black 0 0 0
    1 White 255 255 255
    2 Blue 0 151 164
    3 Red 203 0 23
    4 Brown 131 66 37
    5 Green 201 234 157
    6 Purple 137 51 128
    7 Yellow 255 234 0
    8 Light Blue 167 226 226
    9 Light Red 255 184 184
    10 Light Purple 218 179 214
    11 Light Grey 209 209 209
    12 Light Brown 207 164 142

    Make a colormap file from the information above in the following format:

    "drgpalette.clr"
    0 0 0 0 (Black)
    1 255 255 255 (White)
    2 0 151 164 (Blue)
    3 203 0 23 (Red)
    4 131 66 37 (Brown)
    5 201 234 157 (Green)
    6 137 51 128 (Purple)
    7 255 234 0 (Yellow)
    8 167 226 226 (Light Blue)
    9 255 184 184 (Light Red)
    10 218 179 214 (Light Purple)
    11 209 209 209 (Light Grey)
    12 207 164 142 (Light Brown)

    Note: This palette could also be made into a shadeset.

  12. The data area can be displayed as follows:

    Code:
    Grid: gridpaint drgclip # # # drgpalette.clr

  13. To create a TIFF file from the grid, use the GRIDIMAGE command with the colormap file.

    Code:
    Arc: gridimage drgclip drg.clr drgcli.tif tiff compress