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/geography.rst

    r1 r49  
    11.. _geography: 
    22 
    3 Section 17: Geography 
    4 ===================== 
    5  
    6 It is very common to have data in which the coordinate are "geographics" or "latitude/longitude".  
    7  
    8 Unlike coordinates in Mercator, UTM, or Stateplane, geographic coordinates are **not cartesian coordinates**. Geographic coordinates do not represent a linear distance from an origin as plotted on a plane. Rather, these **spherical coordinates** describe the angular distance between the equator and the poles. In spherical coordinates a point is specified by the distance from the origin (the radius), the angle of rotation from the initial meridian plane, and the angle from the polar axis (analogous to a vector from the origin through the North Pole). 
     3Section 17: Coordonnées géographiques 
     4===================================== 
     5 
     6Il est trÚs fréquent de manipuler des données à coordonnées "géographiques" ou de "longitude/latitude".  
     7 
     8Au contraire des coordonnées de type Mercator, UTM ou Stateplane, les coordonnées géographiques ne représentent pas une distance linéaire depuis une origine, tel que dans un plan. Elles décrivent la distance angulaire entre l'équateur et les pÃŽles. Dans les sytÚmes de coordonnées sphériques, un point est spécifié par son rayon (distance à l'origine), son angle de rotation par rapport au méridien plan, et son angle par rapport à l'axe pÃŽlaire.  
    99 
    1010.. image:: ./geography/cartesian_spherical.jpg 
    1111 
    12 You can treat geographic coordinates as approximate cartesian coordinates and continue to do spatial calculations. However, measurements of distance, length and area will be nonsensical. Since spherical coordinates measure **angular** distance, the units are in "degrees." Further, the approximate results from indexes and true/false tests like intersects and contains can become terribly wrong. The distance between points get larger as problem areas like the poles or the international dateline are approached. 
    13  
    14 For example, here are the coordinates of Los Angeles and Paris. 
     12 
     13Vous pouvez continuer à utiliser des coordonnées géographiques comme des coordonnées cartésiennes approximatives pour vos analyses spatiales. Par contre les mesures de distances, d'aires et de longueur seront éronées. Etant donné que les coordonnées spériques mesurent des angles, l'unité est le dégré. Par exemple, les résultats cartésien approximatifs de tests tels que 'intersects' et 'contains' peuvent s'avérer terriblement faux. Par ailleurs, plus une zone est située prÚs du pÃŽle ou de la ligne de date internationale, plus la distance entre les points est agrandie.   
     14  
     15 
     16Voici par exemple les coordonnées des villes de Los Angeles et Paris. 
    1517 
    1618 * Los Angeles: ``POINT(-118.4079 33.9434)`` 
    1719 * Paris: ``POINT(2.3490 48.8533)`` 
    1820  
    19 The following calculates the distance between Los Angeles and Paris using the standard PostGIS cartesian :command:`ST_Distance(geometry, geometry)`.  Note that the SRID of 4326 declares a geographic spatial reference system. 
     21La requête suivante calcule la distance entre Los Angeles et Paris en utilisant le systÚme cartésien standard de PostGIS :command:`ST_Distance(geometry, geometry)`.  Notez que le SRID 4326 déclare un systÚme de références spatiales géographiques. 
    2022 
    2123.. code-block:: sql 
     
    3032  121.898285970107 
    3133   
    32 Aha! 121! But, what does that mean?  
    33  
    34 The units for spatial reference 4326 are degrees. So our answer is 121 degrees. But (again), what does that mean?  
    35  
    36 On a sphere, the size of one "degree square" is quite variable, becoming smaller as you move away from the equator. Think of the meridians (vertical lines) on the globe getting closer to each other as you go towards the poles. So, a distance of 121 degrees doesn't *mean* anything. It is a nonsense number. 
    37  
    38 In order to calculate a meaningful distance, we must treat geographic coordinates not as approximate cartesian coordinates but rather as true spherical coordinates.  We must measure the distances between points as true paths over a sphere -- a portion of a great circle.  
    39  
    40 Starting with version 1.5, PostGIS provides this functionality through the ``geography`` type. 
     34Aha! 121! Mais, que veut dire cela ?  
     35 
     36L'unité pour SRID 4326 est le degré. Donc la réponse signifie 121 degrés. Sur une sphÚre, la taille d'un degré "au carré" est assez variable. Elle devient plsu petite au fur et à mesure que l'on s'éloigne de l'équateur. Pensez par exemple aux méridiens sur le globe qui se ressÚrent entre eux au niveau des pÃŽles. Donc une distance de 121 degrés ne veut rien dire ! 
     37 
     38Pour calculer une distance ayant du sens, nous devons traiter les coordonnées géographiques non pas come des coordonnées cartésiennes approximatives, mais plutÃŽt comme de réelles coordonnées sphériques. Nous devons mesurer les distances entre les points comme de vrais chemins par dessus uen sphÚre, comme une portion d'un grand cercle. 
     39 
     40Depuis sa version 1.5, PostGIS fournit cette fonctionnalité avec le type ``geography``. 
    4141 
    4242.. note:: 
    4343 
    44   Different spatial databases have different approaches for "handling geographics"  
    45    
    46   * Oracle attempts to paper over the differences by transparently doing geographic calculations when the SRID is geographic.  
    47   * SQL Server uses two spatial types, "STGeometry" for cartesian data and "STGeography" for geographics.  
    48   * Informix Spatial is a pure cartesian extension to Informix, while Informix Geodetic is a pure geographic extension.  
    49   * Similar to SQL Server, PostGIS uses two types, "geometry" and "geography". 
    50    
    51 Using the ``geography`` instead of ``geometry`` type, let's try again to measure the distance between Los Angeles and Paris. Instead of :command:`ST_GeometryFromText(text)`, we will use :command:`ST_GeographyFromText(text)`. 
     44  Différentes bases de données spatiales développent différentes approches pour manipuler les coordonnées géographiques. 
     45   
     46  * Oracle essaye de mettre à jour la différence de maniÚre transparente en lanacant des calculs lorsuqe le SRID est géographique. 
     47  * SQL Server utilise deux types spatiaux, "STGeometry" pour les coordonnées cartésiens et STGeography" pour les coordonnées géographqiues.  
     48  * Informix Spatial est une pure extension cartésienne d'Informix, alors qu'Informix Geodetic est une pure extension géographique.  
     49  * Comme SQL Server, PostGIS utilise deux types: "geometry" et "geography". 
     50   
     51En utilisant le type ``geography`` plutot que ``geometry``, essayon sà nouveau de mesurer la distance entre Los Angeles et Paris. Au lieu de la commande :command:`ST_GeometryFromText(text)`, nous utiliserons cette fois :command:`ST_GeographyFromText(text)`. 
    5252 
    5353.. code-block:: sql 
     
    6262  9124665.26917268 
    6363 
    64 A big number! All return values from ``geography`` calculations are in meters, so our answer is 9124km.  
    65  
    66 Older versions of PostGIS supported very basic calculations over the sphere using the :command:`ST_Distance_Spheroid(point, point, measurement)` function. However, :command:`ST_Distance_Spheroid` is substantially limited. The function only works on points and provides no support for indexing across the poles or international dateline. 
    67  
    68 The need to support non-point geometries becomes very clear when posing a question like "How close will a flight from Los Angeles to Paris come to Iceland?"  
     64Toutes les valeurs retournées étant en mÚtres, notre réponse est donc 9124 kilomÚtres. 
     65 
     66Les versions plus anciennes de PostGIS supportaient uniquement des calculs sur sphÚre trÚs basiques comme la fonction :command:`ST_Distance_Spheroid(point, point, measurement)`. Celle-ci est trÚs limitée et ne fonctionne uniquement sur des  points. Elle ne supporte pas non plus l'indexation au niveau des pÃŽles ou de la ligne de date internationale. 
     67 
     68Le besoin du support des autres types de géométries se fit ressentir lorsqu'il s'agissait de répondre à des questions du type  "A quelle distance la ligne de vol d'un avion Los Angeles/Paris passe-t-elle de l'Islande?"  
    6969 
    7070.. image:: ./geography/lax_cdg.jpg 
    7171 
    72 Working with geographic coordinates on a cartesian plane (the purple line) yields a *very* wrong answer indeed! Using great circle routes (the red lines) gives the right answer. If we convert our LAX-CDG flight into a line string and calculate the distance to a point in Iceland using ``geography`` we'll get the right answer (recall) in meters. 
     72Répondre à cette question en travaillant avec un plan cartésien fournit une trÚs mauvaise réponse en effet ! En utilisant la ligne rouge, nou sobtenon sune bien meilleure réponse. Si nous convertissons notre vol LAX-CDG en une ligne et que nous calculons la distance à un point en Islande, nous obtiendrons la réponse exacte, en mÚtres.  
    7373 
    7474.. code-block:: sql 
     
    8383  531773.757079116 
    8484   
    85 So the closest approach to Iceland on the LAX-CDG route is a relatively small 532km. 
    86    
    87 The cartesian approach to handling geographic coordinates breaks down entirely for features that cross the international dateline. The shortest great-circle route from Los Angeles to Tokyo crosses the Pacific Ocean. The shortest cartesian route crosses the Atlantic and Indian Oceans. 
     85Donc le point le plu sproche de l'Islande pendant le vol LAX-CDG est de 532 kilomÚtres.S 
     86 
     87L'approche cartésienne pour manipuler les coordonnées géographiques pert tout son sens pour les objets situées au dessus de la ligne de date internationale. La route "sphérique" la plus courte entre Los-Angeles et Tokyo traverse l'océan Pacifique. La route "cartésienne" la plus courte traverse quant à elle les océans Atlantique et Indien.   
    8888 
    8989.. image:: ./geography/lax_nrt.png 
     
    107107 
    108108 
    109 Using Geography 
    110 --------------- 
     109Utiliser 'Geography' 
     110------------------- 
    111111 
    112112In order to load geometry data into a geography table, the geometry first needs to be projected into EPSG:4326 (longitude/latitude), then it needs to be changed into geography.  The :command:`ST_Transform(geometry,srid)` function converts coordinates to geographics and the :command:`Geography(geometry)` function "casts" them from geometry to geography. 
     
    222222If, on the other hand, you need to measure distance with a dataset that is geographically dispersed (covering much of the world), use the ``geography`` type. The application complexity you save by working in ``geography`` will offset any performance issues. And, casting to ``geometry`` can offset most functionality limitations. 
    223223 
    224 Function List 
    225 ------------- 
     224Liste des fonctions 
     225------------------- 
    226226 
    227227`ST_Distance(geometry, geometry) <http://postgis.org/docs/ST_Distance.html>`_: For geometry type Returns the 2-dimensional cartesian minimum distance (based on spatial ref) between two geometries in projected units. For geography type defaults to return spheroidal minimum distance between two geographies in meters. 
Note: See TracChangeset for help on using the changeset viewer.