OpenGeoVis / omfvista

3D visualization for the Open Mining Format (omf)

Home Page:https://opengeovis.github.io/omfvista/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OMF Test File Can not be loaded

Terranigmus opened this issue · comments

The OMF test file can not be loaded and results in

Traceback (most recent call last):

  File "<ipython-input-37-1d8fccc63af4>", line 1, in <module>
    proj2=omfvtk.load_project('test_file.omf')

  File "C:\Users\Paul\Anaconda3\lib\site-packages\omfvtk\wrapper.py", line 122, in load_project
    reader = omf.OMFReader(filename)

  File "C:\Users\Paul\Anaconda3\lib\site-packages\omf\fileio.py", line 107, in __init__
    self._uid, self._json_start = self.read_header()

  File "C:\Users\Paul\Anaconda3\lib\site-packages\omf\fileio.py", line 155, in read_header
    raise ValueError('Invalid OMF file')

ValueError: Invalid OMF file

Can you share where you downloaded the test file? Is this the one in this repository or the one in the OMF repo?

That error is coming from the omf library before any major code on the omfvtk side which leads me to think your version of OMF is below the required v1.0.0. I will also need details listed for #2 to address this.

I took the one from the OMF 1.0 repository, sorry, should have said that!

@Terranigmus - The error you are encountering is happening on the file "prefix" https://github.com/gmggroup/omf/blob/master/omf/fileio.py#L154

This prefix been in place for all OMF files to date, unrelated to version changes, etc. This leads me to believe the problem is not with your Python library version, but instead the file itself or possibly a Windows issue... Can you make sure the file you are referencing is in fact the correct file? If all that is good, this may require more investigation.

(NB: Hopefully file serialization will be more transparent in the next version of OMF, without these "magic prefixes" etc - https://github.com/gmggroup/omf/issues/36 )