Skip to main content

Update HydroID with Seed

Description

Given a workspace, update the HYDROID, and Related IDs [e.g., FeatureID, StreamID, DrainID, NextdownID, RiverID etc] with a specified Seed value, e.g., Seed=10000000. The layer and the fields are specified by an configuration json file (optional). The content of json file looks like this:

{
"layers": [
{
"layer":"fpzoneriver",
"fields":[
"StreamID"
]
},
{
"layer":"fpriver",
"fields":[
"HydroID",
"DrainID",
"NextDownID",
"SplitID",
"GRIDID"
]
},
{
"layer":"fpcatchment",
"fields":[
"HydroID",
"NextDownID",
"StreamID",
"GRIDID"
]
},
{
"layer":"pf_ModelStream",
"fields":[
"StreamID",
"RiverID",
"GridID"
]
},
{
"layer":"TSXRef",
"fields":[
"FeatureID",
"KeyTo"
]
}
]
}

If the optional config json file is not provided, a default json_string is provided in the code.

Usage

Parameters

Parameter NameTypeDirectionData TypeDialog Reference
Input GeodatabaseRequiredInputWorkspaceGeodatabase
HydroID SeedRequiredInputLongHydroID Seed, e.g., 1000000, The HydroID Seed value will be added to HydroID and RelatedID fields.
Config Json FileOptionalInputText FileConfiguration Json file. If not provided, the following default json_string will be used:

{
"KeyIDField": "HYDROID",
"IDFields": [
"HYDROID",
"DRAINID",
"FEATUREID",
"NEXTDOWNID",
"JUNCTIONID",
"SUBELEMENTID",
"HYDROEDGEID",
"HYDROEDGEID",
"STREAMID",
"RIVERID"
],
"ExclusiveLayerNames": ["APUNIQUEID", "HYDROIDXREF", "LAYERKEYTABLE"]
}
Backup Layer SuffixOptionalInputStringBackup_Layer_Suffix = a layer will be copied to create a backup layer, with layername=layername+"_"+Backup_Layer_Suffix before its IDs are updated,When Backup_Layer_Suffix= "", (Blank), Not backup copy of the layers will be created.