Forum

Author Topic: camera reference: edit columns (lat and long) when importing log files  (Read 1514 times)

agroeco

  • Newbie
  • *
  • Posts: 6
    • View Profile
Hi,

has anyone been able to change column heading when importing a log file of camera locations?

When importing a CSV, a window is displayed that allows you to change the columns, "start import from row:", set the coordinate system, etc.  However, when importing a log files, the label, lat, long, and altitude fields get assigned automatically. This results in the lat and long coordinates being reversed.  I only need to reverse the lat and long labels so that we can accurately set camera positions. 

Any help would be greatly appreciated. 

cheers,
Matt
« Last Edit: August 13, 2019, 07:51:37 PM by agroeco »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14855
    • View Profile
Hello Matt,

Can you provide an example of the LOG file used for import?

To swap X and Y columns for already loaded reference data you can either export the source values to CSV and import them back or use the following Python code:
Code: [Select]
import Metashape
chunk = Metashape.app.document.chunk
for camera in chunk.cameras:
    if camera.reference.location:
        coord = camera.reference.location
        camera.reference.location = Metashape.Vector([coord.y, coord.x, coord.z])
Best regards,
Alexey Pasumansky,
Agisoft LLC

agroeco

  • Newbie
  • *
  • Posts: 6
    • View Profile
ok will give your suggestion a go. 

here's the log file

thanks for the help. 

cheers,
Matt