SpatialWithin

globalmapper.SpatialWithin(GM_LayerHandle_t32 aLayer1, GM_LayerHandle_t32 aLayer2, GM_SpatialOps_Params_t aParams) GM_Error_t32[source]

The Within predicate returns the set of features from one layer that are wholly contained by a feature from another layer. A feature is within another feature if the interiors of the features intersect, but the interior of the within feature does not intersect the boundary of the containing feature. The two features can share some boundary.

Parameters:
  • aLayer1 (GM_LayerHandle_t32) – First layer in predicate

  • aLayer2 (GM_LayerHandle_t32) – Second layer in predicate

  • aParams (GM_SpatialOps_Params_t) – Parameters

Returns:

Error Code

Return type:

GM_Error_t32


BEFORE

AFTER

../_images/WithinBefore.png ../_images/WithinAfter.png

Example

The following is an example of SpatialWithin.

spatial_params = gm.GM_SpatialOps_Params_t()
spatial_params.mPredicateResultTarget = gm.GM_PredicateResult_CreateNewLayer
spatial_params.mResultLayerName = "Within_Result"
err_SpatialWithin = gm.SpatialWithin(
    layers_list[1], layers_list[0], spatial_params
)