-
Notifications
You must be signed in to change notification settings - Fork 2
Installation PostGIS sous Mac OS X Lion
Installer GeoDjango sous Mac OS X peut être galère...
Commencer par installer GDAL Complete : http://www.kyngchaos.com/software/frameworks puis PostgreSQL 9.1 et PostGIS 2.0.1 : http://www.kyngchaos.com/software/postgres (ne pas prendre la version client)
Avantages de cette installation :
- clic clic...
- le super-user correspond à votre utilisateur (vaut mieux qu'il soit admin)
- ces installeurs sont maintenus et permettent les mises à jour plus tard
Procédure pour mettre les locale françaises par défaut une fois PG installé :
cd /usr/local/pgsql sudo rm -rf data cd /tmp sudo mkdir /usr/local/pgsql-9.1/data sudo chown -R dom /usr/local/pgsql-9.1/data /usr/local/pgsql-9.1/var /usr/local/pgsql-9.1/bin/initdb -D /usr/local/pgsql-9.1/data --encoding=UTF8 --locale=fr_FR sudo chown -R _postgres:_postgres /usr/local/pgsql/data sudo chown -R _postgres:admin /usr/local/pgsql/var sudo launchctl load -w /Library/LaunchDaemons/org.postgresql.postgres.plist
Pour avoir les commandes accessibles depuis le terminal, éditer .bashrc ou .bash_profile pour y ajouter :
export PATH=/Library/Frameworks/UnixImageIO.framework/Programs:$PATH export PATH=/Library/Frameworks/PROJ.framework/Programs:$PATH export PATH=/Library/Frameworks/GEOS.framework/unix/bin:$PATH export PATH=/Library/Frameworks/SQLite3.framework/Programs:$PATH export PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH export PATH=/usr/local/pgsql-9.1/bin:$PATH
Enfin, procédure mise à jour pour créer le template_postgis indispensable à la creation de bases avec support GIS :
createdb template_postgis psql -d postgres -c "UPDATE pg_database SET datistemplate='true' WHERE datname='template_postgis';" POSTGIS_SQL_PATH=`pg_config --sharedir`/contrib/postgis-2.0 psql -d template_postgis -f $POSTGIS_SQL_PATH/postgis.sql psql -d template_postgis -f $POSTGIS_SQL_PATH/spatial_ref_sys.sql psql -d template_postgis -f $POSTGIS_SQL_PATH/postgis_comments.sql psql -d template_postgis -c "GRANT ALL ON geometry_columns TO PUBLIC;" psql -d template_postgis -c "GRANT ALL ON geography_columns TO PUBLIC;" psql -d template_postgis -c "GRANT ALL ON spatial_ref_sys TO PUBLIC;"
Enfin Psycopg2 : http://www.kyngchaos.com/software/python
Il est nécessaire pour pouvoir utiliser le driver spécifique à PostGIS https://docs.djangoproject.com/en/dev/ref/contrib/gis/tutorial/#configure-settings-py
Sur la meme page il y a PIL, pourquoi se priver... : http://www.kyngchaos.com/software/python
h2. Autres references :
PostGIS sous Ubuntu 12.04 : http://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS20Ubuntu1204 Démarrer avec mapBox : http://mapbox.com/tilemill/docs/guides/osm-bright-mac-quickstart/