ST_PolyFromWKB — Returns a LineString object given its Well-known text Representation
geometry ST_PolygonFromWKB(bytea WKB);
geometry ST_PolygonFromWKB(bytea WKB, integer
SRID);
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.
| 2D | 3D | M |
|---|---|---|
![]() | ![]() | ![]() |
| 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.2 | 7.2.7.1 | - | 8.3.7 |
SELECT ST_PolygonFromWKB(ST_GeomFromText('POLYGON ((20 20, 50 20, 50 50, 20 50, 20 20))'));
--Result PostgreSQL
\011 \000\003\001\000\000\000\005\000\000\000\000\000\000\000\000\0004@\000\ ...
--Result H2
0920000301000000050000000000000000003440000000000000344000000000000049 ...
--With SRID
SELECT ST_PolygonFromWKB(ST_GeomFromText('POLYGON ((20 20, 50 20, 50 50, 20 50, 20 20))'),25830);