Forum

Author Topic: P4 RTK camera coordinates (ETRS89) to GK using Ntv2 grid  (Read 781 times)

nikowacker

  • Newbie
  • *
  • Posts: 2
    • View Profile
P4 RTK camera coordinates (ETRS89) to GK using Ntv2 grid
« on: January 03, 2023, 11:20:25 AM »
Hello everyone,

can someone please help me. I would like to write a script to transform the already read (in Metashape) camera coordinates from the P4 RTK images into Gauß-Krüger coordinates. So far i have a script that exports the camera coordinates and a script that imports the alredy transformed GK coordinates. The actual horizontal transformation for Bavaria(Germany) I am doing it with Ntv2 grid by using another software . However, I was not able to find a solution how to transform the coordinates with the Ntv2 grid using Python exclusivly. Does anyone knows how to transform the ETRS89 coordinates using the Ntv2 grid using Python?

The undulation does not play a role so far because I got the solution empirically (I wolk in a small area of 5-10 km2).

Thank you in advance.

Kind regards
Niko

benj_G

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: P4 RTK camera coordinates (ETRS89) to GK using Ntv2 grid
« Reply #1 on: January 05, 2023, 11:12:25 AM »
Hi,
you can use pyproj to do it !
below a script I make for manually convert with a command line. You can easily change it for you're need.

Run the script with cmd line :
Code: [Select]
python main.py .\Downloads\EO_EPSG-4326.txt EPSG:4326 EPSG:31468In output file (same dir as input) there is information about "pipeline" (here in make a conversion from 4326 to 31468 and use Betta2007 'proj=hgridshift grids=de_adv_BETA2007.tif')

Hope it's help.

PS: Please Agisoft ! deal with NTV2 grids for builtin convertion please 🙏
« Last Edit: January 05, 2023, 11:16:14 AM by benj_G »

nikowacker

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: P4 RTK camera coordinates (ETRS89) to GK using Ntv2 grid
« Reply #2 on: January 05, 2023, 02:06:25 PM »
Thanks a lot benj_G,

the Ntv2 format we use in Germany i*.gsb (binary). Is there already developed script (function) for Python that uses this grid for horizontal data transformation? I was searching on the Web but have not find anything. There is only one function within Gdal, and for some reason I cannot bring Gdal to work on Python.

Kind regards,
NIko