GXARCMAP class¶
- class GXARCMAP(handle=0)[source]¶
GXARCMAP class.
This library is not a class. It contains various utilities used in maps and layers by the Geosoft extensions for ArcGIS.
- classmethod change_size(x, y)[source]¶
Changes the custom page size of the ArcGIS Map document.
- Parameters:
x (float) – X Size (mm)
y (float) – Y Size (mm)
New in version 8.0.
License: Geosoft Open License
- classmethod display_in_3d_view(file)[source]¶
Display a file in 3D view
- Parameters:
file (str) – File Name
New in version 8.0.
License: Geosoft Open License
- classmethod export_feature_layer_by_name_to_3d_file(mxd_file, dataframe_name, layer_name, output_file)[source]¶
Exports the shapes from a feature layer of the ArcMap document to a 3D File.
- Parameters:
mxd_file (str) –
GXMXD
filenamedataframe_name (str) – Dataframe name
layer_name (str) – Layer name
output_file (str) – Output file name
New in version 8.0.
License: Geosoft Extended End-User License
- classmethod export_selected_feature_layer_to_3d_file(output_file)[source]¶
Exports the shapes from the currently selected feature layer (if any) in ArcMap to a 3D file (only on oriented frames i.e. sections).
- Parameters:
output_file (str) – Output file name
New in version 8.0.
License: Geosoft Extended End-User License
- classmethod get_current_document_info(mxd, layer, map)[source]¶
Get some info on the current
GXMXD
in ArcMap and selected layer (if any)- Parameters:
New in version 8.0.
License: Geosoft Open License
- classmethod get_ipj_for_predefined_esri_gcs(ipj, esri_gcs_code)[source]¶
Fills an
GXIPJ
with a predefined ESRI GCSNew in version 8.0.1.
License: Geosoft Extended End-User License
- classmethod get_ipj_for_predefined_esri_pcs(ipj, esri_pcs_code)[source]¶
Fills an
GXIPJ
with a predefined ESRI PCSNew in version 8.0.1.
License: Geosoft Extended End-User License
- classmethod get_number_of_selected_layers()[source]¶
Get the number of selected layers in the TOC
Returns The number of layers selected.
- Return type:
int
New in version 8.0.
License: Geosoft Open License
- classmethod get_selected_layer_info(layer_number, layer, map)[source]¶
Get the name info on the specified selected layer
- Parameters:
New in version 8.0.
License: Geosoft Open License
- 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
- classmethod load_lyr(file)[source]¶
Load a LYR file to the current data frame
- Parameters:
file (str) – File Name
New in version 8.0.
License: Geosoft Open License
- classmethod load_map(map, view, extra_csv, layer_tag, fit, activate, prefix)[source]¶
Loads a Geosoft map into the current ArcMap document
- Parameters:
map (str) – Map File Name
view (str) – View Name
extra_csv (str) – Optional Extra Datasets CSV Filename (Rasters and shape files to display with layers)
layer_tag (str) – Optional frame/layer tag (suffix)
fit (int) – Fit to map size
activate (bool) – Activate view (3D)
prefix (bool) – Layer name tag is prefix
New in version 8.0.
License: Geosoft Open License
Note: The extra datasets CSV should contain the the following fields:
ID - Unique identifier DATASOURCE - Filename TYPE - RASTER and SHAPE supported MAPMATCH - Map to associate with (used for grouping logic) VIEWMATCH - View to match with in associated map (used for grouping logic) ZONEFILE - Used for type RASTER
- classmethod load_map_ex(map, view, extra_csv, layer_tag, flags)[source]¶
Loads a Geosoft map into the ArcMap document, specifying which View to use as Data view.
- Parameters:
map (str) – Map File Name
view (str) – View Name
extra_csv (str) – Optional Extra Datasets CSV Filename (Rasters and shape files to display with layers)
layer_tag (str) – Optional frame/layer tag (suffix)
flags (int) – Combination of ARCMAP_LOAD_FLAGS constants
- Returns:
0 - OK 1 - Error -1 - Canceled
- Return type:
int
New in version 8.0.
License: Geosoft Open License
Note: The extra datasets CSV should contain the the following fields:
ID - Unique identifier DATASOURCE - Filename TYPE - RASTER and SHAPE supported MAPMATCH - Map to associate with (used for grouping logic) VIEWMATCH - View to match with in associated map (used for grouping logic) ZONEFILE - Used for type RASTER
- classmethod load_map_view(map, view, layer, all)[source]¶
Load a Geosoft Map as a layer into the current data frame
- Parameters:
map (str) – Map File Name
view (str) – View Name
layer (str) – Layer Name
all (int) – Pass TRUE to also render other views in map (Use second parameter view for location)
New in version 8.0.
License: Geosoft Open License
- classmethod load_raster(file)[source]¶
Load a raster file to the current data frame
- Parameters:
file (str) – File Name
New in version 8.0.
License: Geosoft Open License
Note: Loads any file type recognized as “raster” formats by ARC
GXGIS
. This includes geosoft GRD files.
- classmethod load_raster_ex(file)[source]¶
Load a raster file to the current data frame and create associated files
- Parameters:
file (str) – File Name
New in version 9.4.
License: Geosoft Open License
Note: Loads any file type recognized as “raster” formats by ARC
GXGIS
. This includes geosoft GRD files.
- classmethod load_shape(file, layer_prefix, layer_suffix)[source]¶
Load a
GXSHP
file to the current data frame- Parameters:
file (str) – File Name
layer_prefix (str) – Layer Name Prefix: An underscore is added automatically
layer_suffix (str) – Layer Name Suffix An underscore is added automatically
New in version 8.0.
License: Geosoft Open License
Note: The input layer name is created using the (optional) prefix and suffix as follows:
Prefix_NAME_Suffix
- classmethod load_spf(shp, num_shp)[source]¶
Load all the shape files generated by importing a SPF into ArcMap.
- Parameters:
shp (str) – List of shape files to load
num_shp (int) – Number of shape files
- Returns:
0- OK, 1 - Error, -1 - Cancel
- Return type:
int
New in version 8.0.
License: Geosoft Open License
- classmethod map_view_to_shape(map, view, shp, lst)[source]¶
Create
GXSHP
file(s) from a Geosoft Map view.- Parameters:
New in version 8.0.
License: Geosoft Open License
Note: The output
GXSHP
file name(s) are made up as follows (where NAME is the inputGXSHP
file name):NAME_pt.shp (point objects) NAME_ln.shp (line or arc objects) NAME_pg.shp (polygon objects)
- classmethod query_size(x, y)[source]¶
Query the page size in mm of the entire map page.
New in version 8.0.
License: Geosoft Open License
- classmethod show_layer_by_name_in_3d(mxd_file, dataframe_name, layer_name)[source]¶
Shows a layer in ArcMap in a 3D view in an
GXMXD
- Parameters:
mxd_file (str) –
GXMXD
filenamedataframe_name (str) – Dataframe name
layer_name (str) – Layer name
New in version 8.0.
License: Geosoft Extended End-User License
- classmethod show_selected_layers_in_3d()[source]¶
Shows the selected layers in ArcMap in a 3D view
New in version 8.0.
License: Geosoft Extended End-User License
ARCMAP_LOAD_FLAGS constants¶
Flags that can be combined and passed to iLoadMap_ARCMAP
- ARCMAP_LOAD_EXISTFRAME¶
If an existing frame is found add new layers to it
- gxapi.ARCMAP_LOAD_EXISTFRAME = 4¶
- ARCMAP_LOAD_HIDESIBLINGS¶
Hide all other existing layers in frame
- gxapi.ARCMAP_LOAD_HIDESIBLINGS = 16¶
- ARCMAP_LOAD_PREFIXMAPFRAME¶
Prefix the map filename part as part of the frame name
- gxapi.ARCMAP_LOAD_PREFIXMAPFRAME = 32¶
- ARCMAP_LOAD_PREFIXMAPLAYER¶
Prefix the map filename part as part of the layer name
- gxapi.ARCMAP_LOAD_PREFIXMAPLAYER = 64¶
- ARCMAP_LOAD_MERGETOSINGLEVIEW¶
Will render all views in single layer with the data view defining the coordinate system
- gxapi.ARCMAP_LOAD_MERGETOSINGLEVIEW = 128¶
- ARCMAP_LOAD_INTOCURRENTFRAME¶
Load everything into the current data frame
- gxapi.ARCMAP_LOAD_INTOCURRENTFRAME = 256¶
- ARCMAP_LOAD_NOMAPLAYERS¶
Use the map only for sizing data frames in layout, only load extra datasets.
- gxapi.ARCMAP_LOAD_NOMAPLAYERS = 512¶
- ARCMAP_LOAD_ACTIVATE¶
Activates the main quickmap layer when done (e.g. 3D Viewer)
- gxapi.ARCMAP_LOAD_ACTIVATE = 1024¶