Symbolize Areas By RGB Column Values
joebocop
Global Mapper UserTrusted User
I have imported a SHP file of polygon features. Each polygon has an R, G and B value, representing the colour that should be used to style the area background.
How can I use these values to tell GlobalMapper 18.1 (b022117) which colour to use as a background style for each feature?
Thank you.
How can I use these values to tell GlobalMapper 18.1 (b022117) which colour to use as a background style for each feature?
Thank you.
Tagged:
Best Answer
-
Hello,joebocop said:I have imported a SHP file of polygon features. Each polygon has an R, G and B value, representing the colour that should be used to style the area background.
How can I use these values to tell GlobalMapper 18.1 (b022117) which colour to use as a background style for each feature?
You can combine your R, G, and B attributes into a single attribute called FILL_COLOR, then save your data as a shapefile and reload it into Global Mapper. When the data is imported, Global Mapper will use the FILL_COLOR attribute to style the areas.
To combine the attributes, you can use Layer | Calculate/Copy Attribute Values. On the Attribute Calculation Setup screen, after you type the attribute name (FILL_COLOR), choose the option to Use Formula Calculation, choose String for the Calculation Mode, and type the following information in the Enter Formula field:"RGB(" + R + "," + G + "," + B + ")"
This assumes that your color attributes are called R, G, and B. If they have different names, use those instead.
After you modify the data, you will need to export the file, then import it again, because Global Mapper applies the style from attribute values when it imports the data.
Cheers,
Bob
Answers
-
Ok, failing that, I see that in a gm_layer_style file the format is as...GM LAYER STYLE FILELayerStyle=2Type=0AttrName=G_ROCKTYPEInterpolateNumeric=1AttrVal=brecciaAttrAreaStyle=65,0,1,2097152,0.0AttrFont=~0~534799372~0.000~0~0~16777215AttrVal=carbonateAttrAreaStyle=2147483713,0,1,2097152,0.0AttrFont=~0~534799372~0.000~0~0~16777215
In this example, for the AttrAreaStyle variable, what do the comma-separated values signify? Presumably I could write a script that will output this file, if I can figure out how to convert Red, Green, and Blue values into that comma-separated string.
Thank you!
Howdy, Stranger!
Categories
- 12.2K All Categories
- 5.3K Features Discussion
- 312 Downloading Imagery
- 1.2K Elevation Data
- 371 Georeferencing Imagery Discussion
- 580 GM Script Language
- 42 User Scripts
- 111 GPS Features
- 388 Projection Questions
- 788 Raster Data
- 1.3K Vector Data
- 6.4K Support
- 159 Announcement and News
- 881 Bug Report
- 554 SDK
- 1.1K Suggestion Box
- 3.6K Technical Support
- 520 Other Discussion
- 125 GIS Data Sources
- 26 Global Mapper Showcase
- 217 How I use Global Mapper
- 99 Global Mapper Forum Website