Task A2/B3: Preparing Basin and Stream Shapefiles for Localization

Updated 04/03/08

This process creates the final basin and stream shapefiles to be used with FFMPA. The basin shapefile must be processed to ensure that all basins are larger than a specified minimum area (1.74 square miles by default). Removing the very small basins is required to minimize FFMP CPU usage and to ensure the basins can be resolved on the D2D display. In addition, the basin and stream shapefiles must be checked to make sure the required attributes exist and are in the expected order in the attribute table.

Step 1 - Aggregate Small Basins (Merge By Area)

Procedure:

NOTE: This script takes a few hours to run--time will vary depending on the domain size and computer power.

** Before beginning, make sure the basins_all shapefile is in your current workspace folder. **

The Merge By Area script will be used to aggregate most of the small basins. The script aggregates basins during five iterations--one to merge basins with an adjacent or "sibling" basin if possible, and four additional iterations to merge basins with their immediate upstream basins.

  1. Expand the Merge Basin Tools toolset in the FFMPA Toolbox.
  2. Double-click the Merge By Area script to open it.
    1. From the pull-down list, select the basin layer to aggregate (basins_all).
    2. Enter the minimum area threshold in square miles (default is 1.74).
    3. Select a name for the new feature class (basins_mrg_area.shp).

NOTE: If you receive an error when running this script, please contact Ami.Arthur@noaa.gov.

Step 2 - Aggregate Small Basins (Merge With Next DS)

Procedure:

This script should take less than an hour to run (usually 30-45 minutes).

The Merge with Next DS script will be used to aggregate some of the remaining small basins with their immediate downstream basins. We will first use two queries to select those small basins that do have a downstream basin with which they can be merged, and then run the Merge with Next DS script on this selection.

  1. Check for basins that are smaller than the specified area threshold:
    1. From the Selection menu, choose Select By Attributes.
    2. Choose the basins_mrg_area layer for Layer.
    3. Choose "Create a new selection" for Method.
    4. Create the following query string: "AREA_SQ_MI" < 1.74
    5. Click Apply.
    6. In the same Select by Attributes window, change the Method to "Select from current selection".
    7. Create the following query string: "PARENT_ID" <> 0
    8. Click OK.
  2. If any basins are selected after the query, you should run the Merge With Next DS script. Double-click the Merge With Next DS script to open it.

    (NOTE: If no basins are selected, you can move on to Step 4 - Check Basin and Stream Shapefile Attributes).

    1. From the pull-down list, select the basin layer to aggregate (basins_mrg_area).
    2. Select a name for the new feature class (basins_mrg_ds.shp).

Step 3 - Aggregate Small Basins (Merge Selected)

Procedure:

This script should take less than an hour to run (usually 30-45 minutes).

The Merge Selected script will be used to aggregate any of the remaining small basins that are able to be aggregated. We will first do a query to select the remaining small basins.

  1. Turn all layers off except basins_mrg_ds and derivedstr_all.
  2. Check for basins that are smaller than the specified area threshold:
    1. From the Selection menu, choose Select By Attributes.
    2. Choose the basins_mrg_ds layer for Layer.
    3. Choose "Create a new selection" for Method.
    4. Build the following query string: "AREA_SQ_MI" < 1.74
    5. Click OK.
  3. If any basins are selected after the query, you should examine each one and determine if further aggregation is needed.

    (NOTE: If no basins are selected, you can skip the rest of this section and move on to Step 4 - Check Basin and Stream Shapefile Attributes).

    It is helpful to overlay the derivedstr_all shapefile to help determine which basins should be selected for aggregation. The Merge Selected script requires selected upstream/downstream basin pairs, or trio selections made up of two adjacent (sibling) basins and their immediate downstream basin. The Merge Selected script will work for one or many basin pair/trio selections.

    NOTE: Each selected basin pair/trio should be isolated from (not hydrologically connected to) other selected pairs/trios.

  4. After selecting the basins to be aggregated, double-click the Merge Selected script to open it.
    1. From the pull-down list, select the basin layer to aggregate (basins_mrg_ds).
    2. Select a name for the new feature class (basins_mrg_sel.shp).

Step 4 - Check Basin and Stream Shapefile Attributes

Procedure:

  1. Make a copy of your final merged basin shapefile by doing the following:

    • Right-click the final merged basin layer (either basins_mrg_area, basins_mrg_ds, or basins_mrg_sel) and select Data, Export Data.
    • In the window that appears, make sure the following are specified:
      • Export: All features
      • Use the same coordinate system as: this layer's source data
      • Output shapefile or feature class: FFMP_aggr_basins.shp (make sure the specified folder is your current workspace folder)
    • Click OK. After the FFMP_aggr_basins shapefile is created, click yes to add it as a layer to the data frame.
  2. Double-click the Reorder Fields script to open it. Select FFMP_aggr_basins from the pull-down list. Click OK. This script may take anywhere from about 30 minutes to 1.5 hours to run.

  3. Make a copy of the stream shapefile by doing the following:

    • Right-click the derivedstr_all layer and select Data, Export Data.
    • In the window that appears, make sure the following are specified:
      • Export: All features
      • Use the same coordinate system as: this layer's source data
      • Output shapefile or feature class: FFMP_ref_sl.shp (make sure the specified folder is your current workspace folder)
    • Click OK. After the FFMP_ref_sl shapefile is created, click yes to add it as a layer to the data frame.
  4. Double-click the Reorder Fields script to open it. Select FFMP_ref_sl from the pull-down list. Click OK.

After running Reorder Fields, the attributes in the FFMP_aggr_basins layer should be:

  1. FID
  2. Shape
  3. Pfaf_id
  4. Streamname
  5. Huc
  6. Huc_name
  7. X_outlet
  8. Y_outlet
  9. State
  10. Cwa
  11. Countyname
  12. Fips
  13. Rfc
  14. Modified
  15. Reservoir
  16. X_centroid
  17. Y_centroid
  18. Pfaf_aggr
  19. Basin_id
  20. Parent_id
  21. Length_mi
  22. Area_sq_mi
  23. Flow_acc
  24. Upstream1
  25. Upstream2
  26. Upstream3
  27. Upstream4, etc.
  28. Merged

NOTE: If there are too many additional fields in the basin attribute table (for example, numerous [Upstream] fields), localization problems may occur. In addition, you must have no more than 65000 basin features. If you have more than 30 attribute fields (not including the FID field) or more than 65000 basin features, please contact Ami Arthur (Ami.Arthur@noaa.gov or 405-325-6457) for assistance.

After running Reorder Fields, the attributes in the FFMP_ref_sl layer should be:

  1. FID
  2. Shape
  3. Pfaf_id
  4. Streamname
  5. Huc
  6. Huc_name
  7. X_outlet
  8. Y_outlet
  9. State
  10. Cwa
  11. Countyname
  12. Fips
  13. Rfc
  14. Reservoir
  15. X_centroid
  16. Y_centroid
  17. Pfaf_aggr
  18. Basin_id
  19. Parent_id
  20. Length_mi
  21. Area_sq_mi
  22. Flow_acc
  23. Upstream1
  24. Upstream2
  25. Upstream3
  26. Upstream4 (possibly)
  27. Merged

Step 5 - Copy and Gzip the Files

You should now have the following final files:

NOTE: The *.shp files must be gzipped:

The above files (*.dbf, *.shp.gz, and *.shx) should be copied to AWIPS into /data/local. Do not remove the old FFMP shapefiles from AWIPS yet.

NOTE: When you receive OB8.3, you will need to move the new files from /data/local to /data/fxa/nationalData prior to localization.

Step 6 - Notification of Tier I Completion

Please send an e-mail to Ami.Arthur@noaa.gov and cc the appropriate regional contact(s) (see below) when you have completed the Tier I processing. Please indicate 1) whether you processed the files using ArcMap 9.2 or ArcView 3.x, and 2) approximately how long it took to complete Tier I.

Regional Contacts

Central Region: Noreen.Schwein@noaa.gov and also please use the EMRS to report completion.

Eastern Region: George.McKillop@noaa.gov

Southern Region: Diane.Cooper@noaa.gov and Eric.Howieson@noaa.gov

Western Region: Please use the EMRS to report completion.