Consuming OMF

This example demonstrates how to consume and Open Mining Format file

import omf
import pooch
import json

Load

# Base URL and relative path
base_url = "https://github.com/OpenGeoVis/omfvista/raw/master/assets/"
relative_path = "test_file.omf"

# Create a Pooch object
p = pooch.create(
    path=pooch.os_cache("geometallurgy"),
    base_url=base_url,
    registry={relative_path: None}
)

# Use fetch method to download the file
file_path = p.fetch(relative_path)

reader = omf.OMFReader(file_path)
project: omf.Project = reader.get_project()
print(project.name)
print(project.elements)
print(project.description)
Wolfpass
[<omf.pointset.PointSetElement object at 0x7f8eac85d630>, <omf.lineset.LineSetElement object at 0x7f8eac899990>, <omf.surface.SurfaceElement object at 0x7f8eac89b9d0>, <omf.surface.SurfaceElement object at 0x7f8eac898c40>, <omf.surface.SurfaceElement object at 0x7f8eac89a710>, <omf.surface.SurfaceElement object at 0x7f8eac8986a0>, <omf.surface.SurfaceElement object at 0x7f8eaca1ea40>, <omf.surface.SurfaceElement object at 0x7f8eaca1c9a0>, <omf.volume.VolumeElement object at 0x7f8eaca1dde0>]
OMF Wolfpass model

Total running time of the script: (0 minutes 1.440 seconds)

Gallery generated by Sphinx-Gallery