Forum

Author Topic: Does importReference converts CRS automatically?  (Read 1587 times)

Benjamim

  • Newbie
  • *
  • Posts: 7
    • View Profile
Does importReference converts CRS automatically?
« on: June 11, 2024, 01:43:46 PM »
Hello everyone,

Does the importReference function automatically convert the CRS of the references provided?
I'm loading some references into a project and specifying their CRS as follows:

Code: [Select]
chunk.importReference(gcp_path, Metashape.ReferenceFormatCSV, delimiter=",",
                      columns="nxyz", crs=Metashape.CoordinateSystem(gcp_srs))

To test this, I have two files containing the same ground points but in different CRSs. Does Metashape have the capability to convert the reference CRS using the "crs" parameter in importReference, or should I handle the conversion before importing the file? So far, I haven't been able to generate correct outputs with one of the files. I'm trying to determine if I'm making a mistake or if the software doesn't support automatic CRS conversion.

Any insights would be appreciated!
Best regards,
Benjamim Oliveira

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15086
    • View Profile
Re: Does importReference converts CRS automatically?
« Reply #1 on: June 11, 2024, 04:25:43 PM »
Hello Benjamim,

No, Metashape is not converting the coordinate information when the data is loaded from CSV file. It setups the coordinate system according to the value of the corresponding parameters and load the coordinate values from the CSV file.
You can convert the coordinates after loading them in the original coordinate system using:
Code: [Select]
new_point = Metashape.CoordinateSystem.transform(point, source_crs, target_crs)Apply it to all marker.reference.location values and then switch chunk.marker_crs to target_crs.
Best regards,
Alexey Pasumansky,
Agisoft LLC