Basin Customization - Adding Links Lab 2
Step 3 - Process the streamlink theme to correct broken links
Objective: Correct any problems with the downstream links.
There may be places where the downstream links terminate prematurely
and do not trace completely downstream. The [Parent_id] field will be
0 to indicate the downstream end of the stream network. To fix broken links,
all features with [Parent_id] = 0 must be examined, and the [Parent_id]
value manually reset where necessary to indicate the correct downstream
segment it flows into.
Procedure:
- Start ArcView and open project basins/cust/cust2.apr.
- Open View1.
- Make the slcreatelinks.shp streamlink theme active by clicking
on its legend.
- Add coordinate of the first point in each stream segment to the
attribute table. This will eventually be used in a spatial join to match
the stream segments to the basins.
- From the Bsn-Tools menu, select "Streamlink Points".
- At the prompt for point to extract, select "First node" and then
click the OK button. The coordinates will appear in the attribute table
labeled "X_first" and "Y_first".
- Click on the "Open Theme Table" button
to open the attribute table for the streamlink theme.
- Return to the view and from the View menu, select "Add Event Theme..."
- For the table, select the attribute table for the streamlink
theme.
- For the X and Y fields, choose "X_first" and "Y_first", then
click the OK button. A point theme will be added to the view.
- Make the new point theme the active theme by clicking on its
legend.
- From the Theme menu, select "Properties". Rename the theme to
sl-pts (this is to avoid confusion with the streamlink theme's attribute
table).
- Query for all stream segments with [Parent_id] = 0 on the sl-pts theme:
- Click the Query button.
- Create the query string: ([Parent_id] = 0)
- Click on "New Set" button.
- Close the Query window.
- From the Theme menu, select "Convert to Shapefile...". Use the
default name and answer yes to add the theme to the view. This is a temporary
theme of just the selected points that will be used to indicate the stream
segments that need to be linked.
- Delete the sl-pts theme:
- Make the sl-pts theme active by clicking on its legend.
- From the Edit menu, select "Delete Themes".
- Make the point theme visible by clicking on the check box
in its legend.
- Make the streamlink theme the active theme by clicking on its legend.
Examine all the stream segments indicated by the point theme to check
if they need to be linked to the downstream segment. For each stream segment,
zoom in and:
- First test each stream segment that is not a true outlet segment:
- Click on the "Select Next Downstream" tool.
- Click on the stream segment. If the downstream segment does
not get selected, the link must be repaired.
- To correct the link:
- Use the "Select Feature" tool
to select the segments to link together. Select all upstream segments that
have [Parent_id] = 0 and the downstream segment.
- From the Bsn-Tools menu, select "Link Selected Basins".
- If the selection is correct (i.e. the count matches what was
just selected), answer yes at the prompt. If trying to link downstream
to an outlet basin, you will need to identify the [Basin_id] of the downstream
basin (using the "Identify" tool first).
- To test the new link:
- Click on the "Select Next Downstream" tool.
- Click on the upstream segment. The downstream segment should
now get selected.
- Once all links are corrected:
- Make the streamlink theme the active theme by clicking on its
legend.
- From the Bsn-Tools menu, select "Add Upstream Links".
- Always run "Add Upstream Links" after using "Link Selected
Basins" to reestablish the upstream links!
- Delete the temporary point theme:
- Make the point theme the active theme by clicking on its legend.
- From the Edit menu, select "Delete Themes".
- Click on the "Save Project" button.

- From the File menu, select "Manage Data Sources" and delete the
temporary point theme from disk.
- Verify the stream segments linked together:
- Make the streamlink theme active by clicking on its legend.
- From the Bsn-Tools menu, select "Theme Comments". This will display
a log of processing done and should match the following:
- BasinC.LinkBasins: Linked 3 basins: 835 851 to 890.
- BasinC.LinkBasins: Linked 2 basins: 6955 to 10170.
- BasinC.LinkBasins: Linked 2 basins: 9821 to 9932.
- BasinC.LinkMenu: Recomputed upstream Links
Step 4 - Merge Multiple Streamlinks in a Basin.
Objective: Ensure there is only one line segment per basin.
There may be multiple line segments per basin in the original stream
network shapefile, and these need to be merged to create a one-to-one relationship
between the basin polygons and the streamlink segments. Some of these can
be processed automatically with the "Merge Multiple Stream Segments" function.
Line segments merged by this function are identified by as having only
a single upstream link ([Upstream1] > 0 and [Upstream2] = 0) and the
same [Pfaf_id] value as the upstream segment.
Procedure:
- Start ArcView and open project basins/cust/cust2.apr.
- Open View2.
- Make the slfixedlinks.shp streamlink theme active by clicking
on its legend.
- From the Bsn-Tools menu, select "Merge Multiple Stream Segments".
Save to file slmerged1.shp.