コード例 #1
0
        parameter_info[parameter_index['out_routes_name']].displayName)
    nau.check_valid_table_name(
        out_directions_name, out_gdb_workspace, 30101,
        parameter_info[parameter_index['out_directions_name']].displayName)
    nau.check_valid_table_name(
        out_facilities_name, out_gdb_workspace, 30101,
        parameter_info[parameter_index['out_facilities_name']].displayName)

    desc_nds = arcpy.Describe(network_dataset)
    desc_nds_attributes = desc_nds.attributes

    #Convert all input features to feature sets or recordsets if they are not
    #This is required as if input is passed a feature layer or feature class
    #We will end up directly modifying the inputs

    facilities_obj = nau.InputFeatureClass(facilities)
    #Store the OBJECTID field for facilities as it will used later when exporting output facilities
    orig_input_facilities_oid = facilities_obj.origOIDFieldName
    #Store all the fields names from input facilities to be used later when exporting output facilities
    orig_input_facilities_fld_names = facilities_obj.fieldNames
    incidents_obj = nau.InputFeatureClass(incidents)
    point_barriers_obj = nau.InputFeatureClass(point_barriers)
    line_barriers_obj = nau.InputFeatureClass(line_barriers)
    polygon_barriers_obj = nau.InputFeatureClass(polygon_barriers)
    attribute_parameters_obj = nau.InputTable(attribute_parameters)
    #Keep a list of input copies so we can delete them just before exit
    input_copies = (facilities_obj, incidents_obj, point_barriers_obj,
                    line_barriers_obj, polygon_barriers_obj,
                    attribute_parameters_obj)

    #If the network dataset does not support hierarchy, set the useHierarchy parameter to false.
コード例 #2
0
        strMaxBreakTime) if strMaxBreakTime else INFINITY
    maxBreakDistance = locale.atof(
        strMaxBreakDistance) if strMaxBreakDistance else INFINITY
    forceHierarchyTime = locale.atof(
        strForceHierarchyTime) if strForceHierarchyTime else INFINITY
    forceHierarchyDistance = locale.atof(
        strForceHierarchyDistance) if strForceHierarchyDistance else INFINITY

    descNDS = arcpy.Describe(networkDataset)
    descNDSAttributes = descNDS.attributes

    #Convert all input features to feature sets or recordsets if they are not
    #This is required as if input is passed a feature layer or feature class
    #We will end up directly modifying the inputs

    facilities_obj = nau.InputFeatureClass(facilities)
    #Store the OBJECTID field for facilities as it will used later when exporting output facilities
    orig_input_facilities_oid_fld_name = facilities_obj.origOIDFieldName
    #Store the describe object and all the fields names from input facilities to be used later when exporting output facilities
    orig_input_facilities_desc = facilities_obj.describeObject
    #orig_input_facilities_fld_aliases = {f.name:f.aliasName for f in orig_input_facilities_desc.fields}
    point_barriers_obj = nau.InputFeatureClass(pointBarriers)
    line_barriers_obj = nau.InputFeatureClass(lineBarriers)
    polygon_barriers_obj = nau.InputFeatureClass(polygonBarriers)
    attribute_parameters_obj = nau.InputTable(attributeParameters)
    #Keep a list of input copies so we can delete them just before exit
    input_copies = (facilities_obj, point_barriers_obj, line_barriers_obj,
                    polygon_barriers_obj, attribute_parameters_obj)

    #Get counts for facilities, incidents, barrier features and attribute parameters
    facility_count = facilities_obj.count