Link all sites within a layer
- RivEX can generate routes between sites within a single layer. The default output is an Excel file but output can be sent to a Shapefile. The advantage of creating a Shapefile is that you can visualise your output.
- The number of links RivEX must test is number of sites2, thus a dataset of 1000 sites would mean 1,000,000 combinations. Fortunately RivEX will never test this number as the linking process is optimised:
- Sites are first sorted into catchments. Linking is never attempted across catchments as these sites could never possibly be linked. A catchment is defined as all polylines flowing to a network mouth.
- The route between 2 sites is only ever recorded once. Thus route from site A to B is recorded but route B to A is ignored.
- The number of routes generated if all sites were snapped to a network in a single catchment would be (n2 - n ) / 2 where n is the number of sites in the input layer.
- RivEX does not use a shortest path algorithm when attempting to link 2 sites. For Each site a route to the river mouth is generated and these are intersected. Where they share a common path this is removed and what's left is the route that links both sites. See image below.

- To use this tool you must complete the parameters section of the main interface and press the build button.

- Click on the Link Sites tab and complete the input parameters as shown below. If your site layer contains more than 256 sites you will be warned that this will exceed the capacity of MS Excel. You must either reduce the number of sites in the input layer or choose to have the results sent to a Shapefile.

- Select your site layer and site ID field. Sites must be snapped to the network and the ID must be a numeric value.
- Select the catchment ID field. This is a value encoded into the network by RivEX. Ensure your network has this encoded before you attempt to use the linking tool.
- If you check the store routes as polylines option then the textbox enables and you can enter a file name. Simply enter the name without the ".shp" file extension or path. RivEX with store the data in C:\RivEX\Output.
- Click on Go! to start the processing.
- During processing you make experience the follow error message (but with different ID numbers). Your network is forming a loop and RivEX cannot reach the river mouth. You must exclude all sites upstream of the inverted polyline or edit you network to make sure the polyline is pointing in a downstream direction.

- If you have chosen to send your output to a Shapefile then metadata will be created.
