GXAGG class

class geosoft.gxapi.GXAGG
The AGG class is used to handle image display on maps.
An aggragate contains one or more image layers (LAY) with
each layer representing a grid or image file. The AGG
will combine all the layers to form one image
change_brightness((float)arg1) → None:
Change the brightness.
Parameters:arg1 (float) – -1.0 - black; 0.0 no change; 1.0 white
Return type:None

New in version 5.0.0.

Note:

0.0 brightness does nothing.
-1.0 to 0.0 makes colours darker, -1.0 is black
0.0 to 1.0 makes colours lighter, 1.0 is white
static create() → GXAGG:
Create an aggregate
Returns:AGG Object
Return type:geosoft.gxapi.GXAGG

New in version 5.0.0.

static create_map((GXMAP)arg1, (str)arg2) → GXAGG:
Create AGG from Map with Group name.
Parameters:
Returns:

AGG Object

Return type:

geosoft.gxapi.GXAGG

New in version 5.0.5.

Note:

The Agg Group name must include the View name with a
backslash separating the view name and group name; e.g.
"Data\AGG_test" (when used as a string, the double slash
represents as single ).
get_brightness() → float:
Get the brightness setting of the AGG
Return type:float

New in version 5.0.0.

Note:

Brightness can range from -1.0 (black) to 1.0 (white).
This brightness control is relative to the normal colour
when the AGG is created.

AGG brightness depends on the brightness of the ITR of each layer.
Calling dGetBright_AGG will poll all layers, and if all have the same
brightness, this is returned.  If any of the layers have a different
brightness, the current brightness of each layer is changed to be
the reference brightness (0.0)and the brightness value of 0.0 is
returned.
get_layer_itr((int)arg1, (GXITR)arg2) → None:
Get the ITR of a layer
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Layers are numbered from 0, consecutively in the order they are
placed in the aggregate.

An error will occur if the layer does not exist.

Caller must create/destroy ITR.
is_null() → bool

Check if the instance of geosoft.gxapi.GXAGG is null (undefined)

Returns:True if this is a null instance of geosoft.gxapi.GXAGG, False otherwise.
Return type:bool`
layer_img((str)arg1, (int)arg2, (str)arg3, (float)arg4) → None:
Add an image as a layer in an aggregate.
Parameters:
  • arg1 (str) – grid name
  • arg2 (int) – AGG_LAYER_ZONE constants transform to use if colour table has none defined.
  • arg3 (str) – colour table name, “” for default This can be a .TBL .ZON .ITR or .AGG file .TBL is the default
  • arg4 (float) – colour contour interval or rDUMMY for default
Returns:

Nothing

Return type:

None

New in version 5.0.0.

layer_img_ex((str)arg1, (int)arg2, (str)arg3, (float)arg4, (float)arg5, (float)arg6) → None:
Add an image as a layer in an aggregate.
Parameters:
  • arg1 (str) – grid name
  • arg2 (int) – AGG_LAYER_ZONE constants transform to use if colour table has none defined.
  • arg3 (str) – colour table name, “” for default This can be a .TBL .ZON .ITR or .AGG file .TBL is the default
  • arg4 (float) – minimum value or rDUMMY for default
  • arg5 (float) – maximum value or rDUMMY for default
  • arg6 (float) – colour contour interval or rDUMMY for default
Returns:

Nothing

Return type:

None

New in version 8.2.

layer_shade_img((str)arg1, (str)arg2, (float)arg3, (float)arg4, (float_ref)arg5) → None:
Add a shaded image as a layer in an aggregate.
Parameters:
  • arg1 (str) – grid name
  • arg2 (str) – colour table name, “” for default
  • arg3 (float) – inclination
  • arg4 (float) – declination
  • arg5 (geosoft.gxapi.float_ref) – scale (rDUMMY for default, returns value used)
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

A new grid file will be created to hold the shaded
image data.  This file will have the same name as the
original grid but with "_s" added to the root name.
It will always be located in the workspace directory
regardless of the location of the original source image.
If the file already exists, it will replaced.
list_img((GXVV)arg1) → int:
Lists file names of all the IMGs inside of the AGG.
Parameters:arg1 (geosoft.gxapi.GXVV) – VV of type -STR_FILE
Returns:The number of Imgs.
Return type:int

New in version 5.0.6.

Note:

The returned VV contains the file names.
static null() → GXAGG

A null (undefined) instance of geosoft.gxapi.GXAGG

Returns:A null geosoft.gxapi.GXAGG
Return type:geosoft.gxapi.GXAGG
num_layers() → int:
Get the number of layers in an aggregate.
Returns:The number of layers in an aggregate.
Return type:int

New in version 5.0.0.

set_layer_itr((int)arg1, (GXITR)arg2) → None:
Set the ITR of a layer
Parameters:
Return type:

None

New in version 5.0.0.

Note:

Layers are numbered from 0, consecutively in the order they are
placed in the aggregate.

An error will occur if the layer does not exist.

Caller must create/destroy ITR.
set_model((int)arg1) → None:
Sets the Color Model
Parameters:arg1 (int) – AGG_MODEL constants
Returns:Nothing
Return type:None

New in version 5.0.0.

set_render_method((int)arg1) → None:
Sets the Rendering Method
Parameters:arg1 (int) – AGG_RENDER constants
Returns:Nothing
Return type:None

New in version 5.1.1.

AGG_LAYER_ZONE constants

Aggregate Layer Zone defines
gxapi.AGG_LAYER_ZONE_DEFAULT = 0
If a colour table with no colour transform is passed
it will be used with the default zoning
method of the data, which is usually
AGG_LAYER_ZONE_EQUALAREA.
gxapi.AGG_LAYER_ZONE_LINEAR = 1
Linear Distribution
gxapi.AGG_LAYER_ZONE_NORMAL = 2
Normal Distribution
gxapi.AGG_LAYER_ZONE_EQUALAREA = 3
Equal Area Distribution
gxapi.AGG_LAYER_ZONE_SHADE = 4
If AGG_LAYER_ZONE_SHADE is specified, a shaded relief
layer is created from the specified grid.  A new grid
file will also be created to hold the shaded relief
image data.  This file will have the same name as the
original grid but with "_s" added to the root name.
It will always be located in the workspace directory
regardless of the location of the original source image.
If the file already exists, it will used as it is.
Shading is always at inclination = declination = 45 deg.
with default scaling.  If different shading is desired,
use the \ :func:`geosoft.gxapi.GXAGG.layer_shade_img`\  method.
gxapi.AGG_LAYER_ZONE_LOGLINEAR = 5
Log Linear Distribution
gxapi.AGG_LAYER_ZONE_LAST = 6
The last ITR used to display this
data will be used if it exists.  If it
does not exist, the behaviour is the same
as AGG_LAYER_ZONE_DEFAULT.

AGG_MODEL constants

Aggregation color model defines
gxapi.AGG_MODEL_HSV = 1
Hue Saturation Value
gxapi.AGG_MODEL_RGB = 2
Red Green Blue
gxapi.AGG_MODEL_CMY = 3
Cyan Magenta Yellow

AGG_RENDER constants

Aggregation rendering modes
gxapi.AGG_RENDER_ADD = 0
Add all the colors together
gxapi.AGG_RENDER_BLEND = 1
Adds and divides by the number of non-dummy colors
gxapi.AGG_RENDER_BLEND_ALL = 2
Adds and divides by the number of colors
gxapi.AGG_RENDER_FADE = 3
Multiplies current colors by the input's colors over 255 (input works as the percentage of color to preserve)