Forum

Author Topic: Polygon option in Model tab.  (Read 5862 times)

ManishSahu

  • Newbie
  • *
  • Posts: 27
    • View Profile
Polygon option in Model tab.
« on: March 18, 2018, 12:25:49 PM »
Can anyone tell me what is the use of polygon option in Model tab? Can I use it to export clipped Orthomosaic or DEM?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14003
    • View Profile
Re: Polygon option in Model tab.
« Reply #1 on: March 18, 2018, 07:06:46 PM »
Hello ManishSahu,

You can draw polygon shape in Model or Ortho view mode.

If you wish to export the DEM/Orthomosaic only inside the area defined by the polygon (or polygons) you need to switch to the Ortho view mode, select the desired shape, right click on it and choose Set Boundary -> Outer Boundary option. Boundaries would be automatically applied to DEM/Orthomosaic export.
Best regards,
Alexey Pasumansky,
Agisoft LLC

ManishSahu

  • Newbie
  • *
  • Posts: 27
    • View Profile
Re: Polygon option in Model tab.
« Reply #2 on: March 18, 2018, 08:14:28 PM »
Thanks. I want to do exactly same things. Exporting Ortho and DEM wrt polygon. I will try it out.

ManishSahu

  • Newbie
  • *
  • Posts: 27
    • View Profile
Re: Polygon option in Model tab.
« Reply #3 on: March 20, 2018, 01:45:08 PM »
I have tried this method. Work perfectly as I wanted. Thanks

ManishSahu

  • Newbie
  • *
  • Posts: 27
    • View Profile
Re: Polygon option in Model tab.
« Reply #4 on: March 21, 2018, 07:36:03 PM »
Can you tell me if i can export clipped version using python script?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14003
    • View Profile
Re: Polygon option in Model tab.
« Reply #5 on: March 21, 2018, 08:11:37 PM »
Hello ManishSahu,

The shapes set as boundaries should be automatically applied on export operations, even they are run from the script.

If you have imported the shape to be used as boundary, then apply the following method to it:
Code: [Select]
shape.boundary_type = PhotoScan.Shape.BoundaryType.OuterBoundary
Best regards,
Alexey Pasumansky,
Agisoft LLC

ManishSahu

  • Newbie
  • *
  • Posts: 27
    • View Profile
Re: Polygon option in Model tab.
« Reply #6 on: March 23, 2018, 12:54:37 PM »
Respected Alexey Pasumansky,
I have successfully completed exporting with respect to shapefile. Thanks for helping. I have one more query. Now I have a shapefile which consists of multiple polygon (refer to screenshot). I want to export separately for each polygon using python script. How to achieve this?
« Last Edit: March 23, 2018, 12:56:15 PM by ManishSahu »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14003
    • View Profile
Re: Polygon option in Model tab.
« Reply #7 on: March 23, 2018, 02:12:19 PM »
Hello ManishSahu,

I can suggest something like the following:

Code: [Select]
for shape in chunk.shapes:
    if  shape.type != PhotoScan.Shape.Type.Polygon:
        continue
    shape.boundary_type = PhotoScan.Shape.BoundaryType.OuterBoundary
    path =  = "ortho_" + shape.label + ".tif" #if there are unique shape.labels, otherwise you can use str(shape.key)
    chunk.exportOrthomosaic(path, ...)
    shape.boundary_type = PhotoScan.Shape.BoundaryType.NoBoundary
Best regards,
Alexey Pasumansky,
Agisoft LLC

ManishSahu

  • Newbie
  • *
  • Posts: 27
    • View Profile
Re: Polygon option in Model tab.
« Reply #8 on: March 23, 2018, 04:25:46 PM »
Thanks. Worked very well.

Magda

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Polygon option in Model tab.
« Reply #9 on: March 25, 2020, 01:46:34 PM »
Hello ManishSahu,

You can draw polygon shape in Model or Ortho view mode.

If you wish to export the DEM/Orthomosaic only inside the area defined by the polygon (or polygons) you need to switch to the Ortho view mode, select the desired shape, right click on it and choose Set Boundary -> Outer Boundary option. Boundaries would be automatically applied to DEM/Orthomosaic export.

Is this option still available in Metashape 1.6.2?
I can't find a way to trim DEM/Orthomosaic :(
« Last Edit: March 25, 2020, 01:50:30 PM by Magda »

Magda

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Polygon option in Model tab.
« Reply #10 on: March 25, 2020, 01:53:24 PM »
All sorted! My fault, it works exactly as it was described :)

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14003
    • View Profile
Re: Polygon option in Model tab.
« Reply #11 on: March 25, 2020, 08:36:47 PM »
Yes, boundary type selection currently is available only from the Ortho view mode.
Best regards,
Alexey Pasumansky,
Agisoft LLC