GXGIS class

class GXGIS(handle=0)

GXGIS class.

The GXGIS class is used for the import, export, and interrogation of GXGIS Data stored in external formats, such as MapInfo® TAB files.

classmethod create(file, info, type)

Creates a GXGIS Object

Parameters:
  • file (str) – Data source (file)
  • info (str) – Data qualifying information if required.
  • type (int) – GIS_TYPE constants
Returns:

GXGIS Object

Return type:

GXGIS

New in version 5.0.

License: Geosoft Open License

create_map_2d(map, map_scale, ipj, map2_d)

create_map_2d Create a new 2D map for GXGIS imports.

Parameters:
  • map (str) – Map name
  • map_scale (float) – Map scale (can be rDUMMY)
  • ipj (GXIPJ) – Projection (no orientation)
  • map2_d (int) – GIS_MAP2D constants

New in version 7.1.

License: Geosoft Open License

Note: This function was created to minimize duplication in creation of new maps with 2D views.

classmethod datamine_type(file)

Returns the type of a Datamine file.

Parameters:file (str) – Name of input datamine file
Returns:Datamine file types - bitwise AND of types.
Return type:int

New in version 6.3.

License: Geosoft Open License

Note: Terminates if file is not a Datamine file. A datamine file can contain fields from a multitude of types, so use GXMATH.and_ or GXMATH.or_ to determine if the file contains the required data.

get_bpr_models_lst(file, lst)

Get a GXLST of block models contained in a Gemcom BPR or BRP2 file

Parameters:
  • file (str) – BPR or BPR2 file
  • lst (GXLST) – Returned GXLST of block models

New in version 7.1.

License: Geosoft Open License

Note: The Returned GXLST 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(name)

Get the file name

Parameters:name (str_ref) – Returned file name

New in version 7.1.

License: Geosoft Open License

get_ipj()

Get the GXGIS GXIPJ

Returns:GXIPJ handle NULL if error
Return type:GXIPJ

New in version 5.0.

License: Geosoft Open License

Note: This is your copy, you must destroy it. If the GXGIS does not have an GXIPJ, an GXIPJ with no warp and UNKNOWN projection is returned.

get_meta(meta)

Get the GXGIS GXMETA

Parameters:meta (GXMETA) – Meta object to store GXGIS meta information

New in version 6.0.

License: Geosoft Open License

get_range(x_min, x_max, y_min, y_max, z_min, z_max)

Get the range of data in the GXGIS

Parameters:

New in version 5.0.

License: Geosoft Open License

classmethod is_mi_map_file(map)

Returns TRUE if file is a MapInfo MAP file.

Parameters:map (str) – Name of input map file
Returns:0 if not a MapInfo MAP file 1 if it is.
Return type:int

New in version 5.0.

License: Geosoft Open License

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).

classmethod is_mi_raster_tab_file(tab)

Returns TRUE if file is a MapInfo Raster TAB file.

Parameters:tab (str) – Name of input tab file
Returns:0 if not a MapInfo Raster TAB file 1 if it is.
Return type:int

New in version 5.0.

License: Geosoft Open License

classmethod is_mi_rotated_raster_tab_file(tab)

Returns TRUE if file is a rotated MapInfo Raster TAB file.

Parameters:tab (str) – Name of input tab file
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.

License: Geosoft Open License

Note: Returns 1 if:

  1. This is a MapInfo RASTER file
  2. A three-point warp is defined.
  3. 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()

Check if this is a null (undefined) instance

Returns:True if this is a null (undefined) instance, False otherwise.
Return type:bool
is_shp_file_3d()

Returns TRUE if an ArcView GXSHP file is type POINTZ, ARCZ, POLYGONZ or MULTIPOINTZ

Returns:0 if the GXSHP file is 2D 1 if the GXSHP file is of type POINTZ, ARCZ, POLYGONZ or MULTIPOINTZ
Return type:int

New in version 6.3.

License: Geosoft Open License

Note: GXSHP files come in 2D and 3D forms. Fails if not GIS_TYPE_ARCVIEW.

is_shp_file_point()

Returns TRUE if an ArcView GXSHP file is type POINT or POINTZ

Returns:0 if the GXSHP file is not points if the GXSHP file is of type POINT or POINTZ
Return type:int

New in version 7.1.

License: Geosoft Open License

Note: Fails if not GIS_TYPE_ARCVIEW.

load_ascii(wa)

Save GXGIS attribute table information (string fields) into a GXWA.

Parameters:wa (GXWA) – GXWA object

New in version 7.3.

License: Geosoft Open License

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

e field names are saved in the first line, followed by a blank line. e field columns are separated by a tab (delimited character).

load_gdb(db)

Load GXGIS table information into a GDB.

Parameters:db (GXDB) – Database

New in version 5.0.

License: Geosoft Open License

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

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

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

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

load_map(mview)

Load GXGIS table drawing into a GXMVIEW.

Parameters:mview (GXMVIEW) – View in which to place GXGIS drawing.

New in version 5.0.

License: Geosoft Open License

Note: The GXGIS drawing will be drawin in the current group.

load_map_ex(map, view_name)

Load GXGIS table drawing into a GXMAP.

Parameters:
  • map (GXMAP) – Map handle
  • view_name (str) – Name of existing data view

New in version 7.1.

License: Geosoft Open License

Note: The GXGIS drawing will be drawin in the current group.

load_meta_groups_map(mview, meta, ph_object, prefix, name_field)

Load GXGIS table drawing into a GXMVIEW.

Parameters:
  • mview (GXMVIEW) – View in which to place GXGIS drawing.
  • ph_object (int) – Class
  • prefix (str) – Group Name prefix
  • name_field (str) – Name field (Empty to use ID of entity)

New in version 5.1.8.

License: Geosoft Open License

Note: The GXGIS 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(ply)

Load GXGIS table drawing into a Multi-Polygon object.

Parameters:ply (GXPLY) – Polygon object in which to place GXGIS shapes.

New in version 5.1.6.

License: Geosoft Open License

load_shapes_gdb(db)

Load GXGIS shapes table information into separate lines in a GDB.

Parameters:db (GXDB) – Database

New in version 7.1.

License: Geosoft Open License

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

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

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

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

The shape ID will be used as the line numbers.

classmethod null()

A null (undefined) instance of GXGIS

Returns:A null GXGIS
Return type:GXGIS
num_attribs()

The number of attribute fields in the GXGIS dataset

Returns:The number of attribute fields
Return type:int

New in version 7.1.

License: Geosoft Open License

num_shapes()

The number of shape entities in the GXGIS dataset

Returns:The number of shape entities
Return type:int

New in version 7.1.

License: Geosoft Open License

classmethod scan_mi_raster_tab_file(tab, file, ipj)

Scan and set up a MapInf RASTER.

Parameters:
  • tab (str) – Name of input file
  • file (str_ref) – Name of Raster file (an GXIMG GXDAT)
  • ipj (GXIPJ) – Projection

New in version 5.0.

License: Geosoft Open License

Note: This will create a GI file for the raster image.

set_dm_wireframe_pt_file(file)

Specify the wireframe point file corresponding to the input file.

Parameters:file (str) – Name of the wireframe point file

New in version 6.3.

License: Geosoft Open License

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(ipj)

Save the GXIPJ back to GXGIS file

Parameters:ipj (GXIPJ) – GXIPJ to save

New in version 6.0.

License: Geosoft Open License

set_lst(lst)

Save a GXLST of items inside the GXGIS object for special use.

Parameters:lst (GXLST) – GXLST object to save to GXGIS GXLST.

New in version 7.1.

License: Geosoft Open License

Note: If the GXGIS GXLST object already exists, it is destroyed and recreated to match the size of the input GXLST, before the input GXLST is copied to it.

set_meta(meta)

Save the GXMETA back to GXGIS

Parameters:meta (GXMETA) – GXMETA object to save to GXGIS meta

New in version 6.0.

License: Geosoft Open License

set_triangulation_object_index(i_toi)

Set the triangulation object index (Micromine)

Parameters:i_toi (int) – Triangulation object index

New in version 7.1.

License: Geosoft Open License

GIS_MAP2D constants

View type to create

GIS_MAP2D_PLAN

Plan view

gxapi.GIS_MAP2D_PLAN = 0
GIS_MAP2D_EWSECTION

Section view, East-West

gxapi.GIS_MAP2D_EWSECTION = 1
GIS_MAP2D_NSSECTION

Section view, North-South

gxapi.GIS_MAP2D_NSSECTION = 2

GIS_TYPE constants

Type of file

GIS_TYPE_MAPINFO

Mapinfo Files

gxapi.GIS_TYPE_MAPINFO = 1
GIS_TYPE_ARCVIEW

ArcView files

gxapi.GIS_TYPE_ARCVIEW = 2
GIS_TYPE_DGN

Microstation DGN files

gxapi.GIS_TYPE_DGN = 3
GIS_TYPE_SURPAC

Surpac GXSTR and DTM files

gxapi.GIS_TYPE_SURPAC = 4
GIS_TYPE_DATAMINE

Datamine DM files

gxapi.GIS_TYPE_DATAMINE = 5
GIS_TYPE_GEMCOM

GEMCOM files

gxapi.GIS_TYPE_GEMCOM = 6
GIS_TYPE_MICROMINE

MICROMINE files

gxapi.GIS_TYPE_MICROMINE = 7
GIS_TYPE_MINESIGHT

MINESIGHT files

gxapi.GIS_TYPE_MINESIGHT = 8