Forum

Author Topic: Set coordinate system to WGS 84 + EGM96  (Read 2991 times)

pyeah

  • Newbie
  • *
  • Posts: 4
    • View Profile
Set coordinate system to WGS 84 + EGM96
« on: November 27, 2018, 02:18:44 PM »
Hello,

In the interface of PhotoScan (version 1.4.4), it is possible to set the coordinate system to WGS 84 + EGM96 (see attached image). Since there is no corresponding EPSG code for this (correct?), I am not able to set this through the python API.

Is there another way of doing this? I tried the following:

Code: [Select]
chunk.crs = PhotoScan.CoordinateSystem("EPSG::4326")
chunk.crs.addGeoid("C:/Program Files/Agisoft/PhotoScan Pro/geoids/egm96-15.tif")
chunk.updateTransform()

But got the following error:

Code: [Select]
2018-11-27 12:04:06 Traceback (most recent call last):
2018-11-27 12:04:06   File "D:/Mapeo/MS/914_20180905_HAM801/output-ms/align/DGM_000914_align.py", line 2224, in <module>
2018-11-27 12:04:06     chunk.crs.addGeoid("C:/Program Files/Agisoft/PhotoScan Pro/geoids/egm96-15.tif")
2018-11-27 12:04:06 SystemError: <built-in method addGeoid of type object at 0x000000000BBD2D98> returned NULL without setting an error
2018-11-27 12:04:06 Error: OpenCL not supported

Thanks for checking this out.

Best regards

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14846
    • View Profile
Re: Set coordinate system to WGS 84 + EGM96
« Reply #1 on: November 28, 2018, 04:25:45 PM »
Hello pyeah,

addGeoid() should be used only to add the geoid to the list, if it was not automatically added to the list of available geoids when the application started (i.e. was not in the /geoids/ subdirectory of PhotoScan Pro installation folder when the script was started). It wouldn't modify the coordinate definition.

To initialize WGS84+EGM96 height coordinate system I can suggest to use WKT definition (as the system doesn't have the EPSG registry code):
Code: [Select]
chunk.crs = PhotoScan.CoordinateSystem('COMPD_CS["WGS 84 + EGM96 height",GEOGCS["WGS 84",DATUM["World Geodetic System 1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9102"]],AUTHORITY["EPSG","4326"]],VERT_CS["EGM96 height",VERT_DATUM["EGM96 geoid",2005,AUTHORITY["EPSG","5171"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","5773"]]]')
Best regards,
Alexey Pasumansky,
Agisoft LLC

pyeah

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Set coordinate system to WGS 84 + EGM96
« Reply #2 on: November 30, 2018, 06:29:34 PM »
Excellent, works great.