Compresses a pcpatch object using the specified compression method.
Syntax
pcpatch ST_compress(pcpatch pc, text global_compression_schema default '', text compression_config default '');Parameters
| Parameter | Description |
|---|---|
pc | The pcpatch object to compress. |
global_compression_schema | The compression method to apply. Defaults to an empty string. For valid values, see Compression schemas. |
compression_config | The per-dimension compression algorithm. Applies only when global_compression_schema is set to dimension. Defaults to an empty string. |
Compression schemas
The global_compression_schema parameter accepts the following values:
auto— determines the compression method based on thepcid.dimension— applies per-dimension compression. When using this schema, setcompression_configto one of the following algorithms:auto— selects the algorithm automatically based on value statistics.zlib— deflate compression.sigbits— significant bits removal.rle— run-length encoding.
laz— no compression config supported.ght— is discarded.
Examples
The following example compresses a patch created from three points and returns the result as text.
SELECT ST_asText(ST_Compress(ST_MakePatch(1, ARRAY[-126.99,45.01,1,0, -126.98,45.02,2,0, -126.97,45.03,3,0])));Output:
{"pcid":1,"pts":[
[-126.99,45.01,1,0],[-126.98,45.02,2,0],[-126.97,45.03,3,0]
]}该文章对您有帮助吗?