On 14 Apr 2014, at 11:48, Dan Burzynski <[email protected]> wrote: > But before... I'm attempting to set up another MapIt server via Vagrant and > I've hit a problem that I didn't when I first installed it (other than GDAL > 1.10 not compiling which I've fixed by forcing it to require 1.9)
Which version of Django do you have installed? PostGIS 2 support was added in 1.5, so you'll need to be using at least that version if you want to use PostGIS 2. The tests currently pass on 1.4-1.6, and Travis uses PostGIS 2.1, so it should be possible to get running: https://travis-ci.org/mysociety/mapit/builds/22377611 One possible solution is to use PostGIS 1.5 instead of 2, but hopefully you just need to use a more recent version of Django. I include a minimal clean install I've just done on an empty Ubuntu precise vagrant box at the end of this email. > The error was: operator class "gist_geometry_ops" does not exist for access > method "gist" > The solution to which is here: > http://postgis.net/docs/PostGIS_FAQ.html#legacy_faq_gist > But I can't find where to implement it. Notwithstanding the rest of this email, the last solution on that page could seem to apply here: "If you are unfortunate to be stuck with compiled code you can't change that has the old gist_geometry_ops hard-coded, then you can create the old class using the legacy_gist.sql packaged in PostGIS 2.0.2+." - which sounds like it would create the thing your code is expecting. But as I say you shouldn't have to do this. > The only mention of GIST_GEOMETRY_OPS in the code is in > .venv/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/creation.py > which I altered to not use it, but it still does. I very very highly recommend that you do not try and fix things by altering third-party installed code. That way lies only a world of extreme pain :) ATB, Matthew --------------------------- $ vagrant ssh vagrant@precise64:~$ sudo bash root@precise64:~# echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list root@precise64:~# wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - root@precise64:~# apt-get update root@precise64:~# apt-get install git-core postgresql-9.1-postgis-2.1 python-virtualenv memcached ruby-sass root@precise64:~# apt-get install python-psycopg2 python-gdal # System packages easier to deal with root@precise64:~# su postgres -c 'createuser -s vagrant' root@precise64:~# exit vagrant@precise64:~$ createdb mapit vagrant@precise64:~$ psql mapit -c 'create extension postgis' vagrant@precise64:~$ git clone git://github.com/mysociety/mapit.git vagrant@precise64:~$ cd mapit vagrant@precise64:~/mapit$ echo -e 'MAPIT_DB_NAME: mapit\nMAPIT_DB_USER: vagrant\nDJANGO_SECRET_KEY: secret' > conf/general.yml vagrant@precise64:~/mapit$ virtualenv ~/.venv --system-site-packages vagrant@precise64:~/mapit$ source ~/.venv/bin/activate vagrant@precise64:~/mapit$ pip install -r requirements.txt vagrant@precise64:~/mapit$ ./manage.py syncdb --noinput vagrant@precise64:~/mapit$ ./manage.py migrate The first part is in order to get PostGIS 2 from the PostgreSQL APT repo directly (Ubuntu precise only has 1.5); it then installs the required Debian pacakges, creates a vagrant db superuser to speed things up a bit, adds the postgis extension, a minimal config file, installs the python packages, and syncs the database. _______________________________________________ developers-public mailing list [email protected] https://secure.mysociety.org/admin/lists/mailman/listinfo/developers-public Unsubscribe: https://secure.mysociety.org/admin/lists/mailman/options/developers-public/archive%40mail-archive.com
