Forum

Author Topic: load coordinates using gc.load()  (Read 2802 times)

BFE38

  • Newbie
  • *
  • Posts: 5
    • View Profile
load coordinates using gc.load()
« on: May 06, 2015, 11:25:28 PM »
Hi,

I'm trying to load a text file with coordinates for my photos.  Through the GUI under the ground control panel I can just click "import" and select my .txt file and it works just fine.  I'm having issues trying to get it work through a script though.

Attached is a copy of my coordinates I'm testing with. 
Here is my code, any help would be appreciated.

Code: [Select]
    new_chunk = PhotoScan.Chunk()
    new_chunk.label = "New Chunk"

    for f in files:
        new_chunk.photos.add(f)

    doc.chunks.add(new_chunk)

    gc = new_chunk.ground_control
    gc.projection = crs
    gc.load("Z:\\inbound\\aaa.txt", "csv")
    gc.apply()

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14846
    • View Profile
Re: load coordinates using gc.load()
« Reply #1 on: May 08, 2015, 11:55:12 AM »
Hello BFE38,

In the version 1.1.6 there were some changes in Python API, so your code should be modified as follows:
Code: [Select]
    new_chunk = PhotoScan.Chunk()
    new_chunk.label = "New Chunk"

    for f in files:
        photo_list.append(f)
    new_chunk.addPhotos(photo_list)

    doc.addChunk(new_chunk)

    new_chunk.loadReference("Z:\\inbound\\aaa.txt", "csv")
    new_chunk.crs = crs
    new_chunk.updateTransform()
Best regards,
Alexey Pasumansky,
Agisoft LLC

BFE38

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: load coordinates using gc.load()
« Reply #2 on: May 11, 2015, 04:42:11 PM »
Hi, thanks for the reply.

Sorry I forgot to mention my PhotoScan is running version 1.0.4, do you how to fix this issue for 1.0.4?