[020] Global Mapper - Point Layer: Calculate/Copy Attribute Value(s)...
Today's menu is about the Point Layer.
"Before we begin, if you missed the previous session, check it out here:"
[019] Global Mapper - Raster 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:
|
|
| 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 |
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 |
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 |
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 |
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 |
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 |
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 |
- 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
-
Operation: Select the mathematical operator. I
chose Multiply.
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" |
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 |
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.
|
|
| "Attribute Calculation Setup" window configured for Formula Calculation with the formula " * 5 + 1" |
-
Available Attributes: Select the attribute you wish to
use and click Insert. This adds
<Feature Name>to the formula box.
Available Attributes
-
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.
|
|
| 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 |
That's all for today...
"In the next session, we'll dive deeper into more advanced features. Stay tuned!"
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.)