[020] Global Mapper - Point Layer: Calculate/Copy Attribute Value(s)...
Today's menu is about the Point Layer.
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.
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.
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>. - Operation: Select the mathematical operator. I 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.
2. Use Formula 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: Select the attribute you wish to use and click Insert. This adds
<Feature Name>to the formula box. - Available Functions: Provides a long list of available functions (log, sqrt, abs, if-statements, etc.).
- 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.
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...
Comments
Post a Comment