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 0x7fb8524fae70>, <omf.lineset.LineSetElement object at 0x7fb852eea480>, <omf.surface.SurfaceElement object at 0x7fb85249af00>, <omf.surface.SurfaceElement object at 0x7fb8528cd760>, <omf.surface.SurfaceElement object at 0x7fb853012690>, <omf.surface.SurfaceElement object at 0x7fb852f96e40>, <omf.surface.SurfaceElement object at 0x7fb852f96d50>, <omf.surface.SurfaceElement object at 0x7fb85302b800>, <omf.volume.VolumeElement object at 0x7fb852a94290>]
OMF Wolfpass model

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

Gallery generated by Sphinx-Gallery