ST_AsBinary(g) AsBinary(g) ST_AsWKB(g) AsWKB(g)
Converts a value in internal geometry format to its WKB representation and returns the binary result.
ST_AsBinary(), AsBinary(), ST_AsWKB() and AsWKB() are synonyms,
SET @poly = ST_GeomFromText('POLYGON((0 0,0 1,1 1,1 0,0 0))');
SELECT ST_AsBinary(@poly);
SELECT ST_AsText(ST_GeomFromWKB(ST_AsWKB(@poly)));
+--------------------------------------------+
| ST_AsText(ST_GeomFromWKB(ST_AsWKB(@poly))) |
+--------------------------------------------+
| POLYGON((0 0,0 1,1 1,1 0,0 0)) |
+--------------------------------------------+
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/asbinary/