Guide to compile and install PostGIS 2 on FreeBSD with PostgreSQL 9.2
[work in progress.]
Currently there is no PostGIS2 port, so you will have to compile directly from source.
Follow generic guide here: http://postgis.net/docs/manual-2.0/postgis_installation.html
FreeBSD specific guide:
Check PostgreSQL installed
pkg_info | grep sql
Upgrade to PostgreSQL 9.2 [not needed as long as you have >9.0, but as this is a development server, I moved to 9.2]
pg_dumpall > dumpfilename.sql [have to be proper user]
mv pgsql pgsql_dump_
make install clean [config as needed]
repeat for contrib
[see for better instructions on upgrading: http://www.b1c1l1.com/blog/2011/01/01/upgrading-postgresql-on-freebsd/]
Upgrade PGAdmin3 to 1.16 to work with PostgreSQL 9.2
Throws an error when port is compiled. I took the easy way and installed the newest PBI
Use 'pkg_info |grep gdal' to check for gdal, proj4, and other dependencies
Install/upgrade as required from ports
make install clean …….
tar -xvzf postgis-2.0.7.tar.gz
First got iconv.h configuration errors. Tried to link to iconv work directories - no go. Use ./configure —with-… as in provided link. https://gist.github.com/4015581
$ make install
Go to PGAdmin3 → database you want the spatial extensions on → extensions → add new extension → choose postgis & postgis topology
Remember to have fun!