I would like to calculate the slope value in %, but I don’t want to have any negative values. If there are negative values in the slope field, I would like to multiple them by -1 and if not, multiple them by +1 (or do nothing).
My input is a line shapefile. First I added a field called "slope", then I calculate the slope based on other fields.
arcpy.AddField_management(ShapeFileLine, "Slope", "DOUBLE", 10, 3) arcpy.CalculateField_management(ShapeFileLine, "Slope", '((((!END_Z! - !START_Z!)/!LENGTH_3D!))*100)!',"PYTHON")
What I should do if I want I only have positive values? In this case they are all negatives, but sometimes the positive and negative values are mixed