How to link to TUFLOW manually
    • 03 Aug 2022
    • 7 Minutes to read
    • Dark
      Light

    How to link to TUFLOW manually

    • Dark
      Light

    Article Summary

    The recommended procedure for creating TUFLOW 1D-2D link lines is to Use the TUFLOW link-lines generator. However, the manual procedure (if required) is as follows:

    1. Load boundary line shapefile and Flood Modeller node points

    Shapefiles representing the TUFLOW model boundary line and the 1D model node points are required to define the path of the new link lines. The standard ‘Add GIS Data’ button is used to add the boundary line shapefile to the Layers box. Select ‘Add GIS Data’ from the Home tab under the GIS Data section. Use the same procedure to load the .gxy file.

    You will be prompted to save your .gxy file as a new point shapefile, which will be created from your georeferenced 1D nodes. A filename and location for the new shapefile will need to be specified. The new file will be added to the viewport and the Layers Box. Note; if the gxy file has been loaded in Flood Modeller before, then just load the point shapefile that was created previously.

    2. Start drawing a new link lines shapefile

    To start drawing a new link lines shapefile click the Connection Line button in the TUFLOW section of the 2D Build toolbar tab. You will be prompted to provide a new filename and location for the new link line shapefile.

    Alternatively select New > Shapefile from the Home tab to access the following window:
    Integratedimagestfshp.jpg

    Select the required file type and specify a filename and location for the new link line shapefile. Click the OK button to continue.

    After a filename is specified the new shapefile will be added to the Layers Box and automatically put into edit mode. The snapping control can be activated by selecting it in the Layer Editor.

    3. Set snapping control

    Integratedimagessetsnapcon.jpg

    • Select (by clicking on the tick box) the boundary line shapefile and Flood Modeller node points shapefile (only) in the list of available files to snap to in the Snapping Control window.
    • Set snapping criteria to 'Any point' to allow any part of the boundary line to be traced. Other snapping options are start point only, end point only and both end points (these are used in the generation of other model specific shapefiles).
    Useful tip:

    The link lines should join perpendicular to the boundary line. It may therefore be necessary to first edit your boundary line to add extra points (vertex) into each segment to enable you to snap to the most appropriate locations. Alternatively you could use the 2D model link line generator tool to set up a line that traces along your boundary and places points exactly perpendicular to the 1D node point locations. You can then utilise this line in the snapping operation instead of your TUFLOW boundary line.

    4. Draw link lines

    Use the pan and zoom tools to position the map view where you wish to draw your link line. Then click on the Line button, in the Draw section of the Layer Editor tab to activate the drawing tool on your map (the mouse pointer will change to a pencil icon). Draw a link line as follows:

    • Move the cursor close to the boundary line point where you want to start drawing. The cursor will 'jump' to the closest point. Click to start a new line from here.
    • Move the cursor close to the 1D node point you want to link to and the current line should ‘jump’ to this location. Double click to complete this line.
    • Repeat this process to add further link lines. A useful tip is to remember that you can still use the pan and zoom controls while drawing to enable you to move to a different area of the map. The drawing mode will be deactivated while you pan or zoom (click pan button again and you will be able to continue drawing).
    • To stop drawing click the Stop Edit button in the Layer Editor and save your work (the pencil icon of the mouse pointer will change back to a standard pointer).

    Integratedimagesdrawtflines.jpg

    As you are drawing, a menu bar should appear on your map with options to undo the last point, stop drawing the line or cancel. Alternatively you can click Stop Edit and Save on the Layer Editor.

    Note that until a save operation is performed, the new edits are not save to the disk.

    5. Define link line attributes

    If a polyline shapefile is to be exported to a link lines MIF/MID file, then the required attributes are: id , type , flags , name , f , d , td, a and b . These should be created automatically if the shapefile has been created as a link line in Flood Modeller. Within these files, Field should be set to ‘CN’.

    While in edit mode, if the attribute table is not automatically visible, it can be activated by right-clicking on the link line file in the Layers Box and selecting Show Attributes from the displayed menu.

    Integratedimagesdefineattributes1.jpg

    All associated attribute data are then displayed in tabular format within a new window. The field headings are listed with a required field type code. . These are ‘String’ for text entry, 'Double' for a decimal number entry (i.e. real number) and 'Integer' for an integer number entry. The values assigned to each attribute can be edited to your required values. Editing is done by clicking on a cell in the attribute table and typing in a new value. Alternatively double clicking on a feature row in the attribute table displays the attributes of the selected feature in a new window, as shown in the example below:

    Integratedimagesdefineattributes2.jpg

    Edit values here by double-clicking on a cell and typing in your new value. After editing attributes for one feature you can use the buttons provided in the lower right of the window to accept edits and move on to edit an adjacent feature. Alternatively, you can use the buttons provided in the upper right of the window to move to adjacent features without applying any changes or to close the window to return to the main attribute table.
    Continue editing until your attribute table is fully populated.

    Integratedimagesdefineattributes3.png

    If the shapefile does not contain all required fields, then access the 'Edit Attribute table fields’ option, accessed at the top of the main attribute table window. This will display the tool shown below:

    6. Save link line file

    When all required changes have been made, select Stop Edit from the Layer Editor (left hand button) and select to save changes when prompted.

    7. Export data to MIF/MID format

    Highlight the shapefile in the Layers Box and click the SHP to MIF button located in the TUFLOW section of the 2D Build toolbar tab. A browser window will be displayed for you to select a filename and location for the new MIF/MID files.

    Click the Save button to create the new file or click the Cancel button to close the window without creating a new file. Note it is possible to load the new MIF/MID file created into the Flood Modeller viewport (where it will be displayed again as a shapefile).

    8. Set up TUFLOW 1D-2D Link Line Attributes in a standard polyline shapefile

    If you are using an existing shapefile that does not contain all the required fields, then you can use Flood Modeller to append the fields required by TUFLOW. The procedure is as follows:

    • Load the link line shapefile into Flood Modeller. Select Add GIS Data from the Home (in GIS Data section).

    • Select the shapefile in the Layers Box, right click and select Start Edit from the displayed menu. The Layer Editor tab will open. Right click on the shapefile again and select Show Attributes from the drop down menu or select Attribute Window button from Layer Editor tab.

    • Click the Edit attribute table fields button, in the Attributes Window toolbar. A new window (field editor window) will be displayed that lists the currently defined attributes.

      Integratedimagestfattlist.jpg

    To define a new attribute field using the New Field function (upper right corner of the Field Editor window), you must define an attribute field name and type, i.e. string, integer or real number (for the latter, a number of decimal places to store is set by the precision value). Click on the 'Add New Field At End' button to create the new field within your shapefile. For a TUFLOW link lines shapefile this method must be repeated for all required fields.

    Note:

    no existing fields are removed from your shapefile in this process. Unwanted fields can be removed by selecting them in the Field Editor table, placing a tick in the adjacent box, and clicking the 'Delete Checked' button in the toolbar.

    When you close the Field Editor window, your updates should appear in the attributes table, ready for you to start adding values against the new attributes (as described in Step 6 above).


    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.