Hello Uygar,
Please check the updated script. If should export DEM (in GeoTIFF), orthomosaic (in GeoTIFF), dense point cloud (in LAS), mesh model (in OBJ).
import Metashape
chunk = Metashape.app.document.chunk
output_dir = Metashape.app.getExistingDirectory("Specify the output folder:")
output_crs = Metashape.app.getCoordinateSystem("Specify output Coordinate System:", chuunk.crs)
if not output_crs:
output_crs = chunk.crs
proj = Metashape.OrthoProjection()
proj.crs = output_crs
for shape in chunk.shapes:
if shape.type != Metashape.Shape.Type.Polygon:
continue
shape.boundary_type = Metashape.Shape.BoundaryType.NoBoundary
for shape in chunk.shapes:
if shape.type != Metashape.Shape.Type.Polygon:
continue
shape.boundary_type = Metashape.Shape.BoundaryType.OuterBoundary
if chunk.orthomosaic: #export ortho
path = "ortho_" + str(shape.key) + "_" + shape.label + ".tif"
chunk.exportRaster(output_dir + "/" + path, source_data = Metashape.DataSource.OrthomosaicData, projection = proj)
if chunk.elevation: #export DEM
path = "DEM_" + str(shape.key) + "_" + shape.label + ".tif"
chunk.exportRaster(output_dir + "/" + path, source_data = Metashape.DataSource.ElevationData, projection = proj)
if chunk.dense_cloud: #export points
path = "points_" + str(shape.key) + "_" + shape.label + ".las"
chunk.exportPoints(output_dir + "/" + path, source_data = Metashape.DenseCloudData, format = Metashape.PointsFormatLAS, crs = output_crs)
if chunk.model: #export mesh
path = "mesh_" + str(shape.key) + "_" + shape.label + ".obj"
chunk.exportModel(output_dir + "/" + path, format = Metashape.ModelFormatOBJ, crs = output_crs)
shape.boundary_type = Metashape.Shape.BoundaryType.NoBoundary
print("Finished")
What kind of output in KMZ format do you need to export?