Cannot determine PostGIS version

132 views
Skip to first unread message

Hyeuk Ryu

unread,
Sep 14, 2015, 12:24:00 AM9/14/15
to OpenQuake Users
Hi,

I've got another error message while trying a demo run:

ImproperlyConfigured: Cannot determine PostGIS version for database "openquake2". GeoDjango requires at least PostGIS version 1.3. Was the database created from a spatial database template?

Could you let me know how to fix it? 
Thanks.

Regards,

Hyeuk

Daniele Viganò

unread,
Sep 14, 2015, 1:04:13 AM9/14/15
to openqua...@googlegroups.com
Dear User,

which version of PostgreSQL, PostGIS and Django are you using?

Have you created the database using the oq_create_db command?

You can try doing the following:

1) test your Postgis setup
sudo -u postgres psql -d openquake2 -c "SELECT postgis_lib_version();"

2) force the PostGIS version in Django
echo "POSTGIS_VERSION = (2, 0, 3)" >> /path/to/oq-engine/openquake/engine/local_settings.py

/path/to/oq-engine/ should be the path of the oq-engine sources (it looks like you are not using packages) and (2,0,3) must be replaces with your PostGIS version.

Best,
Daniele
--
You received this message because you are subscribed to the Google Groups "OpenQuake Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openquake-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
DANIELE VIGANÒ | System Administrator | Skype dennyv85 | +39 0382 5169882
GLOBAL EARTHQUAKE MODEL | working together to assess risk

Hyeuk Ryu

unread,
Sep 28, 2015, 7:35:34 PM9/28/15
to OpenQuake Users

Hi Daniele,


Here is the log after oq-create_db commands.


rhe-compute1:~ u73560$ sudo -u postgres /usr/local/openquake/oq-engine-master/openquake/engine/bin/oq_create_db

.. creating roles ..

.. Current table spaces: hzrdi_ts hzrdr_ts pg_default pg_global riski_ts riskr_ts uiapi_ts

WARNING: there is already a openquake2 database.


Thanks.


Regards,


Hyeuk

Hyeuk Ryu

unread,
Sep 29, 2015, 1:34:44 AM9/29/15
to OpenQuake Users
Hi Daniele,

I ran the two demos as below and I got the database error message with: 

oq-engine --rh=/usr/share/doc/python-oq-risklib-0.8.0/demos/ScenarioRisk/job_hazard.ini

but it ran okay with 

$oq-engine --rh=/usr/share/doc/python-oq-risklib-0.8.0/demos/AreaSourceClassicalPSHA/job.ini

Any clue?
Thanks.

Regars,

Hyeuk
Reply all
Reply to author
Forward
0 new messages