maschinenmensch / edifice

A database of the built environment in Chicago
5 stars 1 forks source link

add friendly instructions for installing postGIS #14

Open derekeder opened 11 years ago

derekeder commented 11 years ago

Based on what environment people have, give friendly instructions for

mccc commented 11 years ago

I ultimately wound up installing PostGIS 2.0.2 from source — is there a better way?

On my slightly decrepit MacBook (OS X 10.6.8) the whole path for getting Edifice-ready was:

$ sudo port install postgresql92-server

Then to initialize a default database with Unicode (i.e. template0 and template1, I think)

$ sudo su postgres -c '/opt/local/lib/postgresql92/bin/initdb --locale=en_US.UTF-8 --encoding=UNICODE -D /opt/local/var/db/postgresql92/defaultdb'

Finally, to get the local Postgres database to start and stop on boot:

$ sudo launchctl load -w /Library/LaunchDaemons/org.macports.postgresql92-server.plist 

Then my successful compile of the PostGIS 2.0.2 source code looked like this:

~/src/postgis-2.0.2$ ./configure --with-geosconfig=/Library/Frameworks/GEOS.framework/unix/bin/geos-config  --with-projdir='/Library/Frameworks/PROJ.framework//Versions/4/unix' --with-pgconfig=/opt/local/lib/postgresql92/bin/pg_config

This was after installing the GEOS and PROJ frameworks from the http://www.kyngchaos.com/software/frameworks page (very handy -- especially if you want to get QGIS working).

If you have taken notes on other workflows, please post them and we can be as generic and/or specific as possible in the docs.

jpvelez commented 11 years ago

There's totally a better way, but it requires upgrading to OSX 10.7: http://postgresapp.com/

On Sat, Feb 2, 2013 at 12:56 AM, Michael Castelle notifications@github.comwrote:

I ultimately wound up installing PostGIS 2.0.2 from source — is there a better way?

On my slightly decrepit MacBook (OS X 10.6.8) the path for installing PostgreSQL 9.2 was:

  • sudo port install postgresql92-server

Then to initialize a default database with Unicode (i.e. template0 and template1, I think)

  • sudo bash
  • su - postgres
  • /opt/local/lib/postgresql92/bin/initdb --locale=en_US.UTF-8 --encoding=UNICODE -D /opt/local/var/db/postgresql92/defaultdb

Then my successful compile of the PostGIS

— Reply to this email directly or view it on GitHubhttps://github.com/maschinenmensch/edifice/issues/14#issuecomment-13025704.

mccc commented 11 years ago

I think someone at the last Hack Night was having a particular issue with that one-stop install, but I can't remember if we resolved it or not, or if it was unrelated. Derek?

(From reading this: http://postgresapp.com/documentation , I could imagine there being an issue in that the psql client being used (i.e. the one that ships with OS X 10.7) is not going to be of the same version as the server, but maybe not.)

mccc commented 11 years ago

So, the issue with the one-stop installer is that setup_edifice.py needs various command-line binaries, including dropdb, createdb, pg_restore, etc. that may not be included inside something that solely goes in your /Applications directory. I can see the appeal (as newer OS Xs include a /usr/bin/psql client), but I don't think this is appropriate..