GXGIS class¶
- class GXGIS(handle=0)[source]¶
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)[source]¶
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:
New in version 5.0.
License: Geosoft Open License
- create_map_2d(map, map_scale, ipj, map2_d)[source]¶
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)[source]¶
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)[source]¶
Get a
GXLST
of block models contained in a Gemcom BPR or BRP2 fileNew 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)[source]¶
Get the file name
- Parameters:
name (str_ref) – Returned file name
New in version 7.1.
License: Geosoft Open License
- get_ipj()[source]¶
-
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)[source]¶
-
New in version 6.0.
License: Geosoft Open License
- get_range(x_min, x_max, y_min, y_max, z_min, z_max)[source]¶
Get the range of data in the
GXGIS
- Parameters:
New in version 5.0.
License: Geosoft Open License
- classmethod is_mi_map_file(map)[source]¶
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)[source]¶
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)[source]¶
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()[source]¶
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()[source]¶
Returns TRUE if an ArcView
GXSHP
file is type POINTZ, ARCZ, POLYGONZ or MULTIPOINTZ- Returns:
0 if the
GXSHP
file is 2D 1 if theGXSHP
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 notGIS_TYPE_ARCVIEW
.
- is_shp_file_point()[source]¶
Returns TRUE if an ArcView
GXSHP
file is type POINT or POINTZ- Returns:
0 if the
GXSHP
file is not points if theGXSHP
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)[source]¶
Save
GXGIS
attribute table information (string fields) into aGXWA
.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)[source]¶
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)[source]¶
Load
GXGIS
table drawing into aGXMVIEW
.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)[source]¶
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)[source]¶
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)[source]¶
Load
GXGIS
table drawing into a Multi-Polygon object.New in version 5.1.6.
License: Geosoft Open License
- load_shapes_gdb(db)[source]¶
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()[source]¶
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()[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
Save the
GXIPJ
back toGXGIS
fileNew in version 6.0.
License: Geosoft Open License
- set_lst(lst)[source]¶
Save a
GXLST
of items inside theGXGIS
object for special use.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)[source]¶
-
New in version 6.0.
License: Geosoft Open License
- set_triangulation_object_index(i_toi)[source]¶
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_TYPE constants¶
Type of file