Forum

Author Topic: exportDem  (Read 5097 times)

james.herbst

  • Newbie
  • *
  • Posts: 12
    • View Profile
exportDem
« on: August 23, 2017, 03:26:36 PM »
Dear Forum,
I'm having trouble upgrading various parts of my code to 1.3, in particular the exportDem and using a local coordinate system. I am pasting my bad code below and greatly appreciate any help you might offer.
With best regards,
James

Code: [Select]
for chnk in PhotoScan.app.document.chunks:
    filename = folder2 + '/' + chnk.label + '_DEM1cmPixels.tif'
    chnk.exportDem(filename, PhotoScan.RasterFormatXYZ, PhotoScan.ImageFormatTIFF, Projection=chunk.crs, , .01, .01, , -32767, False, True, False)
    print(filename)

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15650
    • View Profile
Re: exportDem
« Reply #1 on: August 23, 2017, 05:13:57 PM »
Hello James,

What error message you are observing in the Console pane when using this code?

I see several issues that might be causing the problem:
- chunk.crs is not defined, you should use chnk.crs, if you need to export DEM in the coordinate system of the current chunk,
- the keyword for the projection argument is "projection" not "Projection",
- in the function you cannot use positional argument after using a keyword argument (projection in your case), so you'd batter use keywords for all the arguments.
Best regards,
Alexey Pasumansky,
Agisoft LLC

james.herbst

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: exportDem
« Reply #2 on: August 24, 2017, 10:15:52 AM »
Thanks Alexy, that helps quite a bit and I think I fixed it. The answer was more simple than I thought.

Code: [Select]
for chnk in PhotoScan.app.document.chunks:
    filename = folder2 + '/' + chnk.label + '_DEM1cmPixels.tif'
    chnk.exportDem(filename, write_world = True )
    print(filename)