Forum

Author Topic: Python method to duplicate the elevation model V2.0 API  (Read 1125 times)

tim12p

  • Newbie
  • *
  • Posts: 5
    • View Profile
Python method to duplicate the elevation model V2.0 API
« on: February 16, 2023, 02:26:05 PM »
I'm simply trying to write some code to duplicate the default DEM in the Chunk and then re-label it.  I'm trying to do this via;

Metashape.Elevation.Copy() but I get no result.  Must be missing something fundamental I guess.

Any help would be gladly appreciated.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14855
    • View Profile
Re: Python method to duplicate the elevation model V2.0 API
« Reply #1 on: February 16, 2023, 06:41:27 PM »
Hello tim12p,

Metashape.Elevation - is a class name, and you need to get access to the certain element in the project.

If you need to duplica the elevation model in the project opened in GUI, then you can do it in following way:
Code: [Select]
chunk = Metashape.app.document.chunk
dem = chunk.elevation
new_dem = dem.copy()
Best regards,
Alexey Pasumansky,
Agisoft LLC

tim12p

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Python method to duplicate the elevation model V2.0 API
« Reply #2 on: February 17, 2023, 03:19:37 AM »
Perfect.  Thanks for your help Alexey.