ST_PolyFromWKB()

ST_PolyFromWKB creates a POLYGON geometry from WKB.

Syntax

ST_PolyFromWKB(wkb)

Aliases: ST_PolygonFromWKB().

Arguments

Argument

Description

wkb

VARCHAR, BLOB, or VARBINARY WKB.

Return Value

Returns a GEOMETRY value.

Usage Notes

Only POLYGON input is accepted; a different geometry kind is rejected. Source evidence: test/distributed/cases/geo/geo_constructors.sql.

Examples

DROP DATABASE IF EXISTS geo_io_example;
CREATE DATABASE geo_io_example;
USE geo_io_example;

SELECT ST_AsText(ST_PolyFromWKB(ST_AsWKB(ST_GeomFromText('POLYGON((0 0,2 0,2 2,0 0))')))) AS polygon;

DROP DATABASE geo_io_example;

See Also

ST_PolyFromText(), ST_AsWKB().