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:pgheroku

Differences

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

Link to this comparison view

Next revision
Previous revision
geoinf18:pgheroku [2018/10/30 16:25]
oertz created
geoinf18:pgheroku [2018/10/30 18:02] (current)
oertz
Line 1: Line 1:
-====== ​PostgreSQL/PostGIS avec le service ​de cloud PaaS Heroku ======+====== PostGIS avec le service PaaS Heroku ====== 
 +**Objectif : déployer une app Heroku basée sur PHP et PostgreSQL avec l'​extension PostGIS**
  
 +Démarche en 4 étapes :
  
 +  - Suivre les étapes **Introduction,​ Set up, Prepare the app, Deploy the app** de //Getting Started on Heroku with PHP// https://​devcenter.heroku.com/​articles/​getting-started-with-php#​introduction
 +    - suivre aussi l'​étape **Push local changes**, mais à la place de l'​utilisation de //Cowsay//, on propose simplement d'​ajouter un script PHP qui exécute la fonction //​phpinfo()//​ --- l'​appel de ce script dans un navigateur permettra de voir la configuration PHP avec Heroku
 +    - l'​étape **Provision a database** est remplacée par l'​exécution de la commande (attache et initialise une base de données Postgresql à l'​application PHP)<​code>​
 +heroku addons:​create heroku-postgresql
 +</​code>​
 +  - Accéder au tableau de bord Heroku Data - https://​data.heroku.com
 +    - sélectionner la BD que vous venez de créer qui se rattache à votre application PHP
 +    - l'​onglet Settings montre les informations d'​identification pour les connexions manuelles à cette base de données (host URL, dbname, user, password)
 +  - Choisir un outil console SQL pour se connecter à PostgreSQL ​
 +    - avec l'​application pgAdmin3 - https://​www.pgadmin.org/​ (suivre alors au point n°4)
 +    - OU avec psql dans un shell interactif ([[https://​devcenter.heroku.com/​articles/​getting-started-with-php#​start-an-interactive-shell|bash]]) :
 +      - dans le dossier local de votre app heroku, lancer <​code>​heroku run bash</​code>​
 +      - après connexion, à l'​invite de commande bash, lancer <​code>​psql -U #​heroku_dbuser#​ -h #​heroku_dbhost.amazonaws.com#​ -d #​dbname#</​code>​
 +      - à l'​invite de commande psql, saisir une commande <​code>​
 +select postgis_version(); ​  # for informations about installed PostGIS ​
 +\h # for help with SQL commands
 +\? # for help with psql commands
 +</​code>​
 +  - Ajouter l'​extension PostGIS à la base - https://​devcenter.heroku.com/​articles/​heroku-postgres-extensions-postgis-full-text-search#​postgis
 +    - exécuter la commande SQL ci-dessous qui doit ajouter l'​extension PostGIS à cette instance de base de données<​code>​create extension postgis</​code>​
 +    - voyez l'​apparition de nouvelles tables et vues (commande psql \d en shell interactif ou faire un refresh dans pgAdmin)
  
 +{{:​geoinf18:​screenshot_from_2018-10-30_17-59-47.png?​nolink|}}
geoinf18/pgheroku.1540913157.txt.gz · Last modified: 2018/10/30 16:25 by oertz