Forum

Author Topic: chunk.tie_points.export() exports full PointCloud  (Read 2940 times)

itaidotan

  • Newbie
  • *
  • Posts: 3
    • View Profile
chunk.tie_points.export() exports full PointCloud
« on: November 19, 2024, 12:34:24 PM »
Hi,

Recently I started experiencing with Metashape's API and I have to say it is very comfortable and well documented.

One annoying thing I couldn't solve is how to export the TiePoints' XYZ coordinates.
Whenever I use chunk.tie_points.export(path) it saves the FULL pointcloud, not just the tie points.
When saving the running chunk.tie_points.export() before building pointcloud, I get a "Null Point Cloud" error.
This seems like a bug, but I didn't see any issue similar to mine, so maybe I am not using the method correctly.

I would appreciate your help very much.

Thanks in advance!

itaidotan

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: chunk.tie_points.export() exports full PointCloud
« Reply #1 on: November 20, 2024, 11:59:00 AM »
Alternatively, is there a way to read the tie points' xyz coordinates directly from chunk.tie_points without exporting them to a file and reading the file?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15438
    • View Profile
Re: chunk.tie_points.export() exports full PointCloud
« Reply #2 on: December 02, 2024, 01:24:55 PM »
Hello itaidotan,

Please try the following:
Code: [Select]
chunk.exportPointCloud(path, source_data =Metashape.TiePointsData)Additional optional arguments can be added depending on the export needs.


If you need to access tie points coordinates, then you can use the following:
Code: [Select]
tie_points = chunk.tie_points.points
for point in tie_points:
   v_internal = point.coord
   v_internal.size = 3
   v_geocentric = chunk.transform.matrix.mulp(v)
   v_geographic = chunk.crs.project(v)

If the chunk is georeferenced, you'll get geographic coordinates in the chunk's coordinate system in v_geographic variable.
« Last Edit: December 02, 2024, 01:28:48 PM by Alexey Pasumansky »
Best regards,
Alexey Pasumansky,
Agisoft LLC