Documentation Home
MySQL 5.6 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 31.4Mb
PDF (A4) - 31.5Mb
PDF (RPM) - 30.0Mb
EPUB - 7.7Mb
HTML Download (TGZ) - 7.5Mb
HTML Download (Zip) - 7.5Mb
HTML Download (RPM) - 6.5Mb
Eclipse Doc Plugin (TGZ) - 8.2Mb
Eclipse Doc Plugin (Zip) - 10.1Mb
Man Pages (TGZ) - 181.2Kb
Man Pages (Zip) - 292.4Kb
Info (Gzip) - 2.8Mb
Info (Zip) - 2.8Mb
Excerpts from this Manual

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

12.15.7.1 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)

    ST_Dimension() and Dimension() are synonyms. For more information, see the description of ST_Dimension().

  • Envelope(g)

    ST_Envelope() and Envelope() are synonyms. For more information, see the description of ST_Envelope().

  • GeometryType(g)

    ST_GeometryType() and GeometryType() are synonyms. For more information, see the description of ST_GeometryType().

  • IsEmpty(g)

    ST_IsEmpty() and IsEmpty() are synonyms. For more information, see the description of ST_IsEmpty().

  • IsSimple(g)

    ST_IsSimple() and IsSimple() are synonyms. For more information, see the description of ST_IsSimple().

    Prior to MySQL 5.6.1, IsSimple() always returns 0.

  • SRID(g)

    ST_SRID() and SRID() are synonyms. For more information, see the description of ST_SRID().

  • ST_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 11.5.2.2, “Geometry Class”.

    mysql> SELECT ST_Dimension(ST_GeomFromText('LineString(1 1,2 2)'));
    +------------------------------------------------------+
    | ST_Dimension(ST_GeomFromText('LineString(1 1,2 2)')) |
    +------------------------------------------------------+
    |                                                    1 |
    +------------------------------------------------------+
    

    ST_Dimension() and Dimension() are synonyms.

    ST_Dimension() was added in MySQL 5.6.1.

  • ST_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:

    POLYGON((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX MINY))
    
    mysql> SELECT ST_AsText(ST_Envelope(ST_GeomFromText('LineString(1 1,2 2)')));
    +----------------------------------------------------------------+
    | ST_AsText(ST_Envelope(ST_GeomFromText('LineString(1 1,2 2)'))) |
    +----------------------------------------------------------------+
    | POLYGON((1 1,2 1,2 2,1 2,1 1))                                 |
    +----------------------------------------------------------------+
    

    ST_Envelope() and Envelope() are synonyms.

    ST_Envelope() was added in MySQL 5.6.1.

  • ST_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 ST_GeometryType(ST_GeomFromText('POINT(1 1)'));
    +------------------------------------------------+
    | ST_GeometryType(ST_GeomFromText('POINT(1 1)')) |
    +------------------------------------------------+
    | POINT                                          |
    +------------------------------------------------+
    

    ST_GeometryType() and GeometryType() are synonyms.

    ST_GeometryType() was added in MySQL 5.6.1.

  • ST_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.

    ST_IsEmpty() and IsEmpty() are synonyms.

    ST_IsEmpty() was added in MySQL 5.6.1.

  • ST_IsSimple(g)

    Returns 1 if the geometry value g has no anomalous geometric points, such as self-intersection or self-tangency. ST_IsSimple() returns 0 if the argument is not simple, and NULL if it is NULL.

    The description of each instantiable geometric class given earlier in the chapter includes the specific conditions that cause an instance of that class to be classified as not simple. (See Section 11.5.2.1, “The Geometry Class Hierarchy”.)

    ST_IsSimple() and IsSimple() are synonyms.

    ST_IsSimple() was added in MySQL 5.6.1.

  • ST_SRID(g)

    Returns an integer indicating the Spatial Reference System ID for the geometry value g.

    In MySQL, the SRID value is just an integer associated with the geometry value. All calculations are done assuming Euclidean (planar) geometry.

    mysql> SELECT ST_SRID(ST_GeomFromText('LineString(1 1,2 2)',101));
    +-----------------------------------------------------+
    | ST_SRID(ST_GeomFromText('LineString(1 1,2 2)',101)) |
    +-----------------------------------------------------+
    |                                                 101 |
    +-----------------------------------------------------+
    

    ST_SRID() and SRID() are synonyms.

    ST_SRID() was added in MySQL 5.6.1.


User Comments
Sign Up Login You must be logged in to post a comment.