| 19.5.2 Fonction d'analyse des propriétés des formes Geometry
 19.5 Analyser des données géographiques
 19 Données spatiales avec MySQL
 Manuel de Référence MySQL 4.1 : Version Française
 
 . Fonctions générales d'analyse géométrique
 . Fonctions d'analyse des Point
 ->Fonctions d'analyse des lignes LineString
 . Fonctions d'analyse des lignes MultiLineString
 . Fonctions d'analyse des lignes Polygon
 . Fonctions d'analyse des lignes MultiPolygon
 . Fonctions d'analyse des lignes GeometryCollection
 
 
 | 
  19.5.2.3 Fonctions d'analyse des lignes LineString Une ligne  
LineString
  est constituée de  
Point
 . Vous pouvez
extraire des points particuliers d'une ligne  
LineString
 , compter
le nombre de point qu'elle contient, ou encore calculer sa longueur.
 
 
Les spécifications OpenGIS définissent aussi les fonctions suivantes,
que MySQL n'implémente pas encore :
EndPoint(ls)
      Retourne le  
Point
  terminal de la ligne  
LineString
 
ls
 . 
| 
mysql> SELECT AsText(EndPoint(GeomFromText('LineString(1 1,2 2,3 3)')));+------------------------------------------------------------+
 | AsText(EndPoint(GeomFromText('LineString(1 1,2 2,3 3)')))  |
 +------------------------------------------------------------+
 | POINT(3 3)                                                 |
 +------------------------------------------------------------+
 | 
 
GLength(ls)
      Retourne la longueur de la ligne  
ls
  sous forme d'un nombre
à virgule et double précision. 
| 
mysql> SELECT GLength(GeomFromText('LineString(1 1,2 2,3 3)'));+--------------------------------------------------+
 | GLength(GeomFromText('LineString(1 1,2 2,3 3)')) |
 +--------------------------------------------------+
 |                                  2.8284271247462 |
 +--------------------------------------------------+
 | 
 
IsClosed(ls)
      Retourne 1 si  
ls
  est fermée : c'est à dire si 
 
StartPoint()
  et  
EndPoint()
  sont identiques.
Retourne 0 si  
ls
  n'est pas fermée, et -{}1 si l'argument
passé est  
NULL
 . 
| 
mysql> SELECT IsClosed(GeomFromText('LineString(1 1,2 2,3 3)'));+---------------------------------------------------+
 | IsClosed(GeomFromText('LineString(1 1,2 2,3 3)')) |
 +---------------------------------------------------+
 |                                                 0 |
 +---------------------------------------------------+
 | 
 
NumPoints(ls)
      Retourne le nombre de points dans la ligne  
ls
 . 
| 
mysql> SELECT NumPoints(GeomFromText('LineString(1 1,2 2,3 3)'));+----------------------------------------------------+
 | NumPoints(GeomFromText('LineString(1 1,2 2,3 3)')) |
 +----------------------------------------------------+
 |                                                  3 |
 +----------------------------------------------------+
 | 
 
PointN(ls,n)
      Retourne le  
n
 -ième point de la ligne  
ls
 .
La numérotation des points commence à 1. 
| 
mysql> SELECT AsText(PointN(GeomFromText('LineString(1 1,2 2,3 3)'),2));+-----------------------------------------------------------+
 | AsText(PointN(GeomFromText('LineString(1 1,2 2,3 3)'),2)) |
 +-----------------------------------------------------------+
 | POINT(2 2)                                                |
 +-----------------------------------------------------------+
 | 
 
StartPoint(ls)
      Retourne le premier  
Point
  de la ligne  
ls
 . 
| 
mysql> SELECT AsText(StartPoint(GeomFromText('LineString(1 1,2 2,3 3)')));+-------------------------------------------------------------+
 | AsText(StartPoint(GeomFromText('LineString(1 1,2 2,3 3)'))) |
 +-------------------------------------------------------------+
 | POINT(1 1)                                                  |
 +-------------------------------------------------------------+
 | 
 
IsRing(ls)
      Retourne 1 si  
ls
  est un anneau : il faut que  
ls
 
soit fermée (c'est à dire que  
StartPoint()
  et 
 
EndPoint()
  sont identiques), et qu'elle soit simple 
(ne passe pas par le même point plusieurs fois). Retourne 0 
si  
ls
  n'est pas un anneau, et -{}1 si elle vaut  
NULL
 .
      |