Fork me on GitHub

ST_PolyFromWKB

Signature

GEOMETRY ST_PolyFromWKB(binary wkb);
GEOMETRY ST_PolyFromWKB(binary wkb, INT srid);

Description

Converts the Well Known Binary wkb into a Geometry, optionally with spatial reference id srid. Verifies that wkb does in fact specify a POLYGON.

Implements the OpenGIS Simple Features Implementation Specification for SQL version 1.2.1.

Examples

SELECT ST_PolyFromWKB('000000000300000001000000064048800000000000403e0000000000004049000000000000403c000000000000404a800000000000403c000000000000404a8000000000004040000000000000404900000000000040400000000000004048800000000000403e000000000000');
-- Answer: POLYGON ((49 30, 50 28, 53 28, 53 32, 50 32, 49 30)) 

SELECT ST_PolyFromWKB('0020000003000010e600000001000000050000000000000000000000000000000000000000000000003ff00000000000003ff00000000000003ff00000000000003ff0000000000000000000000000000000000000000000000000000000000000', 2154);
-- Answer: POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))
See also