SpatialMBR ========== .. currentmodule:: globalmapper .. py:function:: SpatialMBR (GM_LayerHandle_t32 aLayer, GM_SpatialOps_Params_t aParams, GM_FeatureGrouping_t8 aGrouping, str aStr) -> GM_Error_t32 The **MBR (Minimum Bounding Rectangle)** spatial transform creates a new layer with the smallest axis-aligned bounding box that contains the features from *aLayer*. The parameter *aGrouping* can be used to specify whether to make MBRs for each feature, each feature group, or one for the entire layer. :param GM_LayerHandle_t32 aLayer: Input layer :param GM_SpatialOps_Params_t aParams: Parameters :param GM_FeatureGrouping_t8 aGrouping: Grouping type :param str aStr: The attribute list string; may be an empty string :returns: Error Code :rtype: GM_Error_t32 | .. list-table:: :width: 100% :class: borderless :header-rows: 1 * - BEFORE - AFTER * - .. image:: ../images/SpatialAnalysis_Images/multShapes.png :width: 151px :height: 150px :align: center - .. image:: ../images/SpatialAnalysis_Images/MBRAfter.png :width: 153px :height: 150px :align: center | Example ------- The following is an example of SpatialMBR. .. literalinclude:: ../../sample_tests/sample_code/SpatialMBR_sample.py :language: python