GIS and Media fusion

"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

User Tools

Site Tools


geoinf18:gql2nd

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
geoinf18:gql2nd [2018/10/30 21:45]
oertz
geoinf18:gql2nd [2018/10/31 16:49] (current)
oertz [A nous de jouer]
Line 22: Line 22:
 ===== A nous de jouer ===== ===== A nous de jouer =====
 (-> cf. documentation [[http://​postgis.net/​docs/​manual-2.0/​reference.html|PostGIS Reference]]) (-> cf. documentation [[http://​postgis.net/​docs/​manual-2.0/​reference.html|PostGIS Reference]])
-  - Quelles sont les aires des objets ? -> ST_Area2d<​code>​...</​code>​ +  - Quelles sont les aires des objets ? -> ST_Area2d<​code>​Cf2</​code>​ 
-  - Quel sont les types géométriques des objets ? -> Geometrytype<​code>​...</​code>​ +  - Quel sont les types géométriques des objets ? -> Geometrytype<​code>​ 
-  - Quel est l'​objet géométrique le plus proche du pieton 2 ? -> ST_Distance<​code>​...</​code>​ +select ST_Area(the_geom) from test where GeometryType(the_geom) = '​POLYGON';​ 
-  - Qui est dans le bâtiment 2 ? -> ST_Within<​code>​...</​code>​+</​code>​ 
 +  - Quel est l'​objet géométrique le plus proche du pieton 2 ? -> ST_Distance<​code>​ 
 +select ST_distance((select the_geom from test where genre = '​pieton2'​),​ the_geom) as dist from test where genre <> '​pieton2'​ order by dist limit 1 
 +</​code>​**Mais on doit faire mieux, sans le order by !** 
 +  - Qui est dans le bâtiment 2 ? -> ST_Within<​code>​ 
 +select genre from test as t1 where  
 +t1.genre <> '​batiment2'​  
 +and  
 +ST_Within( 
 + t1.the_geom,  
 + ​(select t2.the_geom from test as t2 where t2.genre = '​batiment2'​) 
 +
 +</​code>​
  
 //(source: [[http://​www.davidgis.fr|Jean David Techer]])// //(source: [[http://​www.davidgis.fr|Jean David Techer]])//
geoinf18/gql2nd.1540932317.txt.gz · Last modified: 2018/10/30 21:45 by oertz