ST_TextureFromText

更新时间:
复制 MD 格式

Constructs a texture object from its well-known text (WKT) representation.

Syntax

texture ST_TextureFromText(text text)

Parameters

ParameterDescription
textThe WKT representation of a texture object.

Description

ST_TextureFromText is the inverse of ST_AsText: it parses a WKT string and returns the corresponding texture object. To construct a texture object from raw attributes, use ST_MakeTexture instead.

Examples

The following example converts a texture object to its WKT representation with ST_AsText, then reconstructs the texture object from that WKT string with ST_TextureFromText.

SELECT ST_AsText(ST_TextureFromText(ST_AsText(ST_MakeTexture(256,256, '123456'::bytea))));

Output:

{"compressionType" : "None", "format" : "JPEG", "wrap" : "Wrap", "type" : "Raw", "depth" : 3, "width" : 256, "height" : 256, "size" : 6, "data" : "313233343536"}