Forum

Author Topic: exportPoints works in 1.6.6 but "vertical datum out of range" in 1.7.5?  (Read 274 times)

andyroo

  • Sr. Member
  • ****
  • Posts: 395
    • View Profile
I have the following script, which works fine in Metashape 1.6.5 but fails in 1.7.5 with error: vertical datum out of range

My dense cloud is in GCS and my DEM (from which the dense cloud CRS is derived) is in a compound CS (NAD832011 + NAVD88). Geoid is in the appropriate subdir.

If I open the 1.7.5 project in 1.6.6 I can run the script below and export everything fine.


Code: [Select]
import Metashape
import math
import os
from os import path
laz_subdir = 'laz'
doc = Metashape.app.document
doc_path = os.path.split(doc.path)[0]
outPath = os.path.normpath(doc_path + os.sep + laz_subdir)
app = Metashape.app
doc = app.document
network_tasks = list()

for chunk in doc.chunks:
    if chunk.dense_cloud:
        print(chunk.label)
       
        v_projection = chunk.elevation.crs #presumes DEM built with desired PCS
        crs_label = v_projection.name
        crs_label = ''.join([x if x.isalnum() else '_' for x in crs_label if x not in '()/+'])
        crs_label = crs_label.replace('__','_')
        crs_label = crs_label.replace('_zone','')

        outFilename = chunk.label + '_dense_' + crs_label + '.laz'
        exportFile = os.path.normpath(outPath+os.sep+outFilename)
        if not os.path.exists(outPath):
            print('testing create path: ' + outPath)
            os.makedirs(outPath)
            print('testing file writestring: ' + exportFile)
            chunk.exportPoints(exportFile, source_data=Metashape.DenseCloudData, crs=v_projection, format=Metashape.PointsFormatLAZ)
        else:
            if not os.path.isfile(exportFile):
                print('testing file writestring: ' + exportFile)
                chunk.exportPoints(exportFile, source_data=Metashape.DenseCloudData, crs=v_projection, format=Metashape.PointsFormatLAZ)
    else:
        print(chunk.label, ' has no dense cloud')
print('script complete')

jugii

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: exportPoints works in 1.6.6 but "vertical datum out of range" in 1.7.5?
« Reply #1 on: November 23, 2021, 03:55:06 PM »
I got same kind of problem. Scripted dense cloud export still works in 1.7.3 but stopped working in 1.7.4.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 13211
    • View Profile
Re: exportPoints works in 1.6.6 but "vertical datum out of range" in 1.7.5?
« Reply #2 on: November 23, 2021, 05:00:49 PM »
Hello,

Thank you for the reporting.

Can you please confirm, if the export from the same project works from GUI?
Best regards,
Alexey Pasumansky,
Agisoft LLC

jugii

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: exportPoints works in 1.6.6 but "vertical datum out of range" in 1.7.5?
« Reply #3 on: November 24, 2021, 09:48:48 AM »
Hey

Yes, export from the same project works from GUI.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 13211
    • View Profile
Re: exportPoints works in 1.6.6 but "vertical datum out of range" in 1.7.5?
« Reply #4 on: November 24, 2021, 03:07:32 PM »
The issue will be fixed in the next 1.8.0 pre-release update. Also will be included to 1.7 version update (1.7.6 release is also expected).
Best regards,
Alexey Pasumansky,
Agisoft LLC