Documentation Home
MySQL 5.5 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 27.2Mb
PDF (A4) - 27.2Mb
PDF (RPM) - 25.8Mb
HTML Download (TGZ) - 6.5Mb
HTML Download (Zip) - 6.6Mb
HTML Download (RPM) - 5.6Mb
Man Pages (TGZ) - 158.6Kb
Man Pages (Zip) - 262.1Kb
Info (Gzip) - 2.6Mb
Info (Zip) - 2.6Mb
Excerpts from this Manual

MySQL 5.5 Reference Manual  /  ...  /  General Geometry Property Functions General Geometry Property Functions

The functions listed in this section do not restrict their argument and accept a geometry value of any type.

  • Dimension(g)

    Returns the inherent dimension of the geometry value g. The result can be −1, 0, 1, or 2. The meaning of these values is given in Section, “Geometry Class”.

    mysql> SELECT Dimension(GeomFromText('LineString(1 1,2 2)'));
    | Dimension(GeomFromText('LineString(1 1,2 2)')) |
    |                                              1 |
  • Envelope(g)

    Returns the minimum bounding rectangle (MBR) for the geometry value g. The result is returned as a Polygon value that is defined by the corner points of the bounding box:

    mysql> SELECT AsText(Envelope(GeomFromText('LineString(1 1,2 2)')));
    | AsText(Envelope(GeomFromText('LineString(1 1,2 2)'))) |
    | POLYGON((1 1,2 1,2 2,1 2,1 1))                        |
  • GeometryType(g)

    Returns a binary string indicating the name of the geometry type of which the geometry instance g is a member. The name corresponds to one of the instantiable Geometry subclasses.

    mysql> SELECT GeometryType(GeomFromText('POINT(1 1)'));
    | GeometryType(GeomFromText('POINT(1 1)')) |
    | POINT                                    |
  • IsEmpty(g)

    This function is a placeholder that returns 0 for any valid geometry value, 1 for any invalid geometry value or NULL.

    MySQL does not support GIS EMPTY values such as POINT EMPTY.

  • IsSimple(g)

    In MySQL 5.5, this function is a placeholder that always returns 0.

    The descriptions of the instantiable geometric classes given under Section 11.5.2, “The OpenGIS Geometry Model” includes the specific conditions that cause class instances to be classified as not simple.

  • SRID(g)

    Returns an integer indicating the spatial reference system ID associated with the geometry value g.

    mysql> SELECT SRID(GeomFromText('LineString(1 1,2 2)',101));
    | SRID(GeomFromText('LineString(1 1,2 2)',101)) |
    |                                           101 |

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.