Importing USGS Digital Orthophoto Quarter Quads (DOQQ) in ARC/Info:

This daunting task is best handled using Imagine in UNIX- see this Helpdesk FAQ for the procedure. If you must use ARC/Info, follow the instructions below.

The executive summary is that you open the files in a text editor and strip out the header and then give the file a .bil (band inter-leaved) extension. Then use parts of the header to create a .blw world file.

First you have to figure out whether you are using the NEW format (data created after May, 1997) or the OLD format. To do this, you have to look at the header, which is included as the first 100 or so lines of your file. Open the file in a text editor and if it doesn't look like the NEW HEADER FORMAT shown below, then skip ahead to instructions for the OLD format.

NEW HEADER FORMAT:

The new USGS DOQQ header format makes use of keywords to define the data. Information from this header can be used to build an ASCII .hdr file which will be associated with the image when it is renamed with a .bil, .bip, or .bsq extension. The following is a sample USGS DOQQ header:

BEGIN_USGS_DOQ_HEADER                                                         * 
QUADRANGLE_NAME "RIVIERA BEACH"                          3.45 or 7.5-min. name* 
QUADRANT SW                     quadrant indicator if cell size = 3.75-minutes* 
WEST_LONGITUDE  -80  7 30.000                signed deg min sec SDDD MM SS.SSS* 
EAST_LONGITUDE  -80  3 45.000                signed deg min sec SDDD MM SS.SSS* 
NORTH_LATITUDE   26 48 45.000                signed deg min sec SDDD MM SS.SSS* 
SOUTH_LATITUDE   26 45  0.000                signed deg min sec SDDD MM SS.SSS* 
PRODUCTION_DATE 1996  5 14                                          yyyy mm dd* 
RASTER_ORDER LEFT_RIGHT/TOP_BOTTOM                         video display order* 
BAND_ORGANIZATION BIP                        single file or BSQ, or BIL or BIP* 
BAND_CONTENT RED                                 black&white or red green blue* 
BAND_CONTENT GREEN                               black&white or red green blue* 
BAND_CONTENT BLUE                                black&white or red green blue* 
BITS_PER_PIXEL  8                                       radiometric resolution* 
SAMPLES_AND_LINES   6889  7608                      number of columns and rows* 
HORIZONTAL_DATUM NAD83                                primary horizontal datum* 
HORIZONTAL_COORDINATE_SYSTEM UTM                                              * 
COORDINATE_ZONE     17                           coordinate system zone number* 
HORIZONTAL_UNITS METERS                                coordinate system units* 
HORIZONTAL_RESOLUTION  1.00                pixel horiz. ground sample distance* 
SECONDARY_HORIZONTAL_DATUM NAD27                    secondary horizontal datum* 
XY_ORIGIN   586657.000  2966350.000      coord. of upper left pixel pri. datum* 
SECONDARY_XY_ORIGIN   586635.552  2966145.866 coord upper left pixel sec datum* 
NATION US                                                          nation code* 
STATE FL                                                        state fip code* 
NW_QUAD_CORNER_XY   586958.828  2965967.697  XY coords. of pri. NW quad corner* 
NE_QUAD_CORNER_XY   593170.493  2966012.018  XY coords. of pri. NE quad corner* 
SE_QUAD_CORNER_XY   593221.537  2959089.228  XY coords. of pri. SE quad corner* 
SW_QUAD_CORNER_XY   587006.468  2959044.978  XY coords. of pri. SW quad corner* 
SECONDARY_NW_QUAD_XY   586960.432  2965801.317  XY coords. - sec. NW quad cor.* 
SECONDARY_NE_QUAD_XY   593172.212  2965845.639  XY coords. - sec. NE quad cor.* 
SECONDARY_SE_QUAD_XY   593223.254  2958923.135  XY coords. - sec. SE quad cor.* 
SECONDARY_SW_QUAD_XY   587008.071  2958878.884  XY coords. - sec. SW quad cor.* 
RMSE_XY  0.70                                              doq horiz. accuracy* 
IMAGE_SOURCE "COLOR INFRA-RED FILM"             b&w, cir, natural color, other* 
SOURCE_IMAGE_ID "NAPP 6966 108"                                source image id* 
SOURCE_IMAGE_DATE 1995  1 26                   source image date as yyyy mm dd* 
SOURCE_DEM_DATE 1996  5 14                          source dem date yyyy mm dd* 
AGENCY "WESTERN MAPPING CENTER (WMC)"                         oversight agency* 
PRODUCER "Science Applications International"              producer/contractor* 
PRODUCTION_SYSTEM "GIS/MAGIC"                                production system* 
STANDARD_VERSION 1996 12                               version of DOQ standard* 
METADATA_DATE 1997  6 29                   date created or changed, yyyy mm dd* 
DATA_FILE_SIZE  157255203                               data set size in bytes* 
BYTE_COUNT  20667                                            header byte count* 

The DOQQ header contains a parameter called BAND_ORGANIZATION, which is set to either "single file", BSQ, BIL, or BIP. If this parameter is set to "single file," you can copy the image file to an image with an extension of .bsq, .bil, or .bip; otherwise choose the extension based on the setting for this parameter.

Create a new file with an ASCII text editor. Give the file the same prefix name as the image file. Give this file the extension .hdr. This file can then be populated with the keywords found in the ARC/INFO ArcDoc section:

Cartography > Image integration > BIL, BIP, and BSQ data > Image description files > The header file (.hdr).

The SAMPLES_AND_LINES parameter has the column and row numbers that are used with the .hdr keywords ncols and nrows.

The number of BAND_CONTENT references indicate the number of bands to enter with the .hdr keyword nbands of the .hdr file. If there are 3 references for BAND_CONTENT, then nbands is 3.

The layout keyword of the .hdr should be the same as the renamed image file extension (BIL, BIP, BSQ).

The BITS_PER_PIXEL value will be used with nbits of the .hdr file.

The BYTE_COUNT value will be used with skipbytes in the .hdr file.

The values for the .hdr's ulxmap and ulymap are the x and y values of the XY_ORIGIN keyword of the DOQQ header.

The HORIZONTAL_RESOLUTION value will be used with both the xdim and ydim of the .hdr file.

Now create another new file with an ASCII text editor. Give the file the same prefix name as the image file. This file will be the world file of the image. This is the file that georeferences the image to its real-world location. The extension used for this file depend on the file format:

FORMAT       EXTENTION
------       ---------
BIL            .blw
BIP            .bpw
BSQ            .bqw

This file will contain six numbers in a column:


The x pixel dimension is HORIZONTAL_RESOLUTION from the DOQQ header.
Both translation terms should be set to 0.
The -y pixel dimension is the negative of HORIZONTAL_RESOLUTION.
The x of upper left pixel center is the x value XY_ORIGIN from the DOQQ header.
The y of upper left pixel center is the y value XY_ORIGIN.

A world file for the example DOQQ header file above would look like:


Notes:

Information about building a world file can be found in the ARC/INFO ArcDoc section:

Cartography > Image integration > Registering an image to real-world coordinates

Detailed information about what each parameter of the DOQQ header represents can be found at:

http://mapping.usgs.gov/www/ndop/



OLD HEADER FORMATS:

This tutorial explains how to import DOQ (Digital Orthophoto Quad) images from the USGS into ARC/INFO or ArcView.

The DOQ image will come on a CD in a JPEG compressed format. This compressed image will be about 5 megabytes. When uncompressed the image will be about 50 MB. The JPEG compressed format is not supported by ARC/INFO prior to version 7.1.x. There is a JPEG decompressor included with the CD. This decompressor will create one of four file formats, GIF, Targa, RLE, or PBMPLUS. Decompress the JPEG file to a PBMPLUS format for use with ARC/INFO or ArcView. PBMPLUS is a simple bit map that can be brought into ARC/INFO or ArcView as a BIL, BIP, or BSQ image (BSQ is supported at ARC/INFO 7.x). Follow the directions on the CD to decompress the image.

Once the image is decompressed you will want to give the file a ".bil" extension. With ARC/INFO 7.1.x, CONVERTIMAGE can be used to directly convert the image from JPEG to BIL format.

Every JPEG image will come with an ASCII header file. This file gives you the needed information to create the header file needed for ARC/INFO or ArcView to display and convert the image. See the BIL, BIP, and BSQ images section of Image Integration in the On-line help for ARC/INFO, for more information on defining header files for BIL images. The corresponding section of the ArcView Help does not contain information on creating header files, but the example below should help you to create a suitable header file. The header file for the JPEG image will have 4 records. This first record looks like the following:

RUNNELLS                              SWUS  IA      099153
POLK CO. PROJECT     2 WMC   2  7571  5868  1  0  0 0 4 1
0.000000000000000D+00  1    15  2   0.468701433471061D+06
0.459433209128819D+07   0.468731544699664D+06   0.460127084483777D+07
0.473942960840280D+06   0.460125010140768D+07   0.473917868280136D+06
0.459431135343846D+07

Each record of the file will be one line. You will need the information in the first and third records to create the header file needed for the BIL image. The following discussion will talk about byte counts. One byte will be one character or space in the file. You will be better able to count the character and spaces (bytes) in the JPEG header file if you bring it up in a text editor. For more information on the following header description please refer to the Technical Description of DOQ provided by the USGS.

The first 141 bytes of header record 1 will contain quadrangle name, nation, state, and county codes, and producer code. These are not needed.

After byte 141 there will be a number in the next 3 bytes. If this number is 2 they you should proceed. If it is 1 then the file will have to be rotated 90 degrees and then mirrored. This can be done after converting the file to a grid with ARC/INFO. For now proceed. After the image is converted to a grid with IMAGEGRID, rotate it 90 degrees with GRIDROTATE and then mirror it with GRIDMIRROR.

The next 12 bytes of header record 1, starting at byte 145, will be the number of rows and columns in the image. The first 6 bytes are the number of rows in the image. In the header record given above this number is 7571. This would be used as nrows for the BIL header. The last 6 bytes are the number of columns in the image. In the header record above this number is 5868. This would be used as ncols for the BIL header.

The next 3 bytes starting at byte 157 describe how the data is stored. This document describes only how to convert DOQ images in 1 band grayscale format. This is denoted by the number 1 for these 3 bytes. If these 3 bytes hold any number other then 1 then it is not in 1 band grayscale format. If this is the case you may still be able to use the data but you will have to modify the process. The Technical Description of DOQ data provided by the USGS will help you do this.

The next 3 bytes starting at byte 160 tell how the elevations are stored in the file. If this is any number other than 0 then the elevations are stored. This process describes how to use DOQ's that do not have elevations stored with them. Once again see the Technical Description of DOQ data for more information on how they are stored and modify the process as needed.

The next 3 bytes starting at byte 163 tell if the elevations are stored in the same file or in separate files. This process only deals with values of 0. See the Technical Description of DOQ data for more information and modify the process as needed.

The next 2 bytes starting at byte 166 can be ignored.

The next 2 bytes starting at byte 168 provide the horizontal datum for the data. A value of 1 = NAD27, 2 = WGS72, 3 = WGS84, 4 = NAD83, 5 = Old Hawaii, and 6 = Puerto Rico. This information is not used in the BIL header but should be noted. If the BIL image is converted to a grid with IMAGEGRID in ARC/INFO, this information should be used with PROJECTDEFINE to define the projection of the grid.

The next 2 bytes starting at byte 170 can be ignored.

The next 24 bytes starting at byte 172 give the angle of rotation. This should be zero.

The next 3 bytes starting at byte 196 give the projection of the data. A value of 0 = geographic, 1 = UTM, and 2 = State Plane. This information is not used in the BIL header but should be noted. If the BIL image is converted to a grid with IMAGEGRID, this information should be used with PROJECTDEFINE to define the projection of the grid.

The next 6 bytes starting at byte 199 give the projection zone. This information is not used in the BIL header but should be noted. If the BIL image is converted to a grid with IMAGEGRID, this information should be used with PROJECTDEFINE to define the projection of the grid.

The next 3 bytes starting at byte 205 give the geographic units. A value of 0 = radians, 1 = feet, 2 = meters, 3 = arc seconds. This information is not used in the BIL header but should be noted. If the BIL image is converted to a grid with IMAGEGRID, this information should be used with PROJECTDEFINE to define the projection of the grid.

Now go to record 3. The 48 bytes starting at byte 289 in record 3 give the ground coordinates for the NW corner of the image. These numbers should be used as ulxmap and ulymap in the BIL header file.

The rest of the DOQ header can be ignored.

An example of a header file (.hdr) for a BIL image might be:

There is no need to put any other information in the file. The cellsize of the image is 1 meter. Xdim and ydim in the header file for the BIL image default to one. Layout defaults to bil, nbands defaults to 1 and nbits defaults to 8.

After the above BIL header file is created the BIL image can be used directly with IMAGE for display or IMAGEGRID for conversion in ARC/INFO, or added to a view as an Image theme in ArcView.

The information for this image, obtained from the JPEG header record above, that would be used with PROJECTDEFINE after IMAGEGRID is:




FSRN Home Page / GIS/RS Helpdesk Page