ST_WKBToSQL — Return a geometric object given its Well-known binary Representation. This is an alias for ST_GeomFromWKB.
geometry ST_WKBToSQL(
varchar WKB, integer
SRID)
;
geometry ST_WKBToSQL(
varchar WKB)
;
The ST_WKBToSQL function takes a geometry binary representation and a Spatial Reference System ID (SRID) and creates an instance of the appropriate Geometry Type. If the SRID is not provided it defaults to -1.
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 |
---|---|---|---|
- | - | - | 5.1.36 |
--Get the WKB SELECT ST_AsBinary(ST_GeomFromText('POINT(5 5)',25830)); st_asbinary -------------------------------------------------------------------------------- \001\001\000\000\000\000\000\000\000\000\000\024@\000\000\000\000\000\000\024@ (1 row) --By setting the value "standard_conforming_strings" to on, we can use exactly the WKB representation SET standard_conforming_strings = On; SELECT ST_WKBToSQL('\001\001\000\000\000\000\000\000\000\000\000\024@\000\000\000\000\000\000\024@');
--Get the WKB SELECT ST_AsBinary(ST_GeomFromText('POINT(5 5)')); 010100000000000000000014400000000000001440 --Return the Geometry SELECT ST_WKBToSQL('010100000000000000000014400000000000001440'); SELECT ST_WKBToSQL('010100000000000000000014400000000000001440',25830);