st_intersection 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 l'intersezione del set di punti dei due valori di input GEOMETRY come valore 2D GEOMETRY .

Syntax

st_intersection ( geoExpr1, geoExpr2 )

Arguments

  • geoExpr1: Il primo GEOMETRY valore.
  • geoExpr2: Il secondo GEOMETRY valore.

Returns

Valore di tipo GEOMETRY, che rappresenta l'intersezione del set di punti delle due geometrie di input.

Lo SRID del valore restituito GEOMETRY è lo SRID comune delle geometrie di input.

La funzione restituisce NULL se uno degli input è NULL.

Condizioni di errore

Examples

-- Returns the intersection of a multipoint and a polygon.
> SELECT st_astext(st_intersection(st_geomfromtext('MULTIPOINT(EMPTY,4 3,5 6,-1 8)'),st_geomfromtext('POLYGON((0 0,10 0,0 10,0 0))')));
  POINT(4 3)
-- Returns the intersection of two overlapping polygons.
> SELECT st_astext(st_intersection(st_geomfromtext('POLYGON((0 0,10 0,10 10,0 10,0 0))'),st_geomfromtext('POLYGON((5 5,15 5,15 15,5 15,5 5))')));
  POLYGON((5 5,10 5,10 10,5 10,5 5))