geosoft.gxpy.spatialdata submodule

Geosoft spatial data base class.

Spatial datasets are collections of geometric objects that have associated data, typically persisting in a named file. Examples are Geosoft databases, grids, voxels, geosoft_surfaces.

Classes

SpatialData

base class for Geosoft spatial data, inherits from geosoft.gxpy.geometry.Geometry

Constants

mode= file open mode constants

FILE_READ

0

open for read, files are not changed

FILE_READWRITE

1

open for read and write, files can be changed

FILE_NEW

2

new file, accompanied by overwrite= parameter

class SpatialData(name=None, file_name=None, mode=2, overwrite=False, **kwargs)[source]

Bases: geosoft.gxpy.geometry.Geometry

Base class for spatial datasets.

Parameters
  • name – dataset name.

  • file_name – file name for this dataset.

  • mode – file mode, MODE_READ, MODE_READWRITE or MODE_NEW. The default is MODE_NEW.

  • overwrite – Default is False. If True will raise an error if MODE_NEW and file_name exists.

  • gxobj – Base GXAPI spatial dataset object, default is None. If passed the base object is used to resolve common named methods like `get_ipj()`.

Properties

properties of geosoft.gxpy.geometry.Geometry plus:

file_name

file name

metadata

metadata dictionary

unit_of_measure

primary data unit of measurement

New in version 9.3.1.

__init__(name=None, file_name=None, mode=2, overwrite=False, **kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

close()[source]

close the dataset.

property dataset_mode

Dataset open mode

property file_name

dataset primary file name

property metadata

Return the dataset metadata as a dictionary. Can be set, in which case the dictionary items passed will be added to, or replace existing metadata.

See also

Geosoft metadata Schema

New in version 9.3.1.

property unit_of_measure

Units of measurement (a string) for the primary scalar data associated with this dataset.

Can be set.

New in version 9.3.1.

exception SpatialException(message)[source]

Bases: geosoft.GXRuntimeError

Exceptions from geosoft.gxpy.spatial_data.

coordinate_system_from_metadata(meta)[source]

Return a geosoft.gxpy.coordinate_system.Coordinate_system instance from metadata.

Parameters

meta – metadata dictionary

Returns

geosoft.gxpy.coordinate_system.Coordinate_system, or None

coordinate_system_from_metadata_file(file_name)[source]

Return a geosoft.gxpy.coordinate_system.Coordinate_system instance from metadata.

Parameters

file_name – spatial dataset name.

Returns

geosoft.gxpy.coordinate_system.Coordinate_system, or None

delete_files(file_name)[source]

Delete file and xml file

Parameters

file_name – base file name

New in version 9.3.1.

extent_from_metadata(meta)[source]

Return spatial dataset extent from geosoft metadata.

Parameters

meta – metadata dictionary

Returns

geosoft.gxpy.geometry.Point2 instance

New in version 9.3.1.

extent_from_metadata_file(file_name)[source]

Return spatial dataset extent from file metadata .xml file

Parameters

file_name – spatial dataset file

Returns

geosoft.gxpy.geometry.Point2 instance

New in version 9.3.1.

find_meta_branch(meta, item)[source]

Return the lowest branch in the meta dictionary that contains the item.

New in version 9.3.1.