Understanding and Resolving Metashape Boundary Setting Issues

The process of setting boundaries with polygons in photogrammetry software like Metashape is a fundamental step for isolating specific areas of interest within a 3D model or orthomosaic. However, users often encounter difficulties when attempting to establish these boundaries, which can stem from several procedural or technical factors. This article provides a detailed, step-by-step guide to troubleshooting and successfully setting boundaries with polygons in Metashape, based on established workflows and common user challenges.

Prerequisites for Effective Boundary Setting

Before attempting to set a boundary with a polygon, several foundational elements must be correctly configured within the Metashape project. The software's ability to recognize and process shapes depends on the visibility of certain interface elements and the proper initialization of the project's coordinate system.

First, ensure that the "Show Shapes" function is active. This is a critical toggle within the Metashape interface; if disabled, any imported or drawn polygon will not be visible in the model or Ortho windows, making it impossible to interact with. This function is typically found within the view settings or toolbar and must be enabled to proceed.

Second, the project must have a valid Coordinate Reference System (CRS) established. A CRS is essential for giving spatial meaning to the data. Without it, distances, coordinates, and the positioning of shapes lack real-world context. A valid CRS is particularly important when working with georeferenced data, such as models created from photos containing GPS metadata or Ground Control Points (GCPs). The absence of a proper CRS can lead to ambiguous or incorrect measurements and may prevent shapes from aligning correctly with the 3D model.

Importing and Preparing Polygons

Metashape supports the import of external shape files, which can be a convenient method for using pre-defined boundaries. The software can load a variety of file formats, including SHP, KML, KMZ, DXF, GPKG, GEOJSON, and TXT. To import a shape, navigate to the menu and select File/Import/Import Shapes.

A common issue arises when an imported 2D polygon does not appear in the 3D model space. This occurs because the shape lacks Z (elevation) coordinates. In such cases, the shape will typically appear in the "Ortho" window instead. To resolve this and integrate the 2D polygon into the 3D model, it can be converted into a 3D shape. This is achieved by right-clicking on the shape within the Ortho window and selecting the "Update Altitudes" function. This tool assigns elevation data from the Digital Elevation Model (DEM) to the polygon's breakpoints, effectively lifting it to match the 3D surface.

Alternatively, users can draw new polygons directly within Metashape. To do this, the "Draw" window must be opened from the Metashape ribbon. When drawing, various snap solutions are available to ensure precision, including snapping to the axis, vertex, edge, or 2D elements. This is particularly useful for creating accurate boundaries that follow the contours of the model.

The Process of Setting a Boundary with a Polygon

Once a polygon is correctly positioned and visible in the model, the process of setting it as a boundary can begin. This is a multi-step procedure that requires careful attention to detail.

  1. Selection: With the polygon visible, select it by clicking on it with the left mouse button. The polygon should now be highlighted.

  2. Changing the Boundary Type: The critical step that is often missed is changing the polygon's type from a standard shape to an "Outer boundary." This is performed in the Ortho window. Right-click directly on the outer line of the selected polygon. From the context menu that appears, navigate to "Set Boundary Type" and select "Outer boundary."

  3. Visual Confirmation: Once set as an outer boundary, the polygon's outline will change visually. It will appear with a dashed effect, distinguishing it from other geometries and shapes in the project. This visual cue confirms that the shape is now recognized as a boundary.

  4. Applying the Clip During Export: The final and most crucial step is to activate the clipping function during the export process. When exporting any photogrammetry result—such as a dense point cloud, mesh, orthomosaic, or DEM—locate the export dialog. Within this dialog, there is a checkbox labeled "Clip to Boundary Shapes." This box must be ticked for the clipping to be applied. If this option is not selected, the export will ignore the boundary settings, and the entire model area will be exported. It is important to note that this checkbox applies to all photogrammetry result files, providing a consistent method for clipping across different data types.

Troubleshooting Common Issues

If the boundary setting process fails, several common issues should be investigated:

  • Shape Not Visible: As mentioned, verify that "Show Shapes" is enabled. Additionally, check if the shape was imported into the correct model or chunk within the project.
  • Polygon Not Recognized as a Boundary: Ensure that the "Set Boundary Type/Outer boundary" step was completed correctly. Simply selecting the polygon is not sufficient; it must be explicitly designated as a boundary.
  • Clip Not Applied During Export: The most frequent error is forgetting to tick the "Clip to Boundary Shapes" checkbox in the export dialog. This is a separate step from setting the boundary and must be activated at the time of export.
  • Coordinate Mismatch: If the shape and model do not align, there may be a discrepancy in the CRS. Ensure both the imported shape file and the Metashape project are using the same, correctly defined coordinate system.

Alternative Method: Automatic Filtering of Model Elements

In some cases, the need for a manual polygon boundary arises from unwanted elements in the model, such as small, disconnected surfaces or "noise." Metashape offers an automated tool for cleaning such elements, which can sometimes negate the need for a manual clipping polygon.

This tool can be accessed by clicking on the "Model" menu and selecting "Gradual Selection." Within the "Criterion" drop-down menu, choose "Connected component size." Metashape will analyze the 3D model and prompt the user to enter a value between 0-100%. This value represents a percentage threshold; components smaller than this threshold will be selected. A recommended setting is 99%, which typically selects only the least connected, outlier parts of the model. After the selection is made, these parts can be easily deleted, resulting in a cleaned 3D model without the need for a manual clipping boundary.

Conclusion

Successfully setting a boundary with a polygon in Metashape requires a methodical approach, beginning with proper project setup and ending with the correct application during export. Key steps include ensuring shape visibility, establishing a valid coordinate system, correctly converting 2D shapes to 3D if necessary, explicitly designating the polygon as an outer boundary, and finally, activating the clip function in the export settings. For users dealing with extraneous model elements, the automated gradual selection tool offers a powerful alternative for model cleaning. By understanding and following these procedures, users can efficiently isolate and process specific areas of their photogrammetry data, leading to more precise and focused results.

Sources

  1. Unknown but very useful photogrammetry operations in Metashape
  2. Unknown very useful photogrammetry operations in Metashape
  3. Geo-SfM: Geomodelling Tutorial

Related Posts