CALC_ATTR_FORMULA

The CALC_ATTR_FORMULA command allows you to calculate a new attribute value (or update the value for an existing attribute) for features in a layer, based on a formula that may contain numbers, strings or other attributes. A number of functions may be used as well.

The following parameters are supported by the command:

SAMPLE

Here is a sample of creating a new elevation attribute in feet from an elevation attribute (ELEV_M) in meters, including with an appended unit string.

GLOBAL_MAPPER_SCRIPT VERSION=1.00
// Create new ELEV_FT attribute with attribute in feet in any loaded layers
CALC_ATTR_FORMULA NEW_ATTR="ELEV_FT" FORMULA="ELEV_MT * 3.2808"
// Append the unit name to the new attribute
 CALC_ATTR_FORMULA NEW_ATTR="ELEV_FT" FORMULA="ELEV_FT + ' ft'"



Topic Overview

Attribute Management

Tool Information

Attribute Calculator