Name

ST_PolyFromWKB — Returns a LineString object given its Well-known text Representation

Synopsis

geometry ST_PolygonFromWKB(bytea WKB);

geometry ST_PolygonFromWKB(bytea WKB, integer SRID);

Alias

PolyFromWKB, ST_PolygonFromWKB, PolygonFromWKB

Description

Creates a Polygon from well-known binary representation of a Polygon and a Spatial Reference System ID (SRID). If the SRID is not provides it defaults to -1. If WKB passed in is not a POLYGON, NULL is returned.

Coordinate Dimensions
2D3DM
Spatial Standards Support
OGC SFS for SQL. 1.1 (1999)OGC SFS for SQL. 1.1.0 (2005)OGC SFS for SQL. 1.2.0 (2006)SQL-MM Part 3
3.2.7.27.2.7.1-8.3.7

Examples

SELECT ST_PolygonFromWKB(ST_GeomFromText('POLYGON ((20 20, 50 20, 50 50, 20 50, 20 20))'));
--Result
\001\003\000\000\000\001\000\000\000\005\000\000\000\000\000\000\ ...

--With SRID
SELECT ST_PolygonFromWKB(ST_GeomFromText('POLYGON ((20 20, 50 20, 50 50, 20 50, 20 20))'),25830);

Related functions

ST_GeomFromWKB