st_dwithin Funzione

Si applica a:spuntato sì Databricks SQL contrassegnato sì Databricks Runtime 17.1 e superiori spuntati spuntati sì Lakehouse//RT

Annotazioni

Questa funzionalità non è disponibile in Databricks SQL Classic Warehouses. Per altre informazioni sui databricks SQL Warehouse, vedere Tipi di SQL Warehouse.

Restituisce true se la distanza cartesiana 2D tra i due valori di input GEOMETRY è minore o uguale al valore della distanza di input.

Syntax

st_dwithin ( geoExpr1, geoExpr2, distanceExpr )

Arguments

  • geoExpr1: Il primo GEOMETRY valore.
  • geoExpr2: Il secondo GEOMETRY valore.
  • distanceExpr: Il valore della soglia di distanza.

Returns

Valore di tipo BOOLEAN, che indica se la distanza dei due valori di input GEOMETRY è minore o uguale al valore di distanceExpr.

Le unità della soglia di distanza sono quelle delle coordinate delle geometrie di input.

La funzione restituisce NULL se uno degli input è NULL.

Condizioni di errore

Examples

-- Returns true as the distance between the point and linestring is within the threshold.
> SELECT st_dwithin(st_geomfromtext('POINT Z (0 0 300)'),st_geomfromtext('LINESTRING(-10 10,20 10)'), 10.0);
  true
-- Returns false as the distance between the geometries exceeds the threshold.
> SELECT st_dwithin(st_geomfromtext('POINT(0 0)'),st_geomfromtext('POINT(20 20)'), 10.0);
  false