GXGIS class¶
-
class
GXGIS
(handle=0)¶ GXGIS class.
The
GXGIS
class is used for the import, export, and interrogation ofGXGIS
Data stored in external formats, such as MapInfo® TAB files.-
classmethod
create
(file, info, type)¶ Creates a
GXGIS
ObjectParameters: - file (str) – Data source (file)
- info (str) – Data qualifying information if required.
- type (int) – GIS_TYPE constants
Returns: GXGIS
ObjectReturn type: 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 forGXGIS
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_
orGXMATH.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 fileParameters: 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
()¶ -
Returns: GXIPJ
handle NULL if errorReturn 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 anGXIPJ
, anGXIPJ
with no warp and UNKNOWN projection is returned.
-
get_meta
(meta)¶ -
Parameters: meta (GXMETA) – Meta object to store GXGIS
meta informationNew 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:
- This is a MapInfo RASTER file
- A three-point warp is defined.
- 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 MULTIPOINTZReturns: 0 if the GXSHP
file is 2D 1 if theGXSHP
file is of type POINTZ, ARCZ, POLYGONZ or MULTIPOINTZReturn type: int New in version 6.3.
License: Geosoft Open License
Note:
GXSHP
files come in 2D and 3D forms. Fails if notGIS_TYPE_ARCVIEW
.
-
is_shp_file_point
()¶ Returns TRUE if an ArcView
GXSHP
file is type POINT or POINTZReturns: 0 if the GXSHP
file is not points if theGXSHP
file is of type POINT or POINTZReturn 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 aGXWA
.Parameters: wa (GXWA) – GXWA
objectNew 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 aGXMVIEW
.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 aGXMAP
.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 aGXMVIEW
.Parameters: 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.
-
num_attribs
()¶ The number of attribute fields in the
GXGIS
datasetReturns: 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
datasetReturns: 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: 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 toGXGIS
fileParameters: ipj (GXIPJ) – GXIPJ
to saveNew in version 6.0.
License: Geosoft Open License
-
set_lst
(lst)¶ Save a
GXLST
of items inside theGXGIS
object for special use.Parameters: lst (GXLST) – GXLST
object to save toGXGIS
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 inputGXLST
, before the inputGXLST
is copied to it.
-
set_meta
(meta)¶ -
Parameters: meta (GXMETA) – GXMETA
object to save toGXGIS
metaNew 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
-
classmethod
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_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
-