Bienvenue sur PostGIS.fr

Bienvenue sur PostGIS.fr , le site de la communauté des utilisateurs francophones de PostGIS.

PostGIS ajoute le support d'objets géographique à la base de données PostgreSQL. En effet, PostGIS "spatialise" le serverur PostgreSQL, ce qui permet de l'utiliser comme une base de données SIG.

Maintenu à jour, en fonction de nos disponibilités et des diverses sorties des outils que nous testons, nous vous proposons l'ensemble de nos travaux publiés en langue française.


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/workshop-foss4g/geometries.rst

    r1 r46  
    11.. _geometries: 
    22 
    3 Section 8: Geometries 
     3Partie 8 : Les géometries 
    44===================== 
    55 
     
    77------------ 
    88 
    9 In the previous :ref:`section <loading_data>`, we loaded a variety of data.  Before we start playing with our data lets have a look at some simpler examples.  In pgAdmin, once again select the **nyc** database and open the SQL query tool.  Paste this example SQL code into the pgAdmin SQL Editor window (removing any text that may be there by default) and then execute. 
     9Dans :ref:`une partie précédente<loading_data>` nous avons charger différentes données. Avant de commencer à jouer avec, commençons par regarder quelques exemples simples. Depuis pgAdmin, choisissez de nouveau la base de donnée **nyc** et ouvrez l'outil de requêtage SQL. Copiez cette exemple de code SQL (aprÚs avoir supprimer le contenu présent par défaut si nécessaire) puis exécutez-le. 
    1010 
    1111.. code-block:: sql 
     
    2626.. image:: ./geometries/start01.png 
    2727 
    28 The above example CREATEs a table (**geometries**) then INSERTs five geometries: a point, a line, a polygon, a polygon with a hole, and a collection. Finally, the inserted rows are SELECTed and displayed in the Output pane. 
    29  
    30 Metadata Tables 
    31 --------------- 
    32  
    33 In conformance with the Simple Features for SQL (:term:`SFSQL`) specification, PostGIS provides two tables to track and report on the geometry types available in a given database.  
    34  
    35 * The first table, ``spatial_ref_sys``, defines all the spatial reference systems known to the database and will be described in greater detail later 
    36 * The second table, ``geometry_columns``, provides a listing of all "features" (defined as an object with geometric attributes), and the basic details of those features.  
     28L'exemple ci-dessus créé une table (**geometries**) puis y insert cinq géométries : un point, une ligne, un polygone, un polygone avec un trou, et une collection. Les lignes insérées sont sélectionnées et affichées dans le tableau de sortie. 
     29 
     30Les tables de métadonnées 
     31------------------------- 
     32 
     33Dans le respect de la spécification Simple Features for SQL (:term:`SFSQL`), PostGIS fournit deux tables pour récupérer et s'informer sur les types de géométries disponibles dans une base de données spécifique. 
     34 
     35* La premiÚre table, ``spatial_ref_sys``, définit tout les systÚmes de projection connus de la base de données et sera décrite plus en détails plus tard 
     36* La seconde table, ``geometry_columns``, fournit une liste de toutes les "entités" (définit comme un objet avec un attribut géométrique) et les détails de base relatives à ces entités.  
    3737 
    3838.. image:: ./geometries/table01.png 
    3939 
    40 In our introductory example, the :command:`Populate_Geometry_Columns()` function finds all the columns in the database that contain geometry and updates the ``geometry_columns`` table to include references to them.   
    41  
    42 Lets have a look at the ``geometry_columns`` table in our database.  Paste this command in the Query Tool as before: 
     40Dans l'exemple founit en introduction, la fonction :command:`Populate_Geometry_Columns()` détecte toute les colonnes de la base de données qui contiennent des géométries et met à jour la table ``geometry_columns`` pour y inclure leurs références. 
     41 
     42Regardons maintenant la table ``geometry_columns`` de notre base de données. Copiez cette commande dans la fenêtre de requêtage : 
     43 
    4344 
    4445.. code-block:: sql 
     
    4849.. image:: ./geometries/start08.png 
    4950 
    50 * ``f_table_catalog``, ``f_table_schema``, and ``f_table_name`` provide the fully qualified name of the feature table containing a given geometry.  Because PostgreSQL doesn't make use of catalogs, ``f_table_catalog`` will tend to be empty 
    51 * ``f_geometry_column`` is the name of the column that geometry containing column -- for feature tables with multiple geometry columns, there will be one record for each.   
    52 * ``coord_dimension`` and ``srid`` define the the dimension of the geometry (2-, 3- or 4-dimensional) and the Spatial Reference system identifier that refers to the ``spatial_ref_sys`` table respectively 
    53 * The ``type`` column defines the type of geometry as described below; we've seen Point and Linestring types so far 
    54  
    55 By querying this table, GIS clients and libraries can determine what to expect when retrieving data and can perform any necessary projection, processing or rendering without needing to inspect each geometry. 
    56  
    57 Representing Real World Objects 
    58 ------------------------------- 
    59  
    60 The Simple Features for SQL (:term:`SFSQL`) specification, the original guiding standard for PostGIS development, defines how a real world object is represented.  By taking a continuous shape and digitizing it at a fixed resolution we achieve a passable representation of the object.  SFSQL only handled 2-dimensional representations.  PostGIS has extended that to include 3- and 4-dimensional representations; more recently the SQL-Multimedia Part 3 (:term:`SQL/MM`) specification has officially defined their own representation.   
    61  
    62 Our example table contains a mixture of different geometry types. We can collect general information about each object using functions that read the geometry metadata. 
    63  
    64  * :command:`ST_GeometryType(geometry)` returns the type of the geometry 
    65  * :command:`ST_NDims(geometry)` returns the number of dimensions of the geometry 
    66  * :command:`ST_SRID(geometry)` returns the spatial reference identifier number of the geometry 
     51* ``f_table_catalog``, ``f_table_schema``, et ``f_table_name`` fournissent le nom complet de la table contenant une géométrie donnée. Étant donné que PostgreSQL n'utilise pas de catalogues, ``f_table_catalog`` est toujouts vide 
     52* ``f_geometry_column`` est le nom de la colonne qui contient la géométrie -- pour les tables ayant plusieurs colonnes géométriques, il y a un enregistrement dans cette table pour chacune. 
     53* ``coord_dimension`` et ``srid`` définissent respectivement la dimension de la géométrie (en 2-, 3- or 4-dimensions) et le systÚme de références spatiales qui fait référence à la table ``spatial_ref_sys`` 
     54* La colonne ``type`` définit le type de géométrie comme décrit plus tÃŽt, nous avons déjà vu les points et les lignes 
     55 
     56En interrogeant cette table, les clients SIG et les libraires peuvent déterminer quoi attendre lors de la récupération des données et peuvent réaliser les opération de reprojection, transformation ou rendu sans avoir à inspecter chaque géométrie. 
     57 
     58Réprésenter des objets du monde réel 
     59----------------------------------- 
     60 
     61La spécification Simple Features for SQL (:term:`SFSQL`), le standard ayant guidé le développement de PostGIS, définit comment les objets du monde réel doivent être représentés. En considérant une forme continue à une seule résolution fixe, nous obtenons une piÚtre représentation des objets. SFSQL considÚre uniquement les représentations en 2 dimensions. PostGIS a étendu cela en ajoutant les représentation en 3 et 4 dimensions. Plus récemment, la spécification SQL-Multimedia Part 3 (:term:`SQL/MM`) a officiellement définit sa propre représentation. 
     62 
     63Notre table exemple contient différents types de géométries. Nous pouvons récupérer les informations de chaque objet en utilisant les fonctions qui lisent les métadonnées de la géométrie. 
     64 
     65 * :command:`ST_GeometryType(geometry)` retourne le type de la géométrie 
     66 * :command:`ST_NDims(geometry)` retourne le nombre de dimensions d'une géométrie 
     67 * :command:`ST_SRID(geometry)` retourne l'identifiant de référence spatiale de la géométrie 
    6768 
    6869.. code-block:: sql 
     
    8384 
    8485 
    85 Points 
    86 ~~~~~~ 
     86Les points 
     87~~~~~~~~~~~ 
    8788 
    8889.. image:: ./introduction/points.png 
    8990   :align: center 
    9091 
    91 A spatial **point** represents a single location on the Earth.  This point is represented by a single coordinate (including either 2-, 3- or 4-dimensions).  Points are used to represent objects when the exact details, such as shape and size, are not important at the target scale.  For example, cities on a map of the world can be described as points, while a map of a single state might represent cities as polygons.   
     92Un **point** représente une localisation unique sur la Terre. Ce point est représenté par une seule coordonnée (incluant soit 2, 3 ou 4 dimensions). Les points sont utilisés pour représenter des objets lorsque le détail exact du contour n'est pas important à une échelle donnée. Par exemple, les villes sur une carte du monde peuvent être décrite sous la forme de points alors qu'une carte régionale utiliserait une représentation polygonale des villes. 
    9293 
    9394.. code-block:: sql 
     
    101102  POINT(0 0) 
    102103 
    103 Some of the specific spatial functions for working with points are: 
    104  
    105  * :command:`ST_X(geometry)` returns the X ordinate 
    106  * :command:`ST_Y(geometry)` returns the Y ordinate 
    107  
    108 So, we can read the ordinates from a point like this: 
     104Certaines des fonctions spécifiques pour travailler avec les points sont : 
     105 
     106 * :command:`ST_X(geometry)` retourne la composante X 
     107 * :command:`ST_Y(geometry)` retourne la composante Y  
     108 
     109Donc, nous pouvons lire les coordonnées d'un point de la maniÚre suivante : 
    109110 
    110111.. code-block:: sql 
     
    114115    WHERE name = 'Point'; 
    115116 
    116 The New York City subway stations (``nyc_subway_stations``) table is a data set represented as points. The following SQL query will return the geometry associated with one point (in the :command:`ST_AsText` column). 
     117La table des stations de métro de la ville de New York  (``nyc_subway_stations``) est un ensemble de données représenté sous la forme de points. La requête SQL suivante renverra la géométrie associée à un point (dans la colonne :command:`ST_AsText`). 
    117118 
    118119.. code-block:: sql 
     
    123124 
    124125 
    125 Linestrings 
     126Les lignes  
    126127~~~~~~~~~~~ 
    127128 
     
    129130   :align: center 
    130131 
    131 A **linestring** is a path between locations.  It takes the form of an ordered series of two or more points.  Roads and rivers are typically represented as linestrings.  A linestring is said to be **closed** if it starts and ends on the same point.  It is said to be **simple** if it does not cross or touch itself (except at its endpoints if it is closed).  A linestring can be both **closed** and **simple**. 
    132  
    133 The street network for New York (``nyc_streets``) was loaded earlier in the workshop.  This dataset contains details such as name, and type.  A single real world street may consist of many linestrings, each representing a segment of road with different attributes. 
    134  
    135 The following SQL query will return the geometry associated with one linestring (in the :command:`ST_AsText` column). 
     132Une **ligne** est un chemin entre plusieurs points. Elle prend la forme d'un tableau ordonné composé de deux (ou plusieurs) points. Les routes et les riviÚres sont typiquement représentés sous la forme de lignes. Une ligne est dite **fermée** si elle commence et fini en un même point. Elle est dite **simple** si elle ne se coupe pas ou ne se touche pas elle-même (sauf à ses extrémités si elle est fermée). Une ligne peut être à la fois **fermée** et **simple**. 
     133 
     134Le réseau des rues de New York (``nyc_streets``) a été chargé auparavant. Cet ensemble de données contient les détails comme le nom et le type des rues. Une rue du monde réel pourrait être constituée de plusieurs lignes, chacune représentant une file avec différents attributs. 
     135 
     136La requête SQL suivante retourne la géométrie associée à une ligne (dans la colonne :command:`ST_AsText`) : 
    136137 
    137138.. code-block:: sql 
     
    145146  LINESTRING(0 0, 1 1, 2 1, 2 2) 
    146147 
    147 Some of the specific spatial functions for working with linestrings are: 
    148  
    149  * :command:`ST_Length(geometry)` returns the length of the linestring 
    150  * :command:`ST_StartPoint(geometry)` returns the first coordinate as a point 
    151  * :command:`ST_EndPoint(geometry)` returns the last coordinate as a point 
    152  * :command:`ST_NPoints(geometry)` returns the number of coordinates in the linestring 
    153  
    154 So, the length of our linestring is: 
     148Les fonctions spatiales permettant de travailler avec les lignes sont les suivantes : 
     149 
     150 * :command:`ST_Length(geometry)` retourne la longueur d'une ligne 
     151 * :command:`ST_StartPoint(geometry)` retourne le premier point d'une ligne 
     152 * :command:`ST_EndPoint(geometry)` retourne le denier point d'une ligne 
     153 * :command:`ST_NPoints(geometry)` retourne le nombre de points dans une ligne 
     154 
     155Donc, la longueur de notre ligne est : 
    155156 
    156157.. code-block:: sql 
     
    165166 
    166167 
    167 Polygons 
    168 ~~~~~~~~ 
     168Les polygones 
     169~~~~~~~~~~~~~~ 
    169170 
    170171.. image:: ./introduction/polygons.png 
    171172  :align: center 
    172173 
    173 A polygon is a representation of an area.  The outer boundary of the polygon is represented by a ring.  This ring is a linestring that is both closed and simple as defined above.  Holes within the polygon are also represented by rings. 
    174  
    175 Polygons are used to represent objects whose size and shape are important.  City limits, parks, building footprints or bodies of water are all commonly represented as polygons when the scale is sufficiently high to see their area.  Roads and rivers can sometimes be represented as polygons. 
    176  
    177 The following SQL query will return the geometry associated with one linestring (in the :command:`ST_AsText` column). 
     174Un polygone est représenté comme une zone. Le contour externe du polygone est représenté par une ligne simple et fermée. Les trous sont représenté de la même maniÚre. 
     175 
     176Les polygones sont utilisés pour représenter les objets dont les tailles et la forme sont importants. Les limites de villes, les parcs, les bâtiments ou les cours d'eau sont habituellement représenté par des polygones lorsque l'échelle est suffisament élevée pour voir distinguer leurs zones. Les routes et les riviÚres peuvent parfois être représenté comme des polygones. 
     177 
     178La requête SQL suivante retournera la géométrie associée à un polygone (dans la colonne :command:`ST_AsText`). 
    178179 
    179180.. code-block:: sql 
     
    185186.. note:: 
    186187 
    187   Rather than using an ``=`` sign in our ``WHERE`` clause, we are using the ``LIKE`` operator to carry out a string matching operation. You may be used to the ``*`` symbol as a "glob" for pattern matching, but in SQL the ``%`` symbol is used, along with the ``LIKE`` operator to tell the system to do globbing. 
     188  PlutÃŽt que d'utiliser le signe ``=`` dans notre clause ``WHERE``, nous avons utilisé l'opérateur ``LIKE`` pour pouvoir définir notre comparaison. Vous auriez sans doute voulu utiliser le symbole ``*`` pour exprimer "n'importe quelle valeur" mais en SQL vous devez utiliser : ``%`` et l'opérateur ``LIKE`` pour informer le systÚme que cette comparaison doit être possible. 
    188189 
    189190:: 
     
    192193 POLYGON((0 0, 10 0, 10 10, 0 10, 0 0),(1 1, 1 2, 2 2, 2 1, 1 1)) 
    193194 
    194 The first polygon has only one ring. The second one has an interior "hole". Most graphics systems include the concept of a "polygon", but GIS systems are relatively unique in allowing polygons to explicitly have holes. 
     195Le premier polygone a seulement une ligne. Le second a un "trou". La plupart des systÚmes de rendu graphique supportent le concept de "polygone", mais les systÚmes SIG sont les seuls à accepter que les polygones puissent contenir des trous. 
    195196 
    196197.. image:: ./screenshots/polygons.png 
    197198 
    198 Some of the specific spatial functions for working with polygons are: 
    199  
    200  * :command:`ST_Area(geometry)` returns the area of the polygons 
    201  * :command:`ST_NRings(geometry)` returns the number of rings (usually 1, more of there are holes) 
    202  * :command:`ST_ExteriorRing(geometry)` returns the outer ring as a linestring 
    203  * :command:`ST_InteriorRingN(geometry,n)` returns a specified interior ring as a linestring 
    204  * :command:`ST_Perimeter(geometry)` returns the length of all the rings 
    205  
    206 We can calculate the area of our polygons using the area function: 
     199Certaines des fonctions spatiales spécifiques de traitement des polygones sont : 
     200 
     201 * :command:`ST_Area(geometry)` retourne l'aire d'un polygone 
     202 * :command:`ST_NRings(geometry)` retourne le nombre de contours (habituellement 1, plus lorsqu'il y a des trous) 
     203 * :command:`ST_ExteriorRing(geometry)` retourne le contour extérieur 
     204 * :command:`ST_InteriorRingN(geometry,n)` retourne le contour intérieur numéro n 
     205 * :command:`ST_Perimeter(geometry)` retourne la longueur de tout les contours 
     206 
     207Nous pouvons calculer l'aire de nos polygones en utilisant la fonction area : 
    207208 
    208209.. code-block:: sql 
     
    217218  PolygonWithHole    99 
    218219 
    219 Note that the polygon with a hole has an area that is the area of the outer shell (a 10x10 square) minus the area of the hole (a 1x1 square). 
    220  
    221 Collections 
    222 ~~~~~~~~~~~ 
    223  
    224 There are four collection types, which group multiple simple geometries into sets.   
    225  
    226  * **MultiPoint**, a collection of points 
    227  * **MultiLineString**, a collection of linestrings 
    228  * **MultiPolygon**, a collection of polygons 
    229  * **GeometryCollection**, a heterogeneous collection of any geometry (including other collections) 
    230  
    231 Collections are another concept that shows up in GIS software more than in generic graphics software. They are useful for directly modeling real world objects as spatial objects. For example, how to model a lot that is split by a right-of-way? As a **MultiPolygon**, with a part on either side of the right-of-way. 
     220Remarquez que le polygone contenant un trou a une aire égale à l'aire du contour externe (un carré de 10 sur 10) moins l'aire du trou (un carré de 1 sur 1). 
     221 
     222Les collections 
     223~~~~~~~~~~~~~~~~  
     224 
     225Il y a quatre types de collections, qui regroupe ensemble plusieurs géométries simples. 
     226 
     227 * **MultiPoint**, une collection de points 
     228 * **MultiLineString**, une collection de lignes 
     229 * **MultiPolygon**, une collection de polygones 
     230 * **GeometryCollection**, une collection hétérogÚne de n'importe quelle géométrie (dont d'autre collections) 
     231 
     232Les collections sont un concept présents dans les logiciels SIG  plus que dans les applications de rendu graphique génériques. Elles sont utiles pour directement modeler les objets du monde réel comme des objet spatiaux. Par exemple, comment modéliser une parcelle qui a été coupée par un chemin ? Comme un **MultiPolygon**, ayant une partie de chaque coté du chemin. 
    232233 
    233234.. image:: ./screenshots/collection2.png 
    234235 
    235 Our example collection contains a polygon and a point: 
     236Notre collection exemple contient un polygone et un point : 
    236237 
    237238.. code-block:: sql 
     
    247248.. image:: ./screenshots/collection.png 
    248249 
    249 Some of the specific spatial functions for working with collections are: 
    250  
    251  * :command:`ST_NumGeometries(geometry)` returns the number of parts in the collection 
    252  * :command:`ST_GeometryN(geometry,n)` returns the specified part 
    253  * :command:`ST_Area(geometry)` returns the total area of all polygonal parts 
    254  * :command:`ST_Length(geometry)` returns the total length of all linear parts 
    255  
    256  
    257  
    258 Geometry Input and Output 
    259 ------------------------- 
    260  
    261 Within the database, geometries are stored on disk in a format only used by the PostGIS program. In order for external programs to insert and retrieve useful geometries, they need to be converted into a format that other applications can understand. Fortunately, PostGIS supports emitting and consuming geometries in a large number of formats: 
    262  
    263  * Well-known text (:term:`WKT`) 
    264   
    265    * :command:`ST_GeomFromText(text)` returns ``geometry`` 
    266    * :command:`ST_AsText(geometry)` returns ``text`` 
    267    * :command:`ST_AsEWKT(geometry)` returns ``text`` 
    268     
    269  * Well-known binary (:term:`WKB`) 
    270   
    271    * :command:`ST_GeomFromWKB(bytea)` returns ``geometry`` 
    272    * :command:`ST_AsBinary(geometry)` returns ``bytea`` 
    273    * :command:`ST_AsEWKB(geometry)` returns ``bytea`` 
     250Certaines des fonctions spatiales spécifiques à la manipulation des collections sont : 
     251 
     252 * :command:`ST_NumGeometries(geometry)` retourne le nombre de composantes d'une collection 
     253 * :command:`ST_GeometryN(geometry,n)` retourne une composante spécifique 
     254 * :command:`ST_Area(geometry)` retourne l'aire totale des composantes de types polygones 
     255 * :command:`ST_Length(geometry)` retourne la longueur totale des composantes de types lignes 
     256 
     257Entré / Sortie des géométries 
     258----------------------------- 
     259 
     260Dans la base de données, les géométries sont stockées dans un format utilisé uniquement par le programme PostGIS. Afin que des programmes externes puissent insérer et récupérer les données utiles, elles ont besoin d'être converties dans un format compris par l'application. Heureusement, PostGIS supporte un grand nombre de formats en entrée et en sortie : 
     261 
     262 * Format texte bien connu (Well-known text :term:`WKT`) 
     263  
     264   * :command:`ST_GeomFromText(text)` retourne une ``geometry`` 
     265   * :command:`ST_AsText(geometry)` retourne le ``texte`` 
     266   * :command:`ST_AsEWKT(geometry)` retourne le ``texte`` 
     267    
     268 * Format binaire bien connu (Well-known binary :term:`WKB`) 
     269  
     270   * :command:`ST_GeomFromWKB(bytea)` retourne ``geometry`` 
     271   * :command:`ST_AsBinary(geometry)` retourne ``bytea`` 
     272   * :command:`ST_AsEWKB(geometry)` retourne ``bytea`` 
    274273    
    275274 * Geographic Mark-up Language (:term:`GML`) 
    276275  
    277    * :command:`ST_GeomFromGML(text)` returns ``geometry`` 
    278    * :command:`ST_AsGML(geometry)` returns ``text`` 
     276   * :command:`ST_GeomFromGML(text)` retourne ``geometry`` 
     277   * :command:`ST_AsGML(geometry)` retourne ``text`` 
    279278    
    280279 * Keyhole Mark-up Language (:term:`KML`) 
    281280  
    282    * :command:`ST_GeomFromKML(text)` returns ``geometry`` 
    283    * :command:`ST_AsKML(geometry)` returns ``text`` 
     281   * :command:`ST_GeomFromKML(text)` retourne ``geometry`` 
     282   * :command:`ST_AsKML(geometry)` retourne ``text`` 
    284283    
    285284 * :term:`GeoJSON` 
    286285  
    287    * :command:`ST_AsGeoJSON(geometry)` returns ``text`` 
     286   * :command:`ST_AsGeoJSON(geometry)` retourne ``text`` 
    288287    
    289288 * Scalable Vector Graphics (:term:`SVG`) 
    290289  
    291    * :command:`ST_AsSVG(geometry)` returns ``text`` 
    292   
    293 The following SQL query shows an example of :term:`WKB` representation (the call to :command:`encode()` is required to convert the binary output into an ASCII form for printing): 
     290   * :command:`ST_AsSVG(geometry)` retourne ``text`` 
     291  
     292La requête SQL suivante montre un exemple de représentation en :term:`WKB` (l'appel à :command:`encode()` est requis pour convertir le format binaire en ASCII pour l'afficher) : 
    294293 
    295294.. code-block:: sql 
     
    301300.. image:: ./geometries/represent-04.png 
    302301 
    303 For the purposes of this workshop we will continue to use WKT to ensure you can read and understand the geometries we're viewing.  However, most actual processes, such as viewing data in a GIS application, transferring data to a web service, or processing data remotely, WKB is the format of choice.   
    304  
    305 Since WKT and WKB were defined in the  :term:`SFSQL` specification, they do not handle 3- or 4-dimensional geometries.  For these cases PostGIS has defined the Extended Well Known Text (EWKT) and Extended Well Known Binary (EWKB) formats.  These provide the same formatting capabilities of WKT and WKB with the added dimensionality. 
    306  
    307 Here is an example of a 3D linestring in WKT: 
     302Dans le reste de ces travaux pratiques, nous utiliserons principalement le format WKT pour que vous puissiez lire et comprendre les géométries que nous voyons. Néanmoins, pour la plupart des traitement actuels, comme la visualisation des données dans une application SIG, le transfert de données à des services web, ou l'exécution distante de traitements, le format WKB est un format de choix. 
     303 
     304Puisque le WKT et le WKB sont définit dans la spécification :term:`SFSQL`, elles ne prennent pas en compte les géométries à 3 ou 4 dimensions. C'est pour cette raison que PostGIS définit les formats Extended Well Known Text (EWKT) et Extended Well Known Binary (EWKB). Cela permet de gérer de façon similaire aux formats WKT et WKB les dimensions ajoutées. 
     305 
     306Voici un exemple de ligne 3D au format WKT : 
    308307 
    309308.. code-block:: sql 
     
    320319.. image:: ./geometries/represent-06.png 
    321320 
    322 In addition to emitters for the various forms (WKT, WKB, GML, KML, JSON, SVG), PostGIS also has consumers for four (WKT, WKB, GML, KML). Most applications use the WKT or WKB geometry creation functions, but the others work too. Here's an example that consumes GML and output JSON: 
     321En plus de pouvoir générer les différents formats en sortie (WKT, WKB, GML, KML, JSON, SVG), PostGIS permet aussi de lire 4 de ces formats (WKT, WKB, GML, KML). La plupart des applications utilisent des fonctions créant des géométries à l'aide du format WKT ou WKB, mais les autres marchent aussi. Voici un exemple qui lit du GML et retourne du JSON : 
    323322 
    324323.. code-block:: sql 
     
    328327.. image:: ./geometries/represent-07.png 
    329328 
    330 Function List 
    331 ------------- 
    332  
    333 `Populate_Geometry_Columns <http://postgis.org/docs/Populate_Geometry_Columns.html>`_: Ensures geometry columns have appropriate spatial constraints and exist in the geometry_columns table.. 
    334  
    335 `ST_Area <http://postgis.org/docs/ST_Area.html>`_: Returns the area of the surface if it is a polygon or multi-polygon. For "geometry" type area is in SRID units. For "geography" area is in square meters. 
    336  
    337 `ST_AsText <http://postgis.org/docs/ST_AsText.html>`_: Returns the Well-Known Text (WKT) representation of the geometry/geography without SRID metadata. 
    338  
    339 `ST_AsBinary <http://postgis.org/docs/ST_AsBinary.html>`_: Returns the Well-Known Binary (WKB) representation of the geometry/geography without SRID meta data. 
    340  
    341 `ST_EndPoint <http://postgis.org/docs/ST_EndPoint.html>`_: Returns the last point of a LINESTRING geometry as a POINT. 
    342  
    343 `ST_AsEWKB <http://postgis.org/docs/ST_AsEWKB.html>`_: Returns the Well-Known Binary (WKB) representation of the geometry with SRID meta data. 
    344  
    345 `ST_AsEWKT <http://postgis.org/docs/ST_AsEWKT.html>`_: Returns the Well-Known Text (WKT) representation of the geometry with SRID meta data. 
    346  
    347 `ST_AsGeoJSON <http://postgis.org/docs/ST_AsGeoJSON.html>`_: Returns the geometry as a GeoJSON element. 
    348  
    349 `ST_AsGML <http://postgis.org/docs/ST_AsGML.html>`_: Returns the geometry as a GML version 2 or 3 element. 
    350  
    351 `ST_AsKML <http://postgis.org/docs/ST_AsKML.html>`_: Returns the geometry as a KML element. Several variants. Default version=2, default precision=15. 
    352  
    353 `ST_AsSVG <http://postgis.org/docs/ST_AsSVG.html>`_: Returns a Geometry in SVG path data given a geometry or geography object. 
    354  
    355 `ST_ExteriorRing <http://postgis.org/docs/ST_ExteriorRing.html>`_: Returns a line string representing the exterior ring of the POLYGON geometry. Return NULL if the geometry is not a polygon. Will not work with MULTIPOLYGON 
    356  
    357 `ST_GeometryN <http://postgis.org/docs/ST_GeometryN.html>`_: Returns the 1-based Nth geometry if the geometry is a GEOMETRYCOLLECTION, MULTIPOINT, MULTILINESTRING, MULTICURVE or MULTIPOLYGON. Otherwise, return NULL. 
    358  
    359 `ST_GeomFromGML <http://postgis.org/docs/ST_GeomFromGML.html>`_: Takes as input GML representation of geometry and outputs a PostGIS geometry object. 
    360  
    361 `ST_GeomFromKML <http://postgis.org/docs/ST_GeomFromKML.html>`_: Takes as input KML representation of geometry and outputs a PostGIS geometry object 
    362  
    363 `ST_GeomFromText <http://postgis.org/docs/ST_GeomFromText.html>`_: Returns a specified ST_Geometry value from Well-Known Text representation (WKT). 
    364  
    365 `ST_GeomFromWKB <http://postgis.org/docs/ST_GeomFromWKB.html>`_: Creates a geometry instance from a Well-Known Binary geometry representation (WKB) and optional SRID. 
    366  
    367 `ST_GeometryType <http://postgis.org/docs/ST_GeometryType.html>`_: Returns the geometry type of the ST_Geometry value. 
    368  
    369 `ST_InteriorRingN <http://postgis.org/docs/ST_InteriorRingN.html>`_: Returns the Nth interior linestring ring of the polygon geometry. Return NULL if the geometry is not a polygon or the given N is out of range. 
    370  
    371 `ST_Length <http://postgis.org/docs/ST_Length.html>`_: Returns the 2d length of the geometry if it is a linestring or multilinestring. geometry are in units of spatial reference and geography are in meters (default spheroid) 
    372  
    373 `ST_NDims <http://postgis.org/docs/ST_NDims.html>`_: Returns coordinate dimension of the geometry as a small int. Values are: 2,3 or 4. 
    374  
    375 `ST_NPoints <http://postgis.org/docs/ST_NPoints.html>`_: Returns the number of points (vertexes) in a geometry. 
    376  
    377 `ST_NRings <http://postgis.org/docs/ST_NRings.html>`_: If the geometry is a polygon or multi-polygon returns the number of rings. 
    378  
    379 `ST_NumGeometries <http://postgis.org/docs/ST_NumGeometries.html>`_: If geometry is a GEOMETRYCOLLECTION (or MULTI*) returns the number of geometries, otherwise return NULL. 
    380  
    381 `ST_Perimeter <http://postgis.org/docs/ST_Perimeter.html>`_: Returns the length measurement of the boundary of an ST_Surface or ST_MultiSurface value. (Polygon, Multipolygon) 
    382  
    383 `ST_SRID <http://postgis.org/docs/ST_SRID.html>`_: Returns the spatial reference identifier for the ST_Geometry as defined in spatial_ref_sys table. 
    384  
    385 `ST_StartPoint <http://postgis.org/docs/ST_StartPoint.html>`_: Returns the first point of a LINESTRING geometry as a POINT. 
    386  
    387 `ST_X <http://postgis.org/docs/ST_X.html>`_: Returns the X coordinate of the point, or NULL if not available. Input must be a point. 
    388  
    389 `ST_Y <http://postgis.org/docs/ST_Y.html>`_: Returns the Y coordinate of the point, or NULL if not available. Input must be a point. 
    390  
    391  
     329Liste des fonctions 
     330------------------- 
     331 
     332`Populate_Geometry_Columns <http://postgis.org/docs/Populate_Geometry_Columns.html>`_: s'assure que les colonnes géométriques on les contraintes spatiales appropriées et qu'elles sont présentes dans la table  geometry_columns. 
     333 
     334`ST_Area <http://postgis.org/docs/ST_Area.html>`_: retourne l'aire de la surface si c'est un polygon ou un multi-polygone. Pour le type "geometry" l'aire est dans l'unité du SRID. Pour les "geography" l'aire est en mÚtres carrés. 
     335 
     336`ST_AsText <http://postgis.org/docs/ST_AsText.html>`_: retourne la représentation de la geometry/geography au format Well-Known Text (WKT) sans metadonnée correspondant au SRID. 
     337 
     338`ST_AsBinary <http://postgis.org/docs/ST_AsBinary.html>`_: retourne la représentation de la geometry/geography au format Well-Known Binary (WKB) sans metadonnée correspondant u SRID.  
     339 
     340`ST_EndPoint <http://postgis.org/docs/ST_EndPoint.html>`_: retourne le dernier point d'une ligne. 
     341 
     342`ST_AsEWKB <http://postgis.org/docs/ST_AsEWKB.html>`_: retourne la représentation de la geometrie au format Well-Known Binary (WKB) avec la métadonnée SRID. 
     343 
     344`ST_AsEWKT <http://postgis.org/docs/ST_AsEWKT.html>`_: retourne la représentation de la geometrie au format Well-Known Text (WKT) avec la métadonnée SRID. 
     345 
     346`ST_AsGeoJSON <http://postgis.org/docs/ST_AsGeoJSON.html>`_: retourne la géométrie au format GeoJSON. 
     347 
     348`ST_AsGML <http://postgis.org/docs/ST_AsGML.html>`_: retourne la géométrie au format GML version 2 ou 3. 
     349 
     350`ST_AsKML <http://postgis.org/docs/ST_AsKML.html>`_: retourne la géométrie au format KML. Nombreuses variantes. Par défaut : version=2 et precision=15. 
     351 
     352`ST_AsSVG <http://postgis.org/docs/ST_AsSVG.html>`_: retourne la géométrie au format SVG. 
     353 
     354`ST_ExteriorRing <http://postgis.org/docs/ST_ExteriorRing.html>`_: retourne une ligne représentant le contour extérieur du polygone. Retourne NULL si la géométrie n'est pas un polygone. Ne fonctionne pas avec les multi-polygone. 
     355 
     356`ST_GeometryN <http://postgis.org/docs/ST_GeometryN.html>`_: retourne niÚme composante si la géométrie est du type GEOMETRYCOLLECTION, MULTIPOINT, MULTILINESTRING, MULTICURVE ou MULTIPOLYGON. Sinon, retourne NULL. 
     357 
     358`ST_GeomFromGML <http://postgis.org/docs/ST_GeomFromGML.html>`_: prend en entrée une représentation GML de la géométrie et retourne un object PostGIS de type geometry. 
     359 
     360`ST_GeomFromKML <http://postgis.org/docs/ST_GeomFromKML.html>`_: prend en entrée une représentation KML de la géométrie et retourne un object PostGIS de type geometry. 
     361 
     362`ST_GeomFromText <http://postgis.org/docs/ST_GeomFromText.html>`_: retourne une valeur de type ST_Geometry à partir d'une représentation au format Well-Known Text (WKT). 
     363 
     364`ST_GeomFromWKB <http://postgis.org/docs/ST_GeomFromWKB.html>`_: retourne une valeur de type ST_Geometry à partir d'une représenattion au format Well-Known Binary (WKB). 
     365 
     366`ST_GeometryType <http://postgis.org/docs/ST_GeometryType.html>`_: retourne le type de géométrie de la valeur de type ST_Geometry. 
     367 
     368`ST_InteriorRingN <http://postgis.org/docs/ST_InteriorRingN.html>`_: retourne le niÚme contour intérieur d'un polygone. Retourne NULL si la géométrie n'est pas un polygone ou si N est hors des limites. 
     369 
     370`ST_Length <http://postgis.org/docs/ST_Length.html>`_: retourne la longueur en 2-dimensions si c'est une ligne ou une multi-lignes. Les objets de type geometry sont dans l'unité du systÚme de références spatiales et les objet de type geography sont en metres (sphéroïde par défaut). 
     371 
     372`ST_NDims <http://postgis.org/docs/ST_NDims.html>`_: retourne le nombre de dimensions d'une géométrie. Les valeurs possibles sont : 2,3 ou 4. 
     373 
     374`ST_NPoints <http://postgis.org/docs/ST_NPoints.html>`_: retourne le nombre de points dans une géométrie. 
     375 
     376`ST_NRings <http://postgis.org/docs/ST_NRings.html>`_: si la géométrie est un polygone ou un multi-polygone, retourne le nombre de contours. 
     377 
     378`ST_NumGeometries <http://postgis.org/docs/ST_NumGeometries.html>`_: si la géométrie est du type GEOMETRYCOLLECTION (ou MULTI*) retourne le nombre de géométries, sinon retourne NULL. 
     379 
     380`ST_Perimeter <http://postgis.org/docs/ST_Perimeter.html>`_: retourne la longueur du contours extérieur d'une valeur de type ST_Surface ou ST_MultiSurface (polygone, multi-polygone). 
     381 
     382`ST_SRID <http://postgis.org/docs/ST_SRID.html>`_: retourne l'identifiant du systÚme de référence spatiale définit dans la table spatial_ref_sys d'un objet de type ST_Geometry. 
     383 
     384`ST_StartPoint <http://postgis.org/docs/ST_StartPoint.html>`_: retourne le premier point d'une ligne. 
     385 
     386`ST_X <http://postgis.org/docs/ST_X.html>`_: retourne la coordonnée X d'un point, ou NULL si non présent. L'argument passé doit être un point. 
     387 
     388`ST_Y <http://postgis.org/docs/ST_Y.html>`_: retourne la coordonnée Y d'un point, ou NULL si non présent. L'argument passé doit être un point. 
     389 
Note: See TracChangeset for help on using the changeset viewer.