Geometry values stored in a table can be fetched in internal format. You can also convert them to WKT or WKB format.存储在表中的几何图形值可以以内部格式提取。您也可以将它们转换为WKT或WKB格式。
Fetching spatial data in internal format:获取内部格式的空间数据:
Fetching geometry values using internal format can be useful in table-to-table transfers:使用内部格式获取几何图形值在表到表的传输中非常有用:
CREATE TABLE geom2 (g GEOMETRY) SELECT g FROM geom;
Fetching spatial data in WKT format:获取WKT格式的空间数据:
The ST_AsText()
function converts a geometry from internal format to a WKT string.ST_AsText()
函数用于将几何图形从内部格式转换为WKT字符串。
SELECT ST_AsText(g) FROM geom;
Fetching spatial data in WKB format:获取WKB格式的空间数据:
The ST_AsBinary()
function converts a geometry from internal format to a BLOB
containing the WKB value.ST_AsBinary()
函数将几何图形从内部格式转换为包含WKB值的BLOB
。
SELECT ST_AsBinary(g) FROM geom;