easyidp.metashape.read_project_zip#

easyidp.metashape.read_project_zip(project_folder, project_name)#

parse xml in the project.zip file, and get the chunk id and path

Parameters:
  • project_folder (str) –

  • project_name (str) –

Returns:

project_dict – key = chunk_id, value = chunk_path

Return type:

dict

Notes

If one project path look likes: /root/to/metashape/test_proj.psx, then the input parameter should be:

  • project_folder = "/root/to/metashape/"

  • project_name = "test_proj"

And obtained xml_str example:

<document version="1.2.0">
  <chunks next_id="2">
    <chunk id="0" path="0/chunk.zip"/>
  </chunks>
  <meta>
    <property name="Info/LastSavedDateTime" value="2020:06:22 02:23:20"/>
    <property name="Info/LastSavedSoftwareVersion" value="1.6.2.10247"/>
    <property name="Info/OriginalDateTime" value="2020:06:22 02:20:16"/>
    <property name="Info/OriginalSoftwareName" value="Agisoft Metashape"/>
    <property name="Info/OriginalSoftwareVendor" value="Agisoft"/>
    <property name="Info/OriginalSoftwareVersion" value="1.6.2.10247"/>
  </meta>
</document>

Example

Data prepare

>>> import easyidp as idp
>>> test_data = idp.data.TestData()

>>> project_folder = test_data.metashape.lotus_psx.parents[0]
PosixPath('/Users/<user>/Library/Application Support/easyidp.data/data_for_tests/metashape')
>>> project_name = 'Lotus'

Then use this function to

>>> idp.metashape.read_project_zip(project_folder, project_name)
{'0': '0/chunk.zip'}