Hello Alexey,
On my projects, I choose the crs during the exports individually, ie. the orthomosaics are exported as follows:
# Export Orthophoto
path_ortho = path_export_chk + chunk.label + "_Ortho" + ".jpg"
chunk.exportOrthomosaic(path_ortho, format = "jpg",
raster_transform = PhotoScan.RasterTransformNone,
projection = PhotoScan.CoordinateSystem("EPSG::3948"),
write_world = True)
I tried using your code (PhotoScan version 1.2.6) and it's not working, projection = crs being and incompatible keyword. Here's my current code, more or less working. More less than more though, as I get the error message "Can't export shapes." when running it.
Any idea why?
import os
import PhotoScan
print(""">>> Initialisation du script IV <<<""")
doc = PhotoScan.app.document
path_export = PhotoScan.app.getExistingDirectory("""Spécifiez le dossier
contenant les exports en fin de traitement""")
path_export += "\\"
print(""">>> Génération des fichiers de sortie <<<""")
for chunk in doc.chunks:
# Create a new folder
path_export_chk = path_export + "_SHP"
if not os.path.exists(path_export_chk):
os.makedirs(path_export_chk)
path_export_chk += "\\"
path_export_shp = path_export_chk + chunk.label
if not os.path.exists(path_export_shp):
os.makedirs(path_export_shp)
path_export_shp += "\\"
crs = PhotoScan.CoordinateSystem("EPSG::3948")
chunk.exportShapes(path_export_shp)
PhotoScan.app.update()
print(""">>> Fichiers exportés ! <<<""")
doc.save()
PhotoScan.app.update()
print(""">>> Script Partie IV terminé <<<""")