Name

ST_AsEWKT — 返回具有SRID元数据的几何图形的知名文本(WKT)表示。

Synopsis

text ST_AsEWKT(geometry g1);

text ST_AsEWKT(geometry g1, integer maxdecimaldigits=15);

text ST_AsEWKT(geography g1);

text ST_AsEWKT(geography g1, integer maxdecimaldigits=15);

描述

返回以SRID为前缀的几何图形的知名文本表示形式。可选的 最大小数位数 参数可用于减少输出中浮点后使用的最大小数位数(默认为15)。

要执行从EWKT制图表达到PostGIS几何的逆转换,请使用 ST_GeomFromEWKT

[Warning]

使用 最大小数位数 参数可能会导致输出几何图形无效。为了避免这种使用 ST_ReducePrecision 首先要有一个合适的网格大小。

[Note]

WKT规范不包括SRID。要获取OGC WKT格式,请使用 ST_AsText

[Warning]

WKT格式不能保持精度,因此为了防止浮动截断,请使用 ST_AsBinaryST_AsEWKB 传输格式。

增强:3.1.0支持可选精度参数。

增强:2.0.0引入了对地理、多面体曲面、三角形和三角网的支持。

This function supports 3d and will not drop the z-index.

This method supports Circular Strings and Curves

This function supports Polyhedral surfaces.

This function supports Triangles and Triangulated Irregular Network Surfaces (TIN).

示例

SELECT ST_AsEWKT('0103000020E61000000100000005000000000000
                        000000000000000000000000000000000000000000000000000000
                        F03F000000000000F03F000000000000F03F000000000000F03
                        F000000000000000000000000000000000000000000000000'::geometry);

                   st_asewkt
--------------------------------
SRID=4326;POLYGON((0 0,0 1,1 1,1 0,0 0))
(1 row)

SELECT ST_AsEWKT('0108000080030000000000000060E30A4100000000785C0241000000000000F03F0000000018
E20A4100000000485F024100000000000000400000000018
E20A4100000000305C02410000000000000840')

--st_asewkt---
CIRCULARSTRING(220268 150415 1,220227 150505 2,220227 150406 3)

另请参阅

ST_AsBinary, ST_AsEWKB, ST_AsText, ST_GeomFromEWKT