All Products
Search
Document Center

PolarDB:ST_TextureFromText

Last Updated:Mar 28, 2026

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

Syntax

texture ST_TextureFromText(text text);

Parameters

ParameterDescription
textThe WKT representation of the texture object.

Description

ST_TextureFromText constructs a texture object from its WKT representation. For more information, see ST_MakeTexture.

Examples

The following example creates a texture with ST_MakeTexture, converts it to WKT with ST_AsText, then reconstructs the texture object using ST_TextureFromText, and converts the result back to WKT to verify the roundtrip.

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"}