No cache version.

Caching disabled. Default setting for this page:enabled (code DEF204)
If the display is too slow, you can disable the user mode to view the cached version.

Rechercher dans le manuel MySQL

12.16.7.5 GeometryCollection Property Functions

These functions return properties of GeometryCollection values.

Unless otherwise specified, functions in this section handle their arguments as follows:

  • If any argument is NULL or any geometry argument is an empty geometry, the return value is NULL.

  • If any geometry argument is not a syntactically well-formed geometry, an ER_GIS_INVALID_DATA error occurs.

  • If any geometry argument has an SRID value that refers to an undefined spatial reference system (SRS), an ER_SRS_NOT_FOUND error occurs.

  • Otherwise, the return value is non-NULL.

These functions are available for obtaining geometry collection properties:

  • ST_GeometryN(gc, N)

    Returns the N-th geometry in the GeometryCollection value gc. Geometries are numbered beginning with 1.

    ST_GeometryN() handles its arguments as described in the introduction to this section.

    1. mysql> SET @gc = 'GeometryCollection(Point(1 1),LineString(2 2, 3 3))';
    2. mysql> SELECT ST_AsText(ST_GeometryN(ST_GeomFromText(@gc),1));
    3. +-------------------------------------------------+
    4. | ST_AsText(ST_GeometryN(ST_GeomFromText(@gc),1)) |
    5. +-------------------------------------------------+
    6. | POINT(1 1)                                      |
    7. +-------------------------------------------------+
  • ST_NumGeometries(gc)

    Returns the number of geometries in the GeometryCollection value gc.

    ST_NumGeometries() handles its arguments as described in the introduction to this section.

    1. mysql> SET @gc = 'GeometryCollection(Point(1 1),LineString(2 2, 3 3))';
    2. mysql> SELECT ST_NumGeometries(ST_GeomFromText(@gc));
    3. +----------------------------------------+
    4. | ST_NumGeometries(ST_GeomFromText(@gc)) |
    5. +----------------------------------------+
    6. |                                      2 |
    7. +----------------------------------------+

Find a PHP function

Document created the 26/06/2006, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/mysql-rf-gis-geometrycollection-property-functions.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.

References

  1. View the html document Language of the document:en Manuel MySQL : https://dev.mysql.com/

These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.

Contents Haut