Forum

Author Topic: Importing References  (Read 4930 times)

christopher.giesige@sjsu.

  • Newbie
  • *
  • Posts: 7
    • View Profile
Importing References
« on: February 15, 2024, 11:24:49 PM »
Hey Metashape team,

I am working with the python api and trying to import a data reference for the images in a chunk. The issue I am having is that when I import the reference data using the api the image points show up on the basemap as being over the ocean instead of at the correct coordinates (attached img 538). When I go into the Metashape Pro program and import the reference data manually the image points show up in the correct location. I noticed that when I import the references with the api and check the references in the program the coordinate system shows up as Easting and Northing (img 538), but when I import them manually the coordinate system shows up how the reference csv file has them stored as Longitude and Latitude. I have also attached screenshots of what my reference data csv file look like so you can see the output data and coordinate system it has (attached img 539) along with how the reference data file looks that I am trying to import (attached img 540).

This is the code I have so far for this process:
image_folder = 'path to images'
find_photos = find_files(image_folder, [".jpg"])
chunk = doc.addChunk()
chunk.addPhotos(find_photos)
chunk.crs = Metashape.CoordinateSystem("EPSG::32641")
chunk.importReference(path = "path to reference csv file", format = Metashape.ReferenceFormatCSV, columns = 'ncbayxzCBAYXZ', delimiter = "\t")

I hope this makes sense and let me know if any of this is not clear or I need to expand on the explanation. Any suggestions on fixing this issue?

Thank you,
Chris

Paulo

  • Hero Member
  • *****
  • Posts: 1467
    • View Profile
Re: Importing References
« Reply #1 on: February 16, 2024, 12:41:32 AM »
Hello Chris,
I think you have to define your chunk crs as WGS84 (lon,lat.elev) and thus use following line to do it (presently you are defining it as UTM41):
Code: [Select]
chunk.crs = Metashape.CoordinateSystem("EPSG::4326")
Best Regards,
Paul Pelletier,
Surveyor

christopher.giesige@sjsu.

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Importing References
« Reply #2 on: February 16, 2024, 02:00:35 AM »
Thank you Paulo, that was it. Can't believe I missed that.

Chris