Freigeben über


st_translate-Funktion

Gilt für:check marked yes Databricks SQL check marked yes Databricks Runtime 17.1 and above

Important

Dieses Feature befindet sich in der Public Preview.

Hinweis

Dieses Feature ist in Databricks SQL Classic Warehouses nicht verfügbar. Weitere Informationen zu Databricks SQL Warehouses finden Sie unter SQL Warehouse-Typen.

Übersetzt den Eingabewert GEOMETRY in den Richtungen X, Y und, falls angegeben, Z mithilfe der bereitgestellten Offsets.

Syntax

st_translate ( geoExpr, xfactor, yfactor[, zfactor] )

Arguments

  • geoExpr: Ein GEOMETRY Wert.
  • xfactor: Ein DOUBLE Wert, der den Offset in X-Richtung darstellt.
  • yfactor: Ein DOUBLE Wert, der den Offset in Y-Richtung darstellt.
  • zfactor: Ein DOUBLE Wert, der den Offset in Z-Richtung (optional) darstellt. Standard ist "0".

Returns

Ein Wert vom Typ GEOMETRY, der die übersetzte Geometrie darstellt.

Der SRID-Wert des Ausgabewerts GEOMETRY entspricht dem des Eingabewerts.

Die Dimension des Ausgabewerts GEOMETRY entspricht dem des Eingabewerts.

Die Funktion gibt zurück NULL , wenn eine der Eingaben lautet NULL.

Examples

-- Translates a point by 10 in the X direction and 20 in the Y direction.
> SELECT st_astext(_FUNC_(st_geomfromtext('MULTIPOINT ZM (1 2 3 -4,5 6 7 -8,EMPTY)'), 10.0, 20.0));
  MULTIPOINT ZM ((11 22 3 -4),(15 26 7 -8),EMPTY)
-- Translates a point by 10 in the X direction, 20 in the Y direction, and 3 in the Z direction.
> SELECT st_astext(_FUNC_(st_geomfromtext('MULTIPOINT ZM (1 2 3 -4,5 6 7 -8,EMPTY)'), 10.0, 20.0, 30.0));
  MULTIPOINT ZM ((11 22 33 -4),(15 26 37 -8),EMPTY)