PostGreSQL_PostGIS_WMS
- http://docs.postgresql.fr/7.4/tutorial-accessdb.html
- http://www.bostongis.com/?content_name=loading_osm_postgis#229
Premiers pas
Version utilisée
- PostGreApp : http://postgresapp.com/
- Doc : http://postgresapp.com/documentation/cli-tools.html
PG Admin 3
Terminal
createdb gis # crée la db « gis »
psql gis # entre dans la db « gis »
Quand on est sur la db, la ligne commence par
gis=#
là, on rentre les commandes sur la base
Pour quitter la BDD
gis=#\q
Quelques exemples de commande
\list or \l: # list all databases
ou, en mode shell
psql -l
\dt: # list all tables in the current database
Créer les capacité postgis de la base
CREATE EXTENSION postgis
CREATE EXTENSION postgis_topology
psql -d gis -c 'CREATE EXTENSION postgis; CREATE EXTENSION hstore;'
Import w/ osm2pgsql (fichier schwaben-latest.osm.pbf)
Problème de connexion jusqu’à ce que je mette ## -H localhost
osm2pgsql schwaben-latest.osm.pbf -H localhost -r pbf
Exemples de requêtes sur la base importée
SELECT * FROM public.planet_osm_roads WHERE name='Vorarlberg'