Cross Section Viewer

Managing Reference Stations

The following instructions describe how to add reference stations into a Cross Section Viewer database. The software does not automate this process and so it requires manual manipulation of the data and inserting them by hand into the database in question.

Reference Station data refer to individual cross sections, meaning this process requires that you know the database ID of each cross section. This is only practical if you are adding just a handful of data points. However, it can be burdonsome if you have lots of data, in which case we recommend the bulk data process described at the bottom of this page.

Preparation

This process requires writing SQL commands to insert data into the database. You will need a database software tool to execute these commands. We recommend one of the following. The first two are free, lightweight tools.

Step 1 - Backup

Make a copy of the Cross Section Viewer database that you intend to change. Simply create a zip archive as a precaution to something going wrong and you needing to recover the previous version.

Step 2 - Create a new Reference Station Type

  1. Open the database software that you selected from the list above.
  2. Connect to the Cross Section Viewer database that you wish to change.
  3. Open the StationTypes table.
  4. Add a new row and enter the Tilte of the new Reference Station type. Also enter an integer specifying how many station values you expect to provide for each cross section. Typically this is 1 or 2. Also enter your name in the AddedOn and UpdatedOn fields. You do NOT need to provide a TypeID or the date fields.
  5. Save and commit the record.
  6. Note down the new TypeID generated by the database. (Depending on which software you are using you might need to refresh the data table contents before this is visible.)

Step 3 - Insert Reference Station Data

Open the StationValues table and enter the new reference station values into this table using the following values:

  • ReferenceID - Do not enter a value for this field. The database will provide this value.
  • CrossSectionID - the ID of the cross section for which the reference station value applies. If you are unsure of the CrossSectionID to use, they can be found in the CrossSections database table.
  • TypeID - This is the value noted down at the end of the previous step.
  • Station - This is the new reference station value. Note that it must be in the same units as the rest of the cross section database being altered. Use the Database Info to determine this if you are unsure.

Bulk Data

The process described above if only practical if you have a small number of records to enter. If you have lots of cross sectioyns you can build a text file of SQL commands to perform Step 2. The following example shows an example of a text file for inserting Rectified Channel Line data. Note how each cross section ID appears twice; once for the left RCL station and a second time for the right RCL. Note that the TypeID for the new Reference Station Type in this example is 5.

You can copy and paste the contents of the text file into one of the database softwares listed above and execute this command to insert thousands of data values in one operation.

INSERT INTO StationValues (TypeID, CrossSectionID, Station) VALUES
    (5, 1, 1.3),
    (5, 1, 7.9),
    (5, 2, 1.5),
    (5, 2, 8.1),
    (5, 3, 1.9),
    (5, 3, 8.3);