Note
Go to the end to download the full example code.
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 0x7f90dbe13dc0>, <omf.lineset.LineSetElement object at 0x7f90dbd93bb0>, <omf.surface.SurfaceElement object at 0x7f90dbd917b0>, <omf.surface.SurfaceElement object at 0x7f90dbd924a0>, <omf.surface.SurfaceElement object at 0x7f90dbd90fa0>, <omf.surface.SurfaceElement object at 0x7f90dbd91840>, <omf.surface.SurfaceElement object at 0x7f90dbd92e60>, <omf.surface.SurfaceElement object at 0x7f90dbd922c0>, <omf.volume.VolumeElement object at 0x7f90dbd905e0>]
OMF Wolfpass model
Total running time of the script: (0 minutes 0.801 seconds)