Skip to content

Generate Directional Links (Utilities) Tool

Noel Peterson edited this page Dec 19, 2013 · 4 revisions

This tool takes a bi-directional network feature class (i.e. the hwynet_arc in the MHN) and generates a directional one (in a user-specified location) based on the values in the DIRECTIONS field. Specifically, any link with DIRECTIONS = 2 OR DIRECTIONS = 3 will be duplicated, and the duplicate will be flipped so that it is digitized in the opposite direction. All direction-dependent attributes (e.g. ABB, BEARING, etc.) will be adjusted for the duplicates, and the no-longer-meaningful attributes (e.g. AMPM2, THRULANES2, etc., as well as DIRECTIONS) will be deleted for all links.

The resultant feature class is useful, in particular, for calculations of lane-miles (i.e. THRULANES1 * MILES); without generating directional links, lane-miles would have to be calculated via a somewhat complicated function, like the following:

def calc_lanemiles(directions, miles, lanes1, lanes2):
    ''' A method to calculate lane-miles for a given link. '''
    if directions == '1':
        lanemiles = miles * lanes1
    elif directions == '2':
        lanemiles = 2 * miles * lanes1
    elif directions == '3':
        lanemiles = miles * lanes1 + miles * lanes2
    return lanemiles

Clone this wiki locally