ST_Normalize

更新时间:
复制 MD 格式

Returns the normalized form of a geometry object.

Syntax

geometry ST_Normalize(geometry geom);

Parameters

ParameterDescription
geomThe input geometry object.

Description

ST_Normalize may reorder the following components of the input geometry to produce its canonical form:

  • Vertices of rings in a polygon object

  • Rings within a polygon object

  • Elements in a MULTI geometry object

Examples

Normalize a LINESTRING to put coordinates in canonical order:

SELECT ST_AsText(ST_Normalize(ST_GeomFromText('LINESTRING(2 1,1 1)')));

Output:

      st_astext
---------------------
 LINESTRING(1 1,2 1)
(1 row)