SpatialMBR

globalmapper.SpatialMBR(GM_LayerHandle_t32 aLayer, GM_SpatialOps_Params_t aParams, GM_FeatureGrouping_t8 aGrouping, str aStr) GM_Error_t32[source]

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.

Parameters:
  • aLayer (GM_LayerHandle_t32) – Input layer

  • aParams (GM_SpatialOps_Params_t) – Parameters

  • aGrouping (GM_FeatureGrouping_t8) – Grouping type

  • aStr (str) – The attribute list string; may be an empty string

Returns:

Error Code

Return type:

GM_Error_t32


BEFORE

AFTER

../_images/multShapes.png ../_images/MBRAfter.png

Example

The following is an example of SpatialMBR.

spatial_params = gm.GM_SpatialOps_Params_t()
spatial_params.mResultLayerName = "MBR_Result"
err_SpatialMBR = gm.SpatialMBR(
    layers_list[0], spatial_params, gm.GM_GroupingNone, ""
)