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


ogo12:postgis

Geographic Query Language avec PostGIS

PostGIS, le cartouche géospatial de PostgreSQL, ajoute un nouveau type de données, geometry, ainsi que plus de 700 opérateurs permettant de le manipuler par des requêtes SQL. Nous allons voir dans la suite un échantillon de ces possibilités.

Pour se familiariser, travaillons ces deux suites d'exercices : exo1 exo2

Ne pas oublier l'indispensable documentation avec son chapitre PostGIS Reference


Quelques snippets de code QGL :

  • Transformation de projection pour un point (longitude X, latitude Y)
SELECT AsText(ST_Transform(GeometryFromText('POINT(833838 295935)', 21781 ), 4326));
  • Utilisation de ST_AsGeoJSON pour faciliter le dialogue avec le client web (ex. OpenLayers)
SELECT genre, ST_AsGeoJSON(geom) FROM test WHERE genre LIKE 'batiment%';
ogo12/postgis.txt · Last modified: 2018/05/15 17:18 (external edit)