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:
- 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.
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).
Starting from the point at the top-left of the screen and moving clockwise, we will name them 1 through 6.
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.
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.
When you select the menu, a window appears asking you to choose the layer to operate on. Select "Point" and click OK.
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.
- 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>.img 9 : Select the base attribute for the calculation -
Operation: Select the mathematical operator. I 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.
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.
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.
Available Attributes and Variables
-
Available Attributes: Select the attribute you wish to use
and click Insert. This adds
<Feature Name>to the formula box.img 14 : Available Attributes -
Available Functions: Provides a long list of available
functions (log, sqrt, abs, if-statements, etc.).
img 15 : Available Functions -
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.
Calculation Modes: Numeric vs String
Click Calculate and check the results.
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.
That's all for today...
- Learn previous workflow in 019] How to Create Area Features from Raster Image Colors in Global Mapper
- Continue learning with 021] How to Join a CSV File to a Vector Layer in Global Mapper
Comments
Post a Comment
Feel free to leave a comment if you have any questions about Global Mapper or CityEngine. I will get back to you with a sincere response as soon as possible. (Please note that all comments are moderated and manually approved to maintain a high-quality community. Promotional or spam content will not be published.)