PDF (A4) - 35.2Mb
Man Pages (TGZ) - 256.4Kb
Man Pages (Zip) - 361.2Kb
Info (Gzip) - 3.4Mb
Info (Zip) - 3.4Mb
MySQL Globalization
MySQL Information Schema
MySQL Installation Guide
MySQL and Linux/Unix
MySQL and macOS
MySQL Partitioning
MySQL Performance Schema
MySQL Replication
Using the MySQL Yum Repository
MySQL Restrictions and Limitations
Security in MySQL
MySQL and Solaris
Building MySQL from Source
Starting and Stopping MySQL
MySQL Tutorial
MySQL and Windows
MySQL NDB Cluster 7.5
MySQL supports the functions listed in this section for converting geometry values from internal geometry format to WKT or WKB format.
There are also functions to convert a string from WKT or WKB format to internal geometry format. SeeSection 12.16.3, “Functions That Create Geometry Values from WKT Values”, andSection 12.16.4, “Functions That Create Geometry Values from WKB Values”.
ST_AsBinary(),ST_AsWKB(),AsBinary(), andAsWKB()are synonyms. For more information, see the description ofST_AsBinary().AsBinary()andAsWKB()are deprecated; expect them to be removed in a future MySQL release. UseST_AsBinary()andST_AsWKB()instead.ST_AsText(),ST_AsWKT(),AsText(), andAsWKT()are synonyms. For more information, see the description ofST_AsText().AsText()andAsWKT()are deprecated; expect them to be removed in a future MySQL release. UseST_AsText()andST_AsWKT()instead.Converts a value in internal geometry format to its WKB representation and returns the binary result.
If the argument is
NULL, the return value isNULL. If the argument is not a syntactically well-formed geometry, anER_GIS_INVALID_DATAerror occurs.SELECT ST_AsBinary(g) FROM geom;ST_AsBinary(),ST_AsWKB(),AsBinary(), andAsWKB()are synonyms.Converts a value in internal geometry format to its WKT representation and returns the string result.
If the argument is
NULL, the return value isNULL. If the argument is not a syntactically well-formed geometry, anER_GIS_INVALID_DATAerror occurs.mysql> SET @g = 'LineString(1 1,2 2,3 3)';mysql> SELECT ST_AsText(ST_GeomFromText(@g));+--------------------------------+| ST_AsText(ST_GeomFromText(@g)) |+--------------------------------+| LINESTRING(1 1,2 2,3 3) |+--------------------------------+ST_AsText(),ST_AsWKT(),AsText(), andAsWKT()are synonyms.Output for
MultiPointvalues includes parentheses around each point. For example:mysql> SET @mp = 'MULTIPOINT(1 1, 2 2, 3 3)';mysql> SELECT ST_AsText(ST_GeomFromText(@mp));+---------------------------------+| ST_AsText(ST_GeomFromText(@mp)) |+---------------------------------+| MULTIPOINT((1 1),(2 2),(3 3)) |+---------------------------------+
PDF (A4) - 35.2Mb
Man Pages (TGZ) - 256.4Kb
Man Pages (Zip) - 361.2Kb
Info (Gzip) - 3.4Mb
Info (Zip) - 3.4Mb
MySQL Globalization
MySQL Information Schema
MySQL Installation Guide
MySQL and Linux/Unix
MySQL and macOS
MySQL Partitioning
MySQL Performance Schema
MySQL Replication
Using the MySQL Yum Repository
MySQL Restrictions and Limitations
Security in MySQL
MySQL and Solaris
Building MySQL from Source
Starting and Stopping MySQL
MySQL Tutorial
MySQL and Windows
MySQL NDB Cluster 7.5