Documentation Home
MySQL 5.6 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 31.4Mb
PDF (A4) - 31.5Mb
PDF (RPM) - 29.8Mb
HTML Download (TGZ) - 7.5Mb
HTML Download (Zip) - 7.5Mb
HTML Download (RPM) - 6.5Mb
Man Pages (TGZ) - 177.2Kb
Man Pages (Zip) - 287.6Kb
Info (Gzip) - 3.0Mb
Info (Zip) - 3.0Mb
Excerpts from this Manual

MySQL 5.6 Reference Manual  /  ...  /  MySQL-Specific Functions That Create Geometry Values

12.16.5 MySQL-Specific Functions That Create Geometry Values

MySQL provides a set of useful nonstandard functions for creating geometry values. The functions described in this section are MySQL extensions to the OpenGIS specification.

These functions produce geometry objects from either WKB values or geometry objects as arguments. If any argument is not a proper WKB or geometry representation of the proper object type, the return value is NULL.

For example, you can insert the geometry return value from Point() directly into a POINT column:

INSERT INTO t1 (pt_col) VALUES(Point(1,2));
  • GeometryCollection(g [, g] ...)

    Constructs a GeometryCollection value from the geometry arguments.

    If an argument contains a nonsupported geometry, the return value is NULL.

  • LineString(pt [, pt] ...)

    Constructs a LineString value from a number of Point or WKB Point arguments. If the number of arguments is less than two, the return value is NULL.

  • MultiLineString(ls [, ls] ...)

    Constructs a MultiLineString value using LineString or WKB LineString arguments.

  • MultiPoint(pt [, pt2] ...)

    Constructs a MultiPoint value using Point or WKB Point arguments.

  • MultiPolygon(poly [, poly] ...)

    Constructs a MultiPolygon value from a set of Polygon or WKB Polygon arguments.

  • Point(x, y)

    Constructs a Point using its coordinates.

  • Polygon(ls [, ls] ...)

    Constructs a Polygon value from a number of LineString or WKB LineString arguments. If any argument does not represent a LinearRing (that is, not a closed and simple LineString), the return value is NULL.


User Comments
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
Sign Up Login You must be logged in to post a comment.