Open Mining Format (OMF)

Open Mining Format (OMF) is a data exchange format for mining and geological data. OMF is backed by the Global Mining Guidelines Group and aims to be the new standard for transferring data between software applications.

Overview

Maptek Python SDK supports data exchange with OMF (version 1.0) through a separate Python package, maptekomf-maptek. This package supports data exchange between OMF and several Maptek products that share a common data infrastructure, including the following:

  • PointStudio

  • BlastLogic

  • GeologyCore

Note:  As of January 2025, OMF 2.0 is under development. The maptekomf-maptek package is not compatible with OMF 2.0.

Note:  The maptekomf-maptek package does not support data exchange between OMF and Vulcan. For Vulcan, use the package maptekomf-vulcan instead.

The following data types are supported:

  • Point sets

  • Line work (polylines, polygons, and edge networks)

  • Surfaces

Note:  Other data types such as block models are not currently supported. If this is a priority for you, please contact Maptek to discuss options.

Installation

To use OMF with Maptek Python SDK, you need to install the Python package maptekomf-maptek.

To install via Maptek Workbench:

  1. Go to (Preferences)Workbench Preferences.

  2. Click on the Python tab.

  3. Under Manage Python Packages, click Open Python Shell.... A shell terminal window will open.

  4. At the prompt, type the following command and press Enter:

    pip install maptekomf-maptek

Command line usage

You can perform data conversion between OMF files and objects in the currently running application directly from the command line, as detailed below.

Importing an OMF file into a project

The following command imports the OMF file project.omf into the project of the currently running application:

python -m maptekomf.maptek import project.omf

Exporting objects to an OMF file

The following command exports the objects located at /scrapbook/project in the currently open application to exported.omf:

python -m maptekomf.maptek export /scrapbook/project/ --output exported.omf

Script usage

The following examples demostrate performing data conversion between OMF files and objects in the connected application using a Python script.

Importing an OMF file into a project

The following script imports objects from an OMF file into the project of the connected application:

from mapteksdk.project import Project

from maptekomf.maptek.importer import omf_to_project

if __name__ == '__main__':
    with Project() as project:
        omf_to_project('objects.omf', project, '/scrapbook/omf/objects',
                       overwrite=False)

Exporting selected objects to an OMF file

The following script exports the objects selected into the current application to an OMF file:

from mapteksdk.project import Project

from maptekomf.maptek.exporter import objects_to_omf

if __name__ == '__main__':
    with Project() as project:
        objects_to_omf(project, project.get_selected(), 'c:/data/objects.omf')

Workflow usage

The follow examples demonstrate how to perform OMF data conversion within a Workflow.

Importing using a workflow

The following script can be used in a workflow to import an OMF file:

"""Import objects from OMF file into a Maptek project."""
from maptekomf.maptek.workflow import import_single_omf

if __name__ == '__main__':
    import_single_omf()

Exporting using a workflow

The following script can be used in a workflow to export to an OMF file.

"""Export objects from a Maptek project into a single OMF file."""
from maptekomf.maptek.workflow import export_single_omf

if __name__ == '__main__':
    export_single_omf()

Limitations

  • Some software packages can produce invalid OMF files where objects contain no vertices. These files can't be read by the official OMF package used by maptekomf-maptek.

  • Maptek objects of type Polyline and Polygon will be re-imported as EdgeNetwork. There is potential here to improve this situation.

  • Objects cannot have primitive attributes of type "date time" in Maptek applications. Importing an OMF element with date time attributes is not supported.

  • The Maptek object type GridSurface does not support textures. This means textures for gridded surfaces in an OMF file won't be imported.

  • The Maptek object type GridSurface does not support cell colouring.

  • Exporting a GridSurface object from a Maptek project may not work, as the GridSurface object is more general than the gridded surface object in OMF.

  • Exporting a textured Surface object from a Maptek project to OMF may not work, as texturing in Maptek applications is more sophisticated than what OMF supports.

  • Only one colour map (legend) will be imported per object. Maptek applications only allow a single colour map to be assigned to an object.

  • Importing colour maps on edge, cell and facet attributes is not supported in the 2021 versions of Maptek applications. If there are strings in the legend, then the strings will still be imported as an edge, cell or facet attribute.

  • Only specific cases of omf.MappedData will be imported; at this time, this means string and colour. Only data that was found in the sample data file provided by the OMF GitHub project is handled, as the full scope of what is possible appears to be unbounded.

  • Primitive visibility is not preserved in the export. This means certain types of filtering in Maptek applications will be lost on export.

  • Container hierarchy will not be preserved, as OMF has no concept of containers or folders within its file format. This may be subject to change depending on what other OMF applications handle (for example using backslashes in the names of objects to define a hierarchy).