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

    r22 r1  
    11.. _spatial_relationships: 
    22 
    3 Partie 10 : relations spatiales 
     3Section 10: Spatial Relationships 
    44================================= 
    55 
    6 Jusqu'à maintenant nous n'avons utilisé que des fonctions qui permettent de mesurer (:command:`ST_Area`, :command:`ST_Length`), de serialiser (:command:`ST_GeomFromText`) ou désérialiser (:command:`ST_AsGML`) des géométries. Ces fonctions ont en commun de fonctionner uniquement sur une géométrie à la fois. 
     6So far we have only used spatial functions that measure (:command:`ST_Area`, :command:`ST_Length`), serialize (:command:`ST_GeomFromText`) or deserialize (:command:`ST_AsGML`) geometries. What these functions have in common is that they only work on one geometry at a time. 
    77 
    8 Les base de données spatiales sont puissantes car elle ne font pas que stoquer les géométries, elle ont aussi la faculté de vérifier les *relations entre les géométries*. 
     8Spatial databases are powerful because they not only store geometry, they also have the ability to compare *relationships between geometries*.  
    99 
    10 Pour les questions comme "Quel est le plus proche garage à vélo prêt du park ?" ou "Ou est l'intersection du métros avec telle rue ?" nous devrons comparer les géométries représentant les garage à vélo, les rues et les lignes de métros. 
     10Questions like “Which are the closet bike racks to a park?” or “Where are the intersections of subway lines and streets?” can only be answered by comparing geometries representing the bike racks, streets, and subway lines. 
    1111 
    12 Le standard de l'OGC définit l'ensemble suivant de fonctions pour comparer les géométries. 
     12The OGC standard defines the following set of methods to compare geometries. 
    1313 
    1414ST_Equals 
    1515--------- 
    1616  
    17 :command:`ST_Equals(geometry A, geometry B)` test l'égalité spatiale de deux géométries.  
     17:command:`ST_Equals(geometry A, geometry B)` tests the spatial equality of two geometries.  
    1818 
    1919.. figure:: ./spatial_relationships/st_equals.png 
    2020   :align: center 
    2121 
    22 ST_Equals retourne TRUE si les deux géométries sont du même type, ont des coordonnées x.y identiques. 
     22ST_Equals returns TRUE if two geometries of the same type have identical x,y coordinate values, i.e. if the secondary shape is equal (identical) to the primary shape object. 
    2323 
    24 PremiÚrement, essayons de récupérer la représentation d'un point de notre table ``nyc_subway_stations``. Nous ne prendrons que l'entrée : 'Broad St'. 
     24First, let's retrieve a representation of a point from our ``nyc_subway_stations`` table. We'll take just the entry for 'Broad St'. 
    2525 
    2626.. code-block:: sql 
     
    3636   Broad St | 0101000020266900000EEBD4CF27CF2141BC17D69516315141 | POINT(583571 4506714) 
    3737  
    38 Maintenant, copiez / collez la valeur afficher pour tester la fonction :command:`ST_Equals`: 
     38Then, plug the geometry representation back into an :command:`ST_Equals` test: 
    3939 
    4040.. code-block:: sql 
     
    5050.. note:: 
    5151 
    52   La représentation du point n'est pas vraiment compréhensible (``0101000020266900000EEBD4CF27CF2141BC17D69516315141``) mais c'est exactement la représentation des coordonnées. Pour tester l'égalité, utiliser ce format est nécessaire. 
     52  The representation of the point was not very human readable (``0101000020266900000EEBD4CF27CF2141BC17D69516315141``) but it was an exact representation of the coordinate values. For a test like equality, using the exact coordinates in necessary. 
    5353 
    5454 
    55 ST_Intersects, ST_Disjoint, ST_Crosses et ST_Overlaps 
     55ST_Intersects, ST_Disjoint, ST_Crosses and ST_Overlaps 
    5656------------------------------------------------------ 
    5757 
    58 :command:`ST_Intersects`, :command:`ST_Crosses`, et :command:`ST_Overlaps` test si l'intérieur des géométries s'intersect, se croise ou se chevauche. 
     58:command:`ST_Intersects`, :command:`ST_Crosses`, and :command:`ST_Overlaps` test whether the interiors of the geometries intersect.  
    5959 
    6060.. figure:: ./spatial_relationships/st_intersects.png 
    6161   :align: center 
    6262 
    63 :command:`ST_Intersects(geometry A, geometry B)` retourne t (TRUE) si l'intersection ne rénvoit pas un ensemble vide de résultats. Intersects retourne le résultat exactement inverse de la fonction disjoint. 
     63:command:`ST_Intersects(geometry A, geometry B)` returns t (TRUE) if the intersection does not result in an empty set. Intersects returns the exact opposite result of disjoint. 
    6464 
    6565.. figure:: ./spatial_relationships/st_disjoint.png 
    6666   :align: center 
    6767 
    68 L'opposé de ST_Intersects est :command:`ST_Disjoint(geometry A , geometry B)`. Si deux géométries sont disjointes, elle ne s'intersectent pas et vice-versa. En fait, il est souvent plus éfficace de tester si deux géométries ne s'intersectent pas que de tester si elles sont dijointes du fait que le test d'intersection peut être spatialement indexé alors que le test disjoint ne le peut pas. 
     68The opposite of ST_Intersects is :command:`ST_Disjoint(geometry A , geometry B)`. If two geometries are disjoint, they do not intersect, and vice-versa. In fact, it is often more efficient to test "not intersects" than to test "disjoint" because the intersects tests can be spatially indexed, while the disjoint test cannot. 
    6969 
    7070.. figure:: ./spatial_relationships/st_crosses.png   
    7171   :align: center 
    72  
    73 Pour les comparaisons de couples de types multipoint/polygon, multipoint/linestring, linestring/linestring, linestring/polygon, et linestring/multipolygon, :command:`ST_Crosses(geometry A, geometry B)` retourne t (TRUE) si les résultats de l'intersection  
    7472 
    7573For multipoint/polygon, multipoint/linestring, linestring/linestring, linestring/polygon, and linestring/multipolygon comparisons, :command:`ST_Crosses(geometry A, geometry B)` returns t (TRUE) if the intersection results in a geometry whose dimension is one less than the maximum dimension of the two source geometries and the intersection set is interior to both source geometries. 
     
    7876   :align: center 
    7977 
    80 :command:`ST_Overlaps(geometry A, geometry B)` compare deux géométries de même dimension et retourne TRUE si leur intersection est une géométrie différente des deux fournies mais de même dimension. 
     78:command:`ST_Overlaps(geometry A, geometry B)` compares two geometries of the same dimension and returns TRUE if their intersection set results in a geometry different from both but of the same dimension. 
    8179 
    82 Essayons de prendre la station de métro de Broad Street et de déterminer sont voisinage en utilisant la fonction :command:`ST_Intersects` : 
     80Let's take our Broad Street subway station and determine its neighborhood using the :command:`ST_Intersects` function: 
    8381 
    8482.. code-block:: sql 
     
    9997---------- 
    10098 
    101 :command:`ST_Touches` test si deux géométries se touchent en leur contour extérieur, mais leur contours intérieur ne s'intersectent pas 
     99:command:`ST_Touches` tests whether two geometries touch at their boundaries, but do not intersect in their interiors  
    102100 
    103101.. figure:: ./spatial_relationships/st_touches.png 
    104102   :align: center 
    105103 
    106 :command:`ST_Touches(geometry A, geometry B)` retourn TRUE soit si les contours des géométries s'intersectent ou si l'un des contours intérieur de l'une intersecte le contour extérieur de l'autre. 
     104:command:`ST_Touches(geometry A, geometry B)` returns TRUE if either of the geometries' boundaries intersect or if only one of the geometry's interiors intersects the other's boundary. 
    107105 
    108 ST_Within et ST_Contains 
     106ST_Within and ST_Contains 
    109107------------------------- 
    110108 
    111 :command:`ST_Within` et :command:`ST_Contains` test si une géométrie est totalement incluse dans l'autre.  
     109:command:`ST_Within` and :command:`ST_Contains` test whether one geometry is fully within the other.  
    112110 
    113111.. figure:: ./spatial_relationships/st_within.png 
    114112   :align: center 
    115113     
    116 :command:`ST_Within(geometry A , geometry B)` retourne TRUE si la premiÚre géométries est complÚtement contenue dans l'autre. ST_Within test l'exact opposé au résultat de ST_Contains.   
     114:command:`ST_Within(geometry A , geometry B)` returns TRUE if the first geometry is completely within the second geometry. ST_Within tests for the exact opposite result of ST_Contains.   
    117115 
    118 :command:`ST_Contains(geometry A, geometry B)` retourne TRUE si la seconde géométries est complÚtement contenue dans la premiÚre géométrie. 
     116:command:`ST_Contains(geometry A, geometry B)` returns TRUE if the second geometry is completely contained by the first geometry.  
    119117 
    120118 
    121 ST_Distance et ST_DWithin 
     119ST_Distance and ST_DWithin 
    122120-------------------------- 
    123121 
    124 Une question qui arrive fréquemment dans le domaine du SIG est "trouver tout les trucs qui se trouve à une distance X de cet autre truc". 
     122An extremely common GIS question is "find all the stuff within distance X of this other stuff".  
    125123 
    126 La fonction :command:`ST_Distance(geometry A, geometry B)` calcule la *plus courte* distance entre deux géoémétries. Cela est pratique pour récupérer la distance entre les objets. 
     124The :command:`ST_Distance(geometry A, geometry B)` calculates the *shortest* distance between two geometries and returns it as a float. This is useful for actually reporting back the distance between objects. 
    127125 
    128126.. code-block:: sql 
     
    136134  3 
    137135 
    138 Pour tester si deux obets sont à la même distance d'un autre, la fonction :command:`ST_DWithin` fournit une test tirant proffit des indexes. Cela est trÚs utile pour répondre au questions du genre : "Combien d'arbre se situe dans un buffer de 500 mÚtres autour de cette route ?". Vous n'avez pas à calculer le buffer, vous avez simplement besoin de tester la distance entre les géométries. 
     136For testing whether two objects are within a distance of one another, the :command:`ST_DWithin` function provides an index-accelerated true/false test. This is useful for questions like "how many trees are within a 500 meter buffer of the road?". You don't have to calculate an actual buffer, you just have to test the distance relationship. 
    139137 
    140138  .. figure:: ./spatial_relationships/st_dwithin.png 
    141139     :align: center 
    142140     
    143 En utilisant de nouveau notre station de métros Broad Street, nous pouvons trouver les rues voisines (à 10 mÚtres de) de la station : 
     141Using our Broad Street subway station again, we can find the streets nearby (within 10 meters of) the subway stop: 
    144142 
    145143.. code-block:: sql 
     
    161159     Nassau St 
    162160 
    163 Nous pouvons vérifier la réponse sur une carte. La station Broad St est actuellement à l'intersection des rues Wall, Broad et Nassau.  
     161And we can verify the answer on a map. The Broad St station is actually at the intersection of Wall, Broad and Nassau Streets. 
    164162 
    165163.. image:: ./spatial_relationships/broad_st.jpg 
    166164 
    167 Liste des fonctions 
    168 ------------------- 
     165Function List 
     166------------- 
    169167 
    170 `ST_Contains(geometry A, geometry B) <http://postgis.org/docs/ST_Contains.html>`_ : retourne TRUE si aucun des points de B n'est à l'extérieur de A, et au moins un point de l'intérieur de B est à l'intérieur de A. 
     168`ST_Contains(geometry A, geometry B) <http://postgis.org/docs/ST_Contains.html>`_: Returns true if and only if no points of B lie in the exterior of A, and at least one point of the interior of B lies in the interior of A. 
    171169 
    172 `ST_Crosses(geometry A, geometry B)  <http://postgis.org/docs/ST_Crosses.html>`_ : retourne TRUE si la géométrie A a certains, mais pas la totalité de, ses points à l'intérieur de B. 
     170`ST_Crosses(geometry A, geometry B)  <http://postgis.org/docs/ST_Crosses.html>`_: Returns TRUE if the supplied geometries have some, but not all, interior points in common. 
    173171 
    174 `ST_Disjoint(geometry A , geometry B) <http://postgis.org/docs/ST_Disjoint.html>`_ : retourne TRUE si les gémétries nes s'intersectent pas - elles n'ont aucun point en commun. 
     172`ST_Disjoint(geometry A , geometry B) <http://postgis.org/docs/ST_Disjoint.html>`_: Returns TRUE if the Geometries do not "spatially intersect" - if they do not share any space together. 
    175173 
    176 `ST_Distance(geometry A, geometry B)  <http://postgis.org/docs/ST_Distance.html>`_ : retourne la distance cartésienne en 2 dimensions minimum entre deux géométries dans l'unité de la projection.  
     174`ST_Distance(geometry A, geometry B)  <http://postgis.org/docs/ST_Distance.html>`_: Returns the 2-dimensional cartesian minimum distance (based on spatial ref) between two geometries in projected units.  
    177175 
    178 `ST_DWithin(geometry A, geometry B, radius) <http://postgis.org/docs/ST_DWithin.html>`_ : retourne TRUE si les géométries sont distante (radius) l'une de l'autre.  
     176`ST_DWithin(geometry A, geometry B, radius) <http://postgis.org/docs/ST_DWithin.html>`_: Returns true if the geometries are within the specified distance (radius) of one another.  
    179177 
    180 `ST_Equals(geometry A, geometry B) <http://postgis.org/docs/ST_Equals.html>`_ : retourn TRUE si les géométries fournis représentent la même géométrie. L'ordre des entités n'est pas prit en compte. 
     178`ST_Equals(geometry A, geometry B) <http://postgis.org/docs/ST_Equals.html>`_: Returns true if the given geometries represent the same geometry. Directionality is ignored. 
    181179 
    182 `ST_Intersects(geometry A, geometry B) <http://postgis.org/docs/ST_Intersects.html>`_ : retourne TRUE si les géométries s'intersectent - (ont un espace en commun) et FALSE si elles n'en ont pas (elles sont disjointes).  
     180`ST_Intersects(geometry A, geometry B) <http://postgis.org/docs/ST_Intersects.html>`_: Returns TRUE if the Geometries/Geography "spatially intersect" - (share any portion of space) and FALSE if they don't (they are Disjoint).  
    183181 
    184 `ST_Overlaps(geometry A, geometry B) <http://postgis.org/docs/ST_Overlaps.html>`_ : retourne TRUE si les géométries ont un espace en commun, sont de la même dimension, mais ne sont pas complÚtement contenu l'une dans l'autre. 
     182`ST_Overlaps(geometry A, geometry B) <http://postgis.org/docs/ST_Overlaps.html>`_: Returns TRUE if the Geometries share space, are of the same dimension, but are not completely contained by each other. 
    185183 
    186 `ST_Touches(geometry A, geometry B)  <http://postgis.org/docs/ST_Touches.html>`_ : retourne TRUE si les géométries ont au moins un point en commun, mais leur intérieurs ne s'intersectent pas. 
     184`ST_Touches(geometry A, geometry B)  <http://postgis.org/docs/ST_Touches.html>`_: Returns TRUE if the geometries have at least one point in common, but their interiors do not intersect. 
    187185 
    188 `ST_Within(geometry A , geometry B) <http://postgis.org/docs/ST_Within.html>`_ : retourne TRUE si la géométrie A est complÚtement à l'intérieur de B 
     186`ST_Within(geometry A , geometry B) <http://postgis.org/docs/ST_Within.html>`_: Returns true if the geometry A is completely inside geometry B 
    189187 
    190188 
Note: See TracChangeset for help on using the changeset viewer.