Author Topic: importPoints does nothing when running headless  (Read 1323 times)


  • Newbie
  • *
  • Posts: 18
    • View Profile
importPoints does nothing when running headless
« on: May 28, 2019, 03:35:09 PM »
Hi Alexey,

I've run into a strange issue that seems to affect Metashape when running headless that I'm hoping you can help with.

I have a simple Python script that does the following (please ignore any small typos below as I've pulled out the relevant functionality to keep it brief.

Code: [Select]
    chunk = = Metashape.CoordinateSystem('EPSG::28356')
    format = Metashape.PointsFormat.PointsFormatLAS

When I run this code line by line via the Python console on Mac OS X, the pt cloud imports and is visible in the chunk.

When I run Metashape headless on Linux, I am left with an empty project with nothing in it. The operation otherwise seems to complete extremely quickly without logging any errors.

Metashape is run using the following system call

Code: [Select]
./ -r -platform offscreen
Any ideas why this could be happening?

I also noticed that the help documentation around does not seem to make any mention of the "-platform" option on Linux. Is there somewhere we can see the comprehensive list of options that ""?



Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14228
    • View Profile
Re: importPoints does nothing when running headless
« Reply #1 on: May 28, 2019, 07:07:48 PM »
Hello jbak9141,

Please try to modify your headless script in the following way and check, if it gives you a proper result:

Code: [Select]
    import Metashape
    doc = Metashape.Document()
    chunk = doc.addChunk() = Metashape.CoordinateSystem('EPSG::28356')
    p_format = Metashape.PointsFormat.PointsFormatLAS

I've also renamed your "format" variable, as format - is usually a reserved word in Python.
Best regards,
Alexey Pasumansky,
Agisoft LLC