Geosoft mapping software for geophysics, geology, geochemistry
 

How to: Assign numeric values based on a string channel

|

Problem:

Situations can arise where a user wants to display information from a String channel in a map/plot, but the GX only supports numeric channels (i.e. Symbol plots). The user must create a new channel that contains a number value corresponding to each unique string within the string channel.

Environment:

All versions of Oasis montaj, Target, Target for ArcGIS

Steps:

If a user has strings within a channel, they will need to assign numbers to these using a math expressoin file (*.exp) and Channel Math. In this example, we have a string channel called "Element" with strings that will be assigned with the following:

Gold - 1
Silver - 2
Bronze - 3

These will be placed into a new channel called "Numeric" and requires the use of a text/asci file called convert.exp.

convert.exp

Numeric=(Element=="Gold")?1:Numeric;
Numeric=(Element=="Silver")?2:Numeric;
Numeric=(Element=="Bronze")?3:Numeric;

This expression file uses 3 True/False statements. For more information on True/False statement syntax, refer to the help.

  1. Create new channel in your GDB called Numeric that has data type Double
  2. Go to Database Tools > Channel Math
  3. Use the browse button to locate convert.exp and then press the Load Button
  4. Press OK

This should populate your "Numeric" channel with the appropriate values.