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.

Changeset 35 for trunk


Ignore:
Timestamp:
26/09/2011 14:29:54 (13 years ago)
Author:
djay
Message:

Base de la traduction de la partie 18

File:
1 edited

Legend:

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

    r1 r35  
    11.. _geometry_returning: 
    22 
    3 Section 18: Geometry Constructing Functions 
    4 =========================================== 
     3Partie 18 : Fonction de construction de géométries 
     4================================================== 
    55 
    6 All the functions we have seen so far work with geometries "as they are" and returns 
     6Toute les fonctions que nous avons vu jusqu'à présent traitent les géométries "comme elles sont" est retournent  
    77  
    8 * analyses of the objects (:command:`ST_Length(geometry)`, :command:`ST_Area(geometry)`),  
    9 * serializations of the objects (:command:`ST_AsText(geometry)`, :command:`ST_AsGML(geometry)`),  
    10 * parts of the object (:command:`ST_RingN(geometry,n)`) or  
    11 * true/false tests (:command:`ST_Contains(geometry,geometry)`, :command:`ST_Intersects(geometry,geometry)`). 
     8* une analise des objets (:command:`ST_Length(geometry)`, :command:`ST_Area(geometry)`),  
     9* une sérialisation des objets (:command:`ST_AsText(geometry)`, :command:`ST_AsGML(geometry)`),  
     10* une partie de l'objet (:command:`ST_RingN(geometry,n)`) ou 
     11* un resultat vrai/faux (:command:`ST_Contains(geometry,geometry)`, :command:`ST_Intersects(geometry,geometry)`). 
    1212 
    13 "Geometry constructing functions" take geometries as inputs and output new shapes. 
     13Les "fonctions de construction de géométries" prennent des géométries en entrée et retourne de nousvelles formes. 
    1414 
    1515 
     
    1717------------------------------- 
    1818 
    19 A common need when composing a spatial query is to replace a polygon feature with a point representation of the feature. This is useful for spatial joins (as discussed in :ref:`polypolyjoins`) because using :command:`ST_Intersects(geometry,geometry)` on two polygon layers often results in double-counting: a polygon on a boundary will intersect an object on both sides; replacing it with a point forces it to be on one side or the other, not both. 
     19Un besoin commun lors de la création de requêtes spatiales est de remplacer une entité polygonale par un point représentant cette entité. Cela esr utile pour les jointures spatiales (comme indiqué ici : :ref:`polypolyjoins`) car utiliser :command:`ST_Intersects(geometry,geometry)` avec deux polygones impliquera un double comptage : un polygone pour le contour externe intersectera dans les deux senses; le replacer par un point le forcera à être dans un seul sens, pas les deux. 
    2020 
    21  * :command:`ST_Centroid(geometry)` returns a point that is approximately on the center of mass of the input argument. This simple calculation is very fast, but sometimes not desirable, because the returned point is not necessarily in the feature itself. If the input feature has a convexity (imagine the letter 'C') the returned centroid might not be in the interior of the feature. 
    22  * :command:`ST_PointOnSurface(geometry)` returns a point that is guaranteed to be inside the input argument. It is substantially more computationally expensive than the centroid operation. 
     21 * :command:`ST_Centroid(geometry)` retourne le point qui est approximativement au centre de la masse de la géométrie passé en paramÚtre. C'est un calcul simle et rapide, mais parfois non proftable, car le point retourné peut se trouver à l'extérieur de l'entité elle-même. Si l'entité fournie est convee (imaginez la lettre 'C') le centroïde renvoyé pourrait ne pas être à l'intérieur du polygone. 
     22 * :command:`ST_PointOnSurface(geometry)` retourne un point qui est obligatoirement dans l'entité passée en paramÚtre. Cette fonction coûte plus cher en ressource que le calcul du centroïd. 
    2323  
    2424.. image:: ./geometry_returning/centroid.jpg 
     
    2828--------- 
    2929 
    30 The buffering operation is common in GIS workflows, and is also available in PostGIS. :command:`ST_Buffer(geometry,distance)` takes in a buffer distance and geometry type and outputs a polygon with a boundary the buffer distance away from the input geometry.  
     30L'opération de zone tampon est souvent disponible dans les outils SIG, il est aussi disponible dans PostGIS. La fonction :command:`ST_Buffer(geometry,distance)` prend en paramÚtre une géométrie et une distance et retourne une zone tampon dont le contour est à une distance données de la géométrie d'origine. 
    3131 
    3232.. image:: ./geometry_returning/st_buffer.png 
    3333 
    34 For example, if the US Park Service wanted to enforce a marine traffic zone around Liberty Island, they might build a 500 meter buffer polygon around the island. Liberty Island is a single census block in our ``nyc_census_blocks`` table, so we can easily extract and buffer it. 
     34Par exemple, si les services des parks américains souhaitaient renforcer la zone du traffique maritime autour de l'île 'Liberty', ils pourraient construire une zone tampon de 500 mÚtres autour de l'île. L'île de 'Liiberty' est représenté par un seul bloque dans notre table ``nyc_census_blocks`, nous pouvons donc facilement réaliser ce calcul.  
    3535 
    3636.. code-block:: sql 
    3737 
    38   -- Make a new table with a Liberty Island 500m buffer zone 
     38  -- Création d'une nouvelle table avec une zone tampon de 500 m autour de 'Liberty Island' 
    3939  CREATE TABLE libery_island_zone AS 
    4040  SELECT ST_Buffer(the_geom,500) AS the_geom  
     
    4242  WHERE blkid = '360610001009000'; 
    4343 
    44   -- Update the geometry_columns table 
     44  -- Mise à jour de la table geometry_columns 
    4545  SELECT Populate_Geometry_Columns();  
    4646   
    4747.. image:: ./geometry_returning/liberty_positive.jpg 
    4848 
    49 The :command:`ST_Buffer` function also accepts negative distances and builds inscribed polygons within polygonal inputs. For lines and points you will just get an empty return. 
     49La fonction :command:`ST_Buffer` permet aussi d'utiliser des valeur négative pour le paramÚtre distance et construit un polygone inclue dans celui passé en paramÚtre. Pour les points et les lignes vous obtiendrez simplement un résultat vide. 
    5050 
    5151.. image:: ./geometry_returning/liberty_negative.jpg 
     
    5555--------------- 
    5656 
    57 Another classic GIS operation -- the "overlay" -- creates a new coverage by calculating the intersection of two superimposed polygons. The resultant has the property that any polygon in either of the parents can be built by merging polygons in the resultant. 
     57Une autre opération classique présente dans les SIGS - le chevauchement - crée une nouvelle entité en calculant la zone correpondant à l'intersection de deux polygones supperposés. Le résultat à la propriété de permettre de reconstruire les entité de base à l'aide de ce résultat. 
    5858 
    59 The :command:`ST_Intersection(geometry A, geometry B)` function returns the spatial area (or line, or point) that both arguments have in common. If the arguments are disjoint, the function returns an empty geometry. 
     59La fonction :command:`ST_Intersection(geometry A, geometry B)` retourne la zone géographique (ou une ligne, ou un point) que les deux géométries on en commun. Si les géométries sont disjointes, la fontion retourne une géométrie vide. 
    6060 
    6161.. code-block:: sql 
    6262 
    63   -- What is the area these two circles have in common? 
    64   -- Using ST_Buffer to make the circles! 
     63  -- Quelle est l'aire que ces deux cercles ont en commun ? 
     64  -- Utilisons la fonction ST_Buffer pour créer ces cercles ! 
    6565   
    6666  SELECT ST_AsText(ST_Intersection( 
     
    7676-------- 
    7777 
    78 In the previous example we intersected geometries, creating a new geometry that had lines from both the inputs. The :command:`ST_Union` does the reverse; it takes inputs and removes common lines. There are two forms of the :command:`ST_Union` function:  
     78Dans l'exemple précédent nous intersections des géométries, créant une nouvelle géométrie unique à partir de deux entités. La commade :command:`ST_Union` fait l'inverse, elle prend en paramÚtre des géométries et supprime les parties communes. Il y a deux versions possibles de la fonction  :command:`ST_Union` :  
    7979 
    80  * :command:`ST_Union(geometry, geometry)`: A two-argument version that takes in two geometries and returns the merged union.  For example, our two-circle example from the previous section looks like this when you replace the intersection with a union. 
     80 * :command:`ST_Union(geometry, geometry)`: une version avec deux paramÚtres qui prend les géométries et rentourne l'union des deux. Par exemple, nos deux cercles ressemble à ce qui suit si nous utilisons l'opération union plutÃŽt que l'intersection. 
    8181  
    8282   .. code-block:: sql 
    8383 
    84      -- What is the total area these two circles cover? 
    85      -- Using ST_Buffer to make the circles! 
     84     -- Quelle est l'aire totale des ces deux cercles ? 
     85     -- Utilisons ST_Buffer pour créer les cercles ! 
    8686  
    8787     SELECT ST_AsText(ST_Union( 
     
    9393    
    9494 
    95  * :command:`ST_Union([geometry])`: An aggregate version that takes in a set of geometries and returns the merged geometry for the entire group. The aggregate ST_Union can be used with the ``GROUP BY`` SQL statement to create carefully merged subsets of basic geometries. It is very powerful, 
    96   
     95 * :command:`ST_Union([geometry])`: une version agrégée qui prendre un ensemble de géométries et retourne une géométrie contenant l'ensemble des géométries rassemblées. La fonction égrégée ST_Union peut être utilisé grâce au SQL ``GROUP BY`` our créer un ensemble rassemblant des sous-ensembles de géométries basiques. Cela est trÚs puissant, 
     96 
     97Par exemple la fonction d'agrégation  :command:`ST_Union`, considÚrons notre table ``nyc_census_blocks``.  
    9798As an example of :command:`ST_Union` aggregation, consider our ``nyc_census_blocks`` table. Census geography is carefully constructed so that larger geographies can be built up from smaller ones. So, we can create a census tracts map by merging the blocks that form each tract (as we do later in :ref:`creatingtractstable`). Or, we can create a county map by merging blocks that fall within each county. 
    9899 
     
    113114.. code-block:: sql 
    114115 
    115   -- Create a nyc_census_counties table by merging census blocks 
     116  -- Création d'une table nyc_census_counties en regroupant les bloques 
    116117  CREATE TABLE nyc_census_counties AS 
    117118  SELECT  
     
    121122  GROUP BY countyid; 
    122123   
    123   -- Update the geometry_columns table 
     124  -- Mise à jour de la table geometry_columns 
    124125  SELECT Populate_Geometry_Columns(); 
    125126   
     
    144145  36085    | 149806077.958252 
    145146 
    146 Then we calculate the area of each of our new county polygons from the county table: 
     147Ensuite nous calculons l'aire de chaque zone de nos nouveaux polygones de régions de la table count : 
    147148 
    148149.. code-block:: sql 
     
    161162  36085    | 149806077.958252 
    162163 
    163 The same answer! We have successfully built an NYC county table from our census blocks data. 
     164La même réponse ! Nous avons construit avec succÚs une table des régions de NYC à partir de nos données initiales. 
    164165 
    165 Function List 
    166 ------------- 
     166Liste des fonctions 
     167------------------- 
    167168 
    168 `ST_AsText(text) <http://postgis.org/docs/ST_AsText.html>`_: Returns the Well-Known Text (WKT) representation of the geometry/geography without SRID metadata. 
     169`ST_AsText(text) <http://postgis.org/docs/ST_AsText.html>`_: retourne la représentation Well-Known Text (WKT) de la geometry/geography sans métadonnée SRID. 
    169170 
    170171`ST_Buffer(geometry, distance) <http://postgis.org/docs/ST_Buffer.html>`_: For geometry: Returns a geometry that represents all points whose distance from this Geometry is less than or equal to distance. Calculations are in the Spatial Reference System of this Geometry. For geography: Uses a planar transform wrapper.  
Note: See TracChangeset for help on using the changeset viewer.