I am using the Utility Network and need a rule to change the Z value of each vertex in a line depending on the lifecycle status. I already wrote a rule for devices and it is working, but nothing I've tried for the lines is working. I am including the expression used for point features (devices). Could someone help with how to adapt this for line features?
// This rule updates the Z value of features based on the lifecycle status
var lcs = $feature["lifecyclestatus"];
// Create a copy of the feature's geometry
var newGeom = Geometry($feature);
var newZ;
// Update the Z value based on lifecycle status
// Domain values: proposed = 1, in service = 8, out of service = 256, abandoned = 32
if (lcs == 1) {
newZ = 1;
} else if (lcs == 8 {
newZ = 0;
} else if (lcs == 256) {
newZ = -1;
} else if (lcs == 32) {
newZ = -2;
} else {
newZ = 0;
}
// Create a new geometry with updated Z value
var updatedGeom = Point({
"x": newGeom.x,
"y": newGeom.y,
"z": newZ,
"spatialReference": newGeom.spatialReference
});
// Return the updated geometry
return updatedGeom;