"The explosive growth of the GeoWeb and geographic information has made GIS powerful media for the general public to communicate, but perhaps more importantly, GIS have also become media for constructive dialogs and interactions about social issues." - Sui & Goodchild
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
ogo11:gql:exo1 [2013/04/25 08:59] oertz |
ogo11:gql:exo1 [2013/04/25 09:17] oertz |
||
---|---|---|---|
Line 34: | Line 34: | ||
<code>voir n°2</code> | <code>voir n°2</code> | ||
* **2. Quel sont les types géométriques des objets ?** -> Geometrytype | * **2. Quel sont les types géométriques des objets ?** -> Geometrytype | ||
- | <code>SELECT id, genre, ST_Area2d(geom), ST_Geometrytype(geom) FROM test;</code> | + | <code>SELECT id, genre, ST_Area2d(geom) FROM test WHERE ST_Geometrytype(geom) = 'ST_Polygon';</code> |
* **3. Qui est dans le bâtiment 2 ?** -> ST_Distance, ST_Within | * **3. Qui est dans le bâtiment 2 ?** -> ST_Distance, ST_Within | ||
<code> | <code> | ||
Line 51: | Line 51: | ||
</code> | </code> | ||
* **4. Quel est l'objet géométrique le plus proche du pieton 2 ?** -> ST_Distance | * **4. Quel est l'objet géométrique le plus proche du pieton 2 ?** -> ST_Distance | ||
- | <code>...</code> | + | <code> |
+ | SELECT t1.genre FROM test t1, test t2 WHERE | ||
+ | t2.genre LIKE 'pieton 2' | ||
+ | AND | ||
+ | ST_Distance(t1.geom,t2.geom) = | ||
+ | ( | ||
+ | SELECT min(ST_Distance(t1.geom, t2.geom)) FROM test t1, test t2 | ||
+ | WHERE t1.genre LIKE 'pieton 2' AND t2.genre <> 'pieton 2' | ||
+ | ) | ||
+ | </code> | ||
//(source: [[http://www.davidgis.fr|Jean David Techer]])// | //(source: [[http://www.davidgis.fr|Jean David Techer]])// |