Forum

Author Topic: Export DEM with Slope mode with Python API  (Read 2878 times)

Olivier

  • Newbie
  • *
  • Posts: 1
    • View Profile
Export DEM with Slope mode with Python API
« on: February 21, 2023, 12:16:39 PM »
Hello,

I am trying to export the DEM results with Slope mode (like in this topic for GUI https://www.agisoft.com/forum/index.php?topic=9794.0 -  "DEM mode" option in the Preferences -> Appearance -> Ortho tab from "Altitude" (default) to "Slope"), but I can't find a function to do it with the Python API.

Is this currently possible?

Thanks for your response  :)

Olivier

smiller

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Export DEM with Slope mode with Python API
« Reply #1 on: August 15, 2023, 09:26:26 PM »
Any luck with this?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14816
    • View Profile
Re: Export DEM with Slope mode with Python API
« Reply #2 on: February 14, 2024, 01:16:35 PM »
Hello!

In the version 2.1 the following way should work to export DEM in slope mode:

Code: [Select]

chunk = Metashape.app.document.chunk
task = Metashape.Tasks.ExportRaster()
task.path = "D:/slope.jpg"
task.source_data = Metashape.ElevationData
task.raster_transform = Metashape.RasterTransformPalette
task["elevation_mode"] = 1
task.apply(chunk)
Best regards,
Alexey Pasumansky,
Agisoft LLC