MI_CentroidWithin - spectrum_spatial - Latest

Spectrum Spatial Guide

Product type
Software
Portfolio
Locate
Product family
Spectrumâ„¢ software
Product
Spectrumâ„¢ software > Spatial > Spectrum Spatial
Version
Latest
ft:locale
en-US
Product name
Spectrum Technology Platform
ft:title
Spectrum Spatial Guide
Copyright
2025
First publish date
2007
ft:lastEdition
2025-03-07
ft:lastPublication
2025-03-07T10:28:48.112000

Description

Determines if the centroid of a geometry object lies within another geometry object.

Syntax

MI_CentroidWithin ( testGeometry, containerGeometry )

Arguments

containerGeometry and testGeometry are geometry objects (or expressions).

Example

Determines if the centroid of the specified geometry lies within the specified countries.

select MI_CentroidWithin([Geometry_Column],MI_Box(-13.36676789,8.05796847,79.06334219,62.70540978,'epsg:4326')) as theResult from countries where country in ('Mauritania','Mali','Algeria')

Remarks

Returns true if the centroid of testGeometry lies within containerGeometry, false otherwise. If either testGeometry or containerGeometry are null, false is returned. The function is performed using the coordinate system of the first argument (testGeometry).

This is synonomous with MI_Contains (containerGeoemtry, testGeometry ).