Forum

Author Topic: Check if orthomosaic has been built?  (Read 410 times)

spatialdigger

  • Newbie
  • *
  • Posts: 17
    • View Profile
Check if orthomosaic has been built?
« on: September 12, 2021, 04:29:19 AM »
I'm trying to check if the orthomosaic has been built or not.

chunk.orthomosaic returns an object because it is a method.

So I can't simply try:

ortho = chunk.orthomosaic
if ortho:
  print("ortho has been built")

as it will always return true because it references the method.

So how do I go about checking if the orthomosaic has been built?

Is it similar as the check for the alignment step?:

Code: [Select]

align = False
  for camera in chunk.cameras:
    if camera.transform:
      print("Found first aligned camera")
      align = True
      break

maybe something like:
Code: [Select]
for ortho in chunk.orthomosaic:
  if ortho.something:
    ortho_built = True

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 13222
    • View Profile
Re: Check if orthomosaic has been built?
« Reply #1 on: September 13, 2021, 02:04:03 PM »
Hello spatialdigger,

chunk.orthomosaics will return the list of Orthomosaic class objects. chunk.orthomosaic - returns active orthomosaic (that should appear, if you generate the orthomosaic, for example).

So the latter option should return you None if there's no active orthomosaic in the chunk.
Best regards,
Alexey Pasumansky,
Agisoft LLC