CALC_ATTR

The CALC_ATTR 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 source attribute (including things like the feature label or type) and a second value. The second value can be a specified string or number, or the value from another attribute of the feature.

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 TYPE="MULTIPLY" NEW_ATTR="ELEV_FT" SOURCE_ATTR="ELEV_MT" VALUE="3.2808"
// Append the unit name to the new attribute
CALC_ATTR TYPE="APPEND" NEW_ATTR="ELEV_FT" SOURCE_ATTR="ELEV_FT" VALUE=" ft"

 




Topic Overview

Attribute Management

Tool Information

Attribute Calculator

Scripting Reference

CALC_ATTR_FORMULA