For 30-meter resolution land use (only for CONUS)


Step 1: Download landuse data from http://gisdata.usgs.net/website/MRLC/viewer.php. Either of the 1992 or the 2001 data sets may be used, though the correct code for converting the urban categories to the categories used by the UCM should be run in step 3, below. After selecting an area to download, make sure to select GeoTIFF format in the "Request Summary Page" by clicking on "Modify Data Request". Previously, the data were available in BIL format, which removed the need for format conversions in step 2; however, BIL format appears to no longer work.
Step 2: After downloading the data, unpacking the archive should yield a directory with a .tif file and a .tfw file, among others. In order for the information in the GeoTIFF file to be useful, the .tif image must be converted into the binary format used by the WPS. This can be accomplished by first using a graphic conversion utility, such as ImageMagick convert, to convert the .tif image into a .rgb image. Then, actual category information can be easily extracted from the .rgb file using the rgb2bil_general.c program and its additional input file, cat.tbl. Besides the name of the .rgb file, the rgb2bil program takes as command-line arguments the x- and y-dimensions of the image; these can be determined by a variety of graphics manipulation/viewing programs. After running the rgb2bil program on the .rgb file, the resulting data.bil file must be renamed to 00001-ncols.00001-nrows, where ncols is the number of columns (in i5.5 format) and nrows is the number of rows (also in i5.5 format) in the image.
The procedure described in this step might look something like the following:
         > convert 49019336.tif 49019336.rgb
         > gcc -o rgb2bil -DINEXACT rgb2bil_general.c

         (figure out the dimensions of the image)

         > rgb2bil 49019336.rgb 4922 5306     (where 4922 and 5306 are replaced by the dimensions of your data)
         > mv data.bil 00001-04922.00001-05306
         
NOTE: The cat.tbl file mentioned above is for NLCD 2001 data and does not contain an exhaustive list of all possible categories in the NLCD data; it only contains information about the categories shown here. Any categories not found in cat.tbl will be set to 0, and treated as missing data in the WPS.
Step 3: Re-map the categories onto categories that are defined in LANDUSE.TBL. If only urban categories are required (for use, perhaps, with the UCM in WRF), this may be accomplished using the code for 1992 data or the code for 2001 data (you'll need to edit the tile dimensions at the top of the source code before compiling in either case). In general, either of these codes may be modified to re-map the categories as necessary.
Step 4: Create an "index" metadata file for the data. In the directory created by unpacking the land use data, a .tfw file should also exist. The last two lines in this file give the location of the north-west corner of the data tile, which is used in the index file for variables known_lat and known_lon. If this location is given as (x,y) coordinates, in meters, then the this code may be used to convert to (latitude, longitude), which is required by the index file.
         type=categorical
         category_min=31
         category_max=33
         projection=albers_nad83
         dx=30.0
         dy=30.0
         known_x=1.0
         known_y=4161.0             # <- edit
         known_lon=-77.673554       # <- edit
         known_lat=39.582862        # <- edit
         truelat1=29.5
         truelat2=45.5
         stdlon=-96.0
         wordsize=1
         missing_value=0.
         row_order=top_bottom
         tile_x=5449                # <- edit
         tile_y=4161                # <- edit
         tile_z=1
         units="category"
         description="3-category NLCD 1992 urban"
         
Step 5: Add an entry to GEOGRID.TBL file specifying the path to the directory with the data tile and index file. This entry might look something like:
         ===============================
         name=LANDUSEF
                 priority=2
                 dest_type=categorical
                 interp_option = default:nearest_neighbor
                 abs_path      = default:/mmmtmp/duda/49019336/      # The path to your new land use data
         ===============================
         



For high-resolution topography data (global)


Step 1: Download topography data from http://seamless.usgs.gov/ After selecting an area to download, make sure to select BIL format in the "Request Summary Page" by clicking on "Modify Data Request".
Step 2: After downloading the data, unpacking the archive should yield a directory with a .bil file and a .hdr file. The .hdr file will give the number of rows and columns in the data tile; using these dimensions, the .bil file should be renamed to 00001-ncols.00001-nrows, where ncols is the number of columns (in i5.5 format) and nrows is the number of rows (also in i5.5 format). Since ncols and nrows can have at most 5 digits, the data tile cannot have a dimension larger than 99999.
Step 3: Create an "index" metadata file for the data. Also in the directory, a .blw file should exist. This file gives the (i,j) location of the upper-left corner of the data tile. Convert these coordinates to a latitude and longitude (if they aren't already given as such) and use them in the index file.
         type=continuous
         projection=regular_ll
         missing_value=0.
         dx=0.0002777
         dy=0.0002777
         known_x=1.0
         known_y=3820.0             # <- edit
         known_lon=-79.358497       # <- edit
         known_lat=40.256750        # <- edit
         wordsize=2
         row_order=top_bottom
         endian=little
         signed=yes
         tile_x=4632                # <- edit
         tile_y=3820                # <- edit
         tile_z=1
         units="meters"
         description="topography"
         
Step 4: Add an entry to GEOGRID.TBL file specifying the path to the directory with the data tile and index file.