GIS preconf code4libcon2009
Open Source GIS Pre-conference at code4libcon 2009
New Material
Please try to install the software before the conference so we can have as much time as possible to actually play with GIS, and as little time as possible debugging installations.
Installation from Source
Here are Adam's original instructions (edited slightly so they format clearly on the wiki):
NB: Do not install this software as 'root'. It will not run as 'root' for security.
Download the source code
- wget http://aleph.lib.virginia.edu/providence/src.tgz
- Unpack the source: tar -xzvf src.tgz ; cd src
Install PostgreSQL 8.3.5
You can place PostgreSQL anywhere you like, but if at all possible, I strongly recommend using the default "/usr/local/pgsql". You may also put the PostgreSQL data directory where you choose.
- cd ~
- mkdir /usr/local/pgsql ; mkdir /usr/local/pgsql/data
- export PG_PREFIX=/usr/local/pgsql
- export PGDATA=/usr/local/pgsql/data
- Unpack source: tar -xzvf src.tgz ; cd src
- cd postgresql-8.3.5
- ./configure --prefix=$PG_PREFIX --with-libxml --with-libxslt --enable-thread-safety
- make ; make MAX_CONNECTIONS=10 check (MAX_CONNECTIONS avoids problems caused by limits in your OS on spawning new processes)
- make install
Install PROJ.4 4.6.0
- cd ../proj-4.6.0/
- ./configure --prefix=$PG_PREFIX
- make ; make check
- make install
Install GEOS 3.0.3
- cd ../geos-3.0.3
- ./configure --prefix=$PG_PREFIX
- make ; make check
- make install
Install PostGIS 1.3.5
- cd ../postgis-1.3.5
- ./configure --prefix=$PG_PREFIX --with-proj=$PG_PREFIX --with-pgsql=$PG_PREFIX/bin/pg_config --with-geos=$PG_PREFIX/bin/geos-config
- make
- make install
NB: PostGIS requires installation before running regression checks, because it's just a library of functions for PostgreSQL.
Put it all together
- Add our new commands to the execution path: export PATH=$PG_PREFIX/bin:$PATH
- initialize a database directory in $PGDATA, with a default character encoding of UTF-8 and a root db user with the same name as our login name: initdb -U `whoami` -E UTF-8 -W
- start the database: pg_ctl -l $PGDATA/log start
- make check
- pg_ctl stop
OSX 10.5.6 macports installation
Notes by Bess Sadler, feel free to email me with questions: bess [at] virginia [dot] edu
I tried to use Adam's directions and to compile postgres from source, but I wasn't able to do so. I kept encountering this error and I didn't have any idea how to troubleshoot it:
tab-complete.c:2103: warning: assignment makes pointer from integer without a cast make[3]: *** [tab-complete.o] Error 1 make[2]: *** [all] Error 2 make[1]: *** [all] Error 2 make: *** [all] Error 2
Instead, I used macports. It seemed to work quite well, but I haven't been able to test it with actual GIS data yet, so I'll update this as soon as I do. Here's my installation procedure:
- Install macports
- Add /opt/local/bin to /etc/paths
- sudo port install postgresql83-server postgresql83 postgresql83-doc
- Add /opt/local/lib/postgresql83/bin to /etc/paths
- sudo launchctl load -w /Library/LaunchDaemons/org.macports.postgresql83-server.plist (this command was listed in the post-installation messages for postgres, and it makes postgres start on boot)
- sudo port install proj @4.6.1
- sudo port install geos
- However, I did install postgis from source, because the latest rev wasn't available as a package:
./configure --prefix=/usr/local/postgis-1.3.5 --with-proj=/opt/local --with-pgsql=/opt/local/lib/postgresql83/bin/pg_config --with-geos=/opt/local/bin/geos-config make sudo make install
- Add /usr/local/postgis-1.3.5/bin to /etc/paths
- initialize a database directory in $PGDATA, with a default character encoding of UTF-8 and a root db user with the same name as our login name (I just explicitly declared the user id, since I wasn't sure what value `whoami` would return if the command was being run by root su-ing to the postgres user: sudo su postgres -c '/opt/local/lib/postgresql83/bin/initdb -U eos8d -E UTF-8 -W -D /usr/local/pgsql/data'
- Start that database: sudo su postgres -c '/opt/local/lib/postgresql83/bin/pg_ctl -D /usr/local/pgsql/data start'
- Run tests in postgis src directory: make check" My output looked like this:
paz:postgis-1.3.5 eos8d$ make check make -C regress test Creating spatial db postgis_reg TMPDIR is /var/folders/BP/BPimaox+FGSt3VG99a3f9++++TQ/-Tmp-/ PostgreSQL 8.3.6 on i386-apple-darwin9.6.0, compiled by GCC i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5465) Postgis 1.3.5 - 2009-02-08 21:15:08 GEOS: 3.0.3-CAPI-1.4.2 PROJ: Rel. 4.6.1, 21 August 2008 Running tests loader/Point.............. ok loader/PointM.............. ok loader/PointZ.............. ok loader/MultiPoint.............. ok loader/MultiPointM.............. ok loader/MultiPointZ.............. ok loader/Arc.............. ok loader/ArcM.............. ok loader/ArcZ.......... ok loader/Polygon.............. ok loader/PolygonM.............. ok loader/PolygonZ.............. ok regress. ok regress_index. ok regress_index_nulls. ok lwgeom_regress. ok regress_lrs. ok removepoint. ok setpoint. ok simplify. ok snaptogrid. ok affine. ok wkt. ok measures. ok long_xact. ok ctors. ok sql-mm-serialize. ok sql-mm-circularstring. ok sql-mm-compoundcurve. ok sql-mm-curvepoly. ok sql-mm-general. ok sql-mm-multicurve. ok sql-mm-multisurface. ok geojson. ok regress_ogc. ok regress_bdpoly. ok regress_ogc_cover. ok regress_proj. ok kml. ok Run tests: 39 Failed: 0
So it looks like everything worked, but I'll let the group know and update this page if I find out otherwise.