020] How to Use Point Layer Attributes in Global Mapper | Calculate & Formula Methods

Automate Point Layer data management by performing arithmetic operations and complex formula-based attribute calculations.

This tutorial explores the "Calculate/Copy Attribute Value(s)..." feature in Global Mapper. You will learn to add new attributes, duplicate existing data, and leverage the formula engine to streamline data preparation for 3D GIS and urban simulations.

How to Use Calculate/Copy Attribute Value(s)

The following four items are what differentiate point layers from elevation or raster layers, and they are commonly used in all vector-attribute layers:

Point Layer's Context Menus
img 1 : Point Layer's Context Menus
  • Calculate/Copy Attribute Value(s)...
  • JOIN - Join Attribute Table/File to Layer
  • Create Label Layer...
  • SPLIT - Split Into Separate Layers Based on Attribute Value...

Open the file from our last session and activate the point layer.

Control Center window showing the Point layer with 6 features
img 2 : Control Center window showing the Point layer with 6 features

Editing Point Attributes Using Digitizer Tool

Before we dive into the menu, let's assign a name to each point. Select the Digitizer Tool (Alt+D).

Digitizer Tool in the Global Mapper toolbar
img 3 : Digitizer Tool in the Global Mapper toolbar

Starting from the point at the top-left of the screen and moving clockwise, we will name them 1 through 6.

"Modify Feature Info" window for the first point, with "1" entered in the Name field
img 4 : "Modify Feature Info" window for the first point, with "1" entered in the Name field

Double-click a point to bring up the Modify Feature Info window. Enter "1" in the Name field and click OK. Repeat this for the other points, numbering them 2 to 6.

Map view showing points with labels 1 through 6 displayed next to them
img 5 : Map view showing points with labels 1 through 6 displayed next to them

The names we entered are now visible next to the points. (I will cover label display settings in more detail in a later post.)

Today, we will try the Calculate/Copy Attribute Value(s)... function. This menu is used when you want to add, copy, or change the attributes of a feature.

Right-click context menu on the Point layer highlighting the "Calculate/Copy Attribute Value(s)..." option
img 6 : Right-click context menu on the Point layer highlighting the "Calculate/Copy Attribute Value(s)..." option

When you select the menu, a window appears asking you to choose the layer to operate on. Select "Point" and click OK.

"Select Layers" dialog with the Point layer checked
img 7 : "Select Layers" dialog with the Point layer checked

Simple Calculation Method

The attribute calculation setup window will appear. Attribute values can be calculated in two ways: Simple Calculation and Formula Calculation.

1. Use Simple Calculation

I plan to add a new attribute named "elevation" and input the result of multiplying the current Feature Name by 5.

"Attribute Calculation Setup" window configured for a simple multiplication calculation
img 8 : "Attribute Calculation Setup" window configured for a simple multiplication calculation
  • Select Existing or Create New Attribute...: Choose an existing attribute or enter a new name to assign the calculated values. I've entered "elevation" to create a new attribute.
  • Source Attribute: Select the base attribute for the calculation. I chose <Feature Name>.
    Select the base attribute for the calculation
    img 9 : Select the base attribute for the calculation
  • Operation: Select the mathematical operator. I chose Multiply.
    chose Multiply
    img 10 : chose Multiply
  • Use Fixed Value: Enter a constant value for the calculation. I entered "5".

Click Calculate. A notification will appear stating that the attributes of 6 features have been modified. Note that the calculation window stays open; you can close it manually after checking the message.

Notification dialog: "Modified the attributes of 6 features"
img 11 : Notification dialog: "Modified the attributes of 6 features"

Now, let's verify the changed attribute values. You can either double-click with the Digitizer Tool or use the Feature Info Tool for a single click.

Feature information for point "2" showing the new "elevation" attribute with a value of 10
img 12 : Feature information for point "2" showing the new "elevation" attribute with a value of 10

I checked the information for point "2," and it correctly shows that the "elevation" attribute has been added with a value of 10 (2 * 5). The calculation was successful.

Global Mapper Formula Calculator Functions Explained

Formula-Based Attribute Calculation

Formula calculation allows you to generate attribute values using a wide variety of conditional expressions and functions. It is incredibly useful for complex automation.

Let's create another attribute named "Height" and input a value calculated by multiplying the Feature Name by 5 and then adding 1.

"Attribute Calculation Setup" window configured for Formula Calculation with the formula " * 5 + 1"
img 13 : "Attribute Calculation Setup" window configured for Formula Calculation with the formula " * 5 + 1"

Available Attributes and Variables

  • Available Attributes: Select the attribute you wish to use and click Insert. This adds <Feature Name> to the formula box.
    Available Attributes
    img 14 : Available Attributes
  • Available Functions: Provides a long list of available functions (log, sqrt, abs, if-statements, etc.).
    Available Functions
    img 15 : Available Functions
  • Calculation Modes: Numeric vs String

  • Calculation Mode:
    • Automatic: Handles input as numbers or strings automatically.
    • Numeric: Processes values as numbers.
    • String: Processes values as text.
  • Status / Sample result: Allows you to preview the formula's calculation result before applying it.

Click Calculate and check the results.

Final attribute check for point "2" showing both "elevation: 10" and the new "Height: 11"
img 16 : Final attribute check for point "2" showing both "elevation: 10" and the new "Height: 11"

It has been updated correctly. Point "2" now has a "Height" value of 11 (2 * 5 + 1).

To master conditional operations, you'll need to study the various functions. If you press F1 in Global Mapper to open the Help window and search for Formula Calculator, you can find a comprehensive reference guide.

Global Mapper Help screen showing the "Formula Calculator" and "Formula reference" documentation
img 17 : Global Mapper Help screen showing the "Formula Calculator" and "Formula reference" documentation

That's all for today...

Continue Learning
Explore complete tutorial collections for CityEngine and Global Mapper.

Comments

Popular posts from this blog

029] How to Split Polygon Areas with Intersecting Lines in Global Mapper

[008] How to Understand CGA Rule Structure in CityEngine (Beginner Guide)

046] How to Create Parallel Offset Lines in Global Mapper