I have a workflow for photogrammetry data where the user places all image folders and kml boundaries into the project folder and the scrpit below is intended to automatically import multiple folders to one chunk, prompt the user for the coordinate system, then import a kml or kmz that should be used as an outer boundary for clipping exported data later on. I am having a problem with getting the script to define the kml shape as an outer boundary and I get the following error:
Error importing KML/KMZ file: module 'Metashape' has no attribute 'BoundaryType'
I've attached the whole script but the function in question is:
def import_kml_kmz(chunk, file_path):
try:
# Set boundary type to "Outer"
chunk.boundary_type = Metashape.BoundaryType.OuterBoundary
# Import KML/KMZ
chunk.importKML(file_path)
print(f"KML/KMZ file '{os.path.basename(file_path)}' imported successfully.")
except Exception as e:
print(f"Error importing KML/KMZ file: {e}")
Does anyone know if this functionality is supported?