GXGIS class

class geosoft.gx.GXGIS
The GIS class is used for the import, export,
and interrogation of GIS Data stored in external formats,
such as MapInfo® TAB files.
static create((GXContext)ctx, (str)arg1, (str)arg2, (int)arg3) → GXGIS:
Creates a GIS Object
Parameters:
Returns:

GIS Object

Return type:

geosoft.gx.GXGIS

New in version 5.0.0.

create_map2_d((str)arg1, (float)arg2, (GXIPJ)arg3, (int)arg4) → None:
geosoft.gx.GXGIS.create_map2_d()   Create a new 2D map for GIS imports.
Parameters:
Returns:

Nothing

Return type:

None

New in version 7.1.0.

Note:

This function was created to minimize duplication in
creation of new maps with 2D views.
static datamine_type((GXContext)ctx, (str)arg1) → int:
Returns the type of a Datamine file.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Name of input datamine file
Returns:

Datamine file types - bitwise AND of types.

Return type:

int

New in version 6.3.0.

Note:

Terminates if file is not a Datamine file.
A datamine file can contain fields from a multitude
of types, so use geosoft.gx.GXMATH.and_() or geosoft.gx.GXMATH.or_() to determine if
the file contains the required data.
get_bpr_models_lst((str)arg1, (GXLST)arg2) → None:
Get a LST of block models contained in a Gemcom BPR or BRP2 file
Parameters:
  • arg1 (str) – BPR or BPR2 file
  • arg2 (geosoft.gx.GXLST) – Returned LST of block models
Returns:

Nothing

Return type:

None

New in version 7.1.0.

Note:

The Returned LST has items in the following format:

Name:  If there is only one sub-directory with models, then only
       the block model name "Rock Type_5" is required to ensure uniqueness.
       If there is more than one sub-directory, then the name is set
       to (.e.g.) "[Standard]Rock Type_5"
Value: Sub-directory file path  "StandardRock Type_5.BLK", (includes the extension).

The Gemcom BPR and BPR2 files keep their block models in one
or more sub-directories, identified in the *.CAT file located
beside the input BPR or BPR2.
get_file_name((str_ref)arg1) → None:
Get the file name
Parameters:arg1 (geosoft.gx.str_ref) – returned file name
Returns:Nothing
Return type:None

New in version 7.1.0.

get_ipj() → GXIPJ:
Get the GIS IPJ
Returns:IPJ handle NULL if error
Return type:geosoft.gx.GXIPJ

New in version 5.0.0.

Note:

This is your copy, you must destroy it.
If the GIS does not have an IPJ, an IPJ with
no warp and UNKNOWN projection is returned.
get_meta((GXMETA)arg1) → None:
Get the GIS META
Parameters:arg1 (geosoft.gx.GXMETA) – Meta object to store GIS meta information
Returns:Nothing
Return type:None

New in version 6.0.0.

get_range((float_ref)arg1, (float_ref)arg2, (float_ref)arg3, (float_ref)arg4, (float_ref)arg5, (float_ref)arg6) → None:
Get the range of data in the GIS
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static is_mi_map_file((GXContext)ctx, (str)arg1) → int:
Returns TRUE if file is a MapInfo MAP file.
Parameters:
Returns:

0 if not a MapInfo MAP file 1 if it is.

Return type:

int

New in version 5.0.0.

Note:

It is important not to overwrite a MapInfo MAP file
with a GEOSOFT one. Use this function to test the MAP
file (looks at the first few bytes).
static is_mi_raster_tab_file((GXContext)ctx, (str)arg1) → int:
Returns TRUE if file is a MapInfo Raster TAB file.
Parameters:
Returns:

0 if not a MapInfo Raster TAB file 1 if it is.

Return type:

int

New in version 5.0.0.

static is_mi_rotated_raster_tab_file((GXContext)ctx, (str)arg1) → int:
Returns TRUE if file is a rotated MapInfo Raster TAB file.
Parameters:
Returns:

0 if not a rotated MapInfo Raster TAB file 1 if it is (see conditions below).

Return type:

int

New in version 6.4.0.

Note:

Returns 1 if:

a) This is a MapInfo RASTER file
b) A three-point warp is defined.
c) The warp requires a rotation in order to exactly map
   the input and output warp points. The rotation must
   be at least 1.e-6 radians.

This function will register an error (and return 0)
if problems are encountered opening or reading the TAB file.
is_null() → bool

Check if the instance of geosoft.gx.GXGIS is null (undefined)

Returns:True if this is a null instance of geosoft.gx.GXGIS, False otherwise.
Return type:bool`
is_shp_file_3d() → int:
Returns TRUE if an ArcView SHP file is type POINTZ, ARCZ, POLYGONZ or MULTIPOINTZ
Returns:0 if the SHP file is 2D 1 if the SHP file is of type POINTZ, ARCZ, POLYGONZ or MULTIPOINTZ
Return type:int

New in version 6.3.0.

Note:

SHP files come in 2D and 3D forms.
Fails if not GIS_TYPE_ARCVIEW.
is_shp_file_point() → int:
Returns TRUE if an ArcView SHP file is type POINT or POINTZ
Returns:0 if the SHP file is not points if the SHP file is of type POINT or POINTZ
Return type:int

New in version 7.1.0.

Note:

Fails if not GIS_TYPE_ARCVIEW.
load_ascii((GXWA)arg1) → None:
Save GIS attribute table information (string fields) into a WA.
Parameters:arg1 (geosoft.gx.GXWA) – WA object
Returns:Nothing
Return type:None

New in version 7.3.0.

Note:

All string fields (excluding X/Y and numerical fields) will be saved into the WA columns.

e field names are saved in the first line, followed by a blank line.
e field columns are seperated by a tab (delimited character).
load_gdb((GXDB)arg1) → None:
Load GIS table information into a GDB.
Parameters:arg1 (geosoft.gx.GXDB) – database
Returns:Nothing
Return type:None

New in version 5.0.0.

Note:

All fields of the database will be loaded into the group.

Channels will use the same name (or a allowable alias) as
the GIS field name.

If a channel does not exist, it will be created based on the
characteristics of the GIS field.

If a channel exists, it will be used as-is.
load_map((GXMVIEW)arg1) → None:
Load GIS table drawing into a MAP.
Parameters:arg1 (geosoft.gx.GXMVIEW) – view in which to place GIS drawing.
Returns:Nothing
Return type:None

New in version 5.0.0.

Note:

The GIS drawing will be drawin in the current group.
load_map_ex((GXMAP)arg1, (str)arg2) → None:
Load GIS table drawing into a MAP.
Parameters:
  • arg1 (geosoft.gx.GXMAP) – Map handle
  • arg2 (str) – Name of existing data view
Returns:

Nothing

Return type:

None

New in version 7.1.0.

Note:

The GIS drawing will be drawin in the current group.
load_meta_groups_map((GXMVIEW)arg1, (GXMETA)arg2, (int)arg3, (str)arg4, (str)arg5) → None:
Load GIS table drawing into a MAP.
Parameters:
  • arg1 (geosoft.gx.GXMVIEW) – view in which to place GIS drawing.
  • arg2 (geosoft.gx.GXMETA) – META
  • arg3 (int) – Class
  • arg4 (str) – Group Name prefix
  • arg5 (str) – Name field (Empty to use ID of entity)
Returns:

Nothing

Return type:

None

New in version 5.1.8.

Note:

The GIS drawing will be drawn in the current group.
A group will be created for every entity and data items
containing an entity's field will be added to the Meta
information of every group into the class specified.
Note that the map may grow very large for big datasets.
load_ply((GXPLY)arg1) → None:
Load GIS table drawing into a Multi-Polygon object.
Parameters:arg1 (geosoft.gx.GXPLY) – Polygon object in which to place GIS shapes.
Returns:Nothing
Return type:None

New in version 5.1.6.

load_shapes_gdb((GXDB)arg1) → None:
Load GIS shapes table information into separate lines in a GDB.
Parameters:arg1 (geosoft.gx.GXDB) – database
Returns:Nothing
Return type:None

New in version 7.1.0.

Note:

All fields of the database will be loaded into the group.

Channels will use the same name (or a allowable alias) as
the GIS field name.

If a channel does not exist, it will be created based on the
characteristics of the GIS field.

If a channel exists, it will be used as-is.

The shape ID will be used as the line numbers.
static null() → GXGIS

A null (undefined) instance of geosoft.gx.GXGIS

Returns:A null geosoft.gx.GXGIS
Return type:geosoft.gx.GXGIS
num_attribs() → int:
The number of attribute fields in the GIS dataset
Returns:The number of attribute fields
Return type:int

New in version 7.1.0.

num_shapes() → int:
The number of shape entities in the GIS dataset
Returns:The number of shape entities
Return type:int

New in version 7.1.0.

static scan_mi_raster_tab_file((GXContext)ctx, (str)arg1, (str_ref)arg2, (GXIPJ)arg3) → None:
Scan and set up a MapInf RASTER.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

This will create a GI file for the raster image.
set_dm_wireframe_pt_file((str)arg1) → None:
Specify the wireframe point file corresponding to the input file.
Parameters:arg1 (str) – Name of the wireframe point file
Returns:Nothing
Return type:None

New in version 6.3.0.

Note:

Datamine wireframe models are specified by pairs of files,
the first is the triangle node file, and the second gives
the XYZ locations of the node points. This
function allows you to specify the latter when reading the
first, so that the full model can be decoded.
set_ipj((GXIPJ)arg1) → None:
Save the IPJ back to GIS file
Parameters:arg1 (geosoft.gx.GXIPJ) – IPJ to save
Returns:Nothing
Return type:None

New in version 6.0.0.

set_lst((GXLST)arg1) → None:
Save a LST of items inside the GIS object for special use.
Parameters:arg1 (geosoft.gx.GXLST) – LST object to save to GIS LST.
Returns:Nothing
Return type:None

New in version 7.1.0.

Note:

If the GIS LST object already exists, it is destroyed and
      recreated to match the size of the input LST, before the
input LST is copied to it.
set_meta((GXMETA)arg1) → None:
Save the META back to GIS
Parameters:arg1 (geosoft.gx.GXMETA) – META object to save to GIS meta
Returns:Nothing
Return type:None

New in version 6.0.0.

set_triangulation_object_index((int)arg1) → None:
Set the triangulation object index (Micromine)
Parameters:arg1 (int) – Triangulation object index
Returns:Nothing
Return type:None

New in version 7.1.0.

GIS_MAP2D constants

View type to create
gx.GIS_MAP2D_PLAN = 0
Plan view
gx.GIS_MAP2D_EWSECTION = 1
Section view, East-West
gx.GIS_MAP2D_NSSECTION = 2
Section view, North-South

GIS_TYPE constants

Type of file
gx.GIS_TYPE_MAPINFO = 1
Mapinfo Files
gx.GIS_TYPE_ARCVIEW = 2
ArcView files
gx.GIS_TYPE_DGN = 3
Microstation DGN files
gx.GIS_TYPE_SURPAC = 4
Surpac STR and DTM files
gx.GIS_TYPE_DATAMINE = 5
Datamine DM files
gx.GIS_TYPE_GEMCOM = 6
GEMCOM files
gx.GIS_TYPE_MICROMINE = 7
MICROMINE files
gx.GIS_TYPE_MINESIGHT = 8
MINESIGHT files