Agisoft Metashape

Agisoft Metashape => Python and Java API => Topic started by: spatialdigger on July 28, 2021, 02:48:12 AM

Title: Loading coordinates of reference markers
Post by: spatialdigger on July 28, 2021, 02:48:12 AM
I have

Code: [Select]
    doc = Metashape.Document()

    # set up a chunk
    chunk = doc.addChunk()

    # add photos
    chunk.addPhotos(filenames=photo_list)
    # doc.save(filepath)

    # detect markers
    chunk.detectMarkers()
    # assign crs
    chunk.crs = Metashape.CoordinateSystem("EPSG::27700")

All that works fine, I have a targets.csv file, setup as standard, works manually.

So I try the following:
   
Code: [Select]
chunk.loadReference(path=targets_path, format=Metashape.ReferenceFormatCSV, columns='nxyz', delimiter=',',create_markers=True)
And I get the following error, where am I going wrong?
Code: [Select]
Traceback (most recent call last):
  File "<input>", line 1, in <module>
AttributeError: 'Metashape.Metashape.Chunk' object has no attribute 'loadReference'
Title: Re: Loading coordinates of reference markers
Post by: Paulo on July 28, 2021, 03:43:59 AM
Hi spatialdigger,

please change chunk.loadReference to chunk.importReference ....
Title: Re: Loading coordinates of reference markers
Post by: spatialdigger on July 28, 2021, 08:08:53 PM
Perfect!