Hi Paul,
First of all, thank you very much for helping me out and creating/uploading the GCG2016-file.
I downloaded it and tried to implement it into the process. Unfortunately it is still not working...
Here is what I did:
I created a .prj-File with the downloaded GCG2016.tif file (I called it GCG2016_Paul.tif). The prj-code looks like this and I defined it as "coordinateSystem "-variable (for Metashape-Python-script):
COMPD_CS["ETRS89 / UTM zone 32N+GCG2016_Paul",PROJCS["ETRS89 / UTM zone 32N",GEOGCS["ETRS89",DATUM["European Terrestrial Reference System 1989 ensemble",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6258"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9102"]],AUTHORITY["EPSG","4258"]],PROJECTION["Transverse_Mercator",AUTHORITY["EPSG","9807"]],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","25832"]],VERT_CS["DHHN2016",VERT_DATUM["ETRS89 (EPSG::4937) to Deutsches Haupthoehennetz 2016",2005],UNIT["metre",1,AUTHORITY["EPSG","9001"]]]]
In Metashape-Python-script I defined the geoid path:
geoidPath = cwd + "/supportFiles/geoids/GCG2016_Paul.tif"
print("geoidPath: "+geoidPath)
and the coordinate system:
new_crs = Metashape.CoordinateSystem(coordinateSystem)
new_crs.addGeoid(geoidPath)
chunk.crs = new_crs
chunk.updateTransform()
for camera in chunk.cameras:
camera.reference.location = new_crs.project(chunk.crs.unproject(camera.reference.location))
doc.save ()
By running the script I get the error message
Traceback (most recent call last):
File "workflow_align2_depthMaps2_fullWorkflow.py", line 132, in <module>
chunk.updateTransform()
RuntimeError: Vertical datum missing
I changed the name of the tiff-file (to make sure Metashape is working with the right file) and I get the error message
File "workflow_align2_depthMaps2_fullWorkflow.py", line 130, in <module>
new_crs.addGeoid(geoidPath)
OSError: Can't open file: No such file or directory (2): /mnt/Daten/Projekte/06_Aischtal-Staedtler/00_Datenaufnahme_2022-09-01/M17_K_h110_v4_60grad_OH60_OV60_nSP/CD/run_Flug7_full-ini/supportFiles/geoids/GCG2016_Paul.tif
I really don't get what I am doing wrong...
I am running the script on a (external) linux cluster without GUI, which is why I am not able to create the file on the cluster itself, but I thought by defining the geoid path, Metashape should know where to get the files from, right?
Best regards
Michael