Condividi tramite


STTouches (tipo di dati geometry)

Restituisce 1 se un'istanza geometry tocca a livello spaziale un'altra istanza geometry. In caso contrario, restituisce 0.

Sintassi

.STTouches ( other_geometry )

Argomenti

  • other_geometry
    Altra istanza geometry da confrontare con l'istanza sulla quale STTouches() viene richiamato.

Tipi restituiti

Tipo SQL Server restituito: bit

Tipo CLR restituito: SqlBoolean

Osservazioni

Due istanze geometry si toccano se si intersecano i relativi set di punti, ma non le parti interne.

Questo metodo restituisce sempre Null se gli identificatori SRID delle istanze geometry non corrispondono.

Esempi

Nell'esempio seguente viene utilizzato STTouches() per verificare se due istanze geometry si toccano.

DECLARE @g geometry;
DECLARE @h geometry;
SET @g = geometry::STGeomFromText('LINESTRING(0 2, 2 0, 4 2)', 0);
SET @h = geometry::STGeomFromText('POINT(1 1)', 0);
SELECT @g.STTouches(@h);