Name

ST_XSize — Returns the X size of a 2D or 3D bounding box or a geometry.

Synopsis

float ST_XSize(box3d aGeomorBox2DorBox3D);

Beschreibung

Returns the X size of a 2D or 3D bounding box or a geometry, computed as ST_XMax(aGeomorBox2DorBox3D) - ST_XMin(aGeomorBox2DorBox3D).

[Note]

Obwohl diese Funktion nur für box3d definiert ist, funktioniert sie aufgrund des automatischen Castings auch für box2d- und Geometriewerte. Sie akzeptiert jedoch keine Geometrie- oder box2d-Textdarstellung, da diese nicht automatisch gecastet werden.

Diese Funktion unterstützt 3d und lässt den Z-Index nicht fallen.

Diese Methode unterstützt kreisförmige Strings und Kurven.

Availability: 3.7.0

Beispiele

SELECT ST_XSize('BOX3D(1 2 3, 4 5 6)');
st_xsize
--------
3

SELECT ST_XSize(ST_GeomFromText('LINESTRING(1 3, 5 6)'));
st_xsize
--------
4