I'm attempting to change the symbology for the National Bridge Inventory layer. By default, it is set to create symbology based on the Deck Structure field. However, for our purposes we need to base the symbology around an average of Deck Structure, Substructure, and Superstructure. We also want to flag any records where all three of these fields are equal to 5.
I've tried several variations of code, such as using a When statement, creating a function to flag those "5" records, etc. Some have ended in errors, others have produced bad results such as symbolizing everything as "Unknown". Right now, my code consists of several if/else statements:
var c = $feature["DECK_COND_058"]
var ss = $feature["SUPERSTRUCTURE_COND_059"]
var sb = $feature["SUBSTRUCTURE_COND_060"]
var avg = AVERAGE($feature["DECK_COND_058"], $feature["SUPERSTRUCTURE_COND_059"], $feature["SUBSTRUCTURE_COND_060"])
if((c == 5) && (ss == 5) && (sb == 5)) {
"Fair, soon to be poor";
} else if (Round(avg = 9)) {
"Excellent to good";
} else if (Round(avg = 8)) {
"Excellent to good";
} else if (Round(avg = 7)) {
"Excellent to good";
} else if (Round(avg = 6)) {
"Satisfactory to fair";
} else if (Round(avg = 5)) {
"Satisfactory to fair";
} else if (Round(avg = 4)) {
"Poor to critical";
} else if (Round(avg = 3)) {
"Poor to critical";
} else if (Round(avg = 2)) {
"Poor to critical";
} else if (Round(avg = 1)) {
"Failed to imminent failure";
} else if (Round(avg = 0)) {
"Failed to imminent failure";
} else {
"Unknown";
}
This returns the following error:
Execution Error:Runtime Error:
I'm not really sure what this means. Any insight? Can you spot any obvious flaws in my code? Thanks in advance!