ST_GeomFromWKB()

ST_GeomFromWKB creates a geometry from Well-Known Binary (WKB).

Syntax

ST_GeomFromWKB(wkb)

Aliases: ST_GeomFromBinary(), ST_GeometryFromWKB().

Arguments

Argument

Description

wkb

VARCHAR, BLOB, or VARBINARY WKB.

Return Value

Returns a GEOMETRY value.

Usage Notes

The test suite verifies WKB round trips for POINT, LINESTRING, and POLYGON. Source evidence: test/distributed/cases/geo/geo_io.sql and 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_GeomFromWKB(ST_AsWKB(ST_GeomFromText('LINESTRING(0 0,1 1)')))) AS wkt;

DROP DATABASE geo_io_example;

See Also

ST_AsWKB(), ST_GeomFromText().