Skip to content

ST_Touches

Returns true if A touches B.

Usage

boolean ST_Touches(geomA: geometry, geomB: geometry)

Arguments

  • geomA (geometry): Input geometry
  • geomB (geometry): Input geometry

Description

Returns true if the two geometries have at least one boundary point in common but no interior points in common.

Examples

SELECT ST_Touches(
    ST_GeomFromText('POINT(1 2)'),
    ST_GeomFromText('POLYGON((1 1, 1 4, 4 4, 4 1, 1 1))')
);
┌──────────────────────────────────────────────────────────────────────────────┐
│ st_touches(st_geomfromtext(Utf8("POINT(1 2)")),st_geomfromtext(Utf8("POLYGON │
│                       ((1 1, 1 4, 4 4, 4 1, 1 1))")))…                       │
╞══════════════════════════════════════════════════════════════════════════════╡
│ true                                                                         │
└──────────────────────────────────────────────────────────────────────────────┘