Your postgres installation hasn't got postgis. Install/re-install postgis, 
then clean your postgres database, remove all files in the databases 
directory and try again.

Paolo

On Thursday, December 21, 2017 at 3:39:13 AM UTC+1, Gabriel Schubert wrote:
>
> Hello,
>
>
> I'm trying to run this application (https://github.com/ilvalle/w2pgis 
> <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Filvalle%2Fw2pgis&sa=D&sntz=1&usg=AFQjCNEE7slkPR7z5HuWRZQa88K5chhYHA>)
>  
> and I'm getting the following problem:
>
>
> gabrielschubert@Gabriel-Notebook ~/Documents/web2py/web2py $ python web2py.py 
> -a 123 -i 127.0.0.1 -p 8000 -S leaftlet -M
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2017
> Version 2.16.1-stable+timestamp.2017.11.14.05.54.25
> Database drivers available: sqlite3, psycopg2, pg8000, pymysql, imaplib
> Traceback (most recent call last):
>   File "/home/gabrielschubert/Documents/web2py/web2py/gluon/restricted.py", 
> line 219, in restricted
>     exec(ccode, environment)
>   File "applications/leaftlet/models/db.py", line 6, in <module>
>     Field('geometry', 'geometry()'),
>   File 
> "/home/gabrielschubert/Documents/web2py/web2py/gluon/packages/dal/pydal/base.py",
>  line 586, in define_table
>     table = self.lazy_define_table(tablename, *fields, **args)
>   File 
> "/home/gabrielschubert/Documents/web2py/web2py/gluon/packages/dal/pydal/base.py",
>  line 620, in lazy_define_table
>     polymodel=polymodel)
>   File 
> "/home/gabrielschubert/Documents/web2py/web2py/gluon/packages/dal/pydal/adapters/base.py",
>  line 797, in create_table
>     return self.migrator.create_table(*args, **kwargs)
>   File 
> "/home/gabrielschubert/Documents/web2py/web2py/gluon/packages/dal/pydal/migrator.py",
>  line 277, in create_table
>     self.adapter.create_sequence_and_triggers(query, table)
>   File 
> "/home/gabrielschubert/Documents/web2py/web2py/gluon/packages/dal/pydal/adapters/base.py",
>  line 880, in create_sequence_and_triggers
>     self.execute(query)
>   File 
> "/home/gabrielschubert/Documents/web2py/web2py/gluon/packages/dal/pydal/adapters/__init__.py",
>  line 67, in wrap
>     return f(*args, **kwargs)
>   File 
> "/home/gabrielschubert/Documents/web2py/web2py/gluon/packages/dal/pydal/adapters/base.py",
>  line 412, in execute
>     rv = self.cursor.execute(command, *args[1:], **kwargs)
> ProgrammingError: relation "geostuff" already exists
>
> First time I've tried to execute, I got the following error:
>
> gabrielschubert@Gabriel-Notebook ~/Documents/web2py/web2py $ python web2py.py 
> -a 123 -i 127.0.0.1 -p 8000 -S leaftlet -M
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2017
> Version 2.16.1-stable+timestamp.2017.11.14.05.54.25
> Database drivers available: sqlite3, psycopg2, pg8000, pymysql, imaplib
> Traceback (most recent call last):
>   File "/home/gabrielschubert/Documents/web2py/web2py/gluon/restricted.py", 
> line 219, in restricted
>     exec(ccode, environment)
>   File "applications/leaftlet/models/db.py", line 6, in <module>
>     Field('geometry', 'geometry()'),
>   File 
> "/home/gabrielschubert/Documents/web2py/web2py/gluon/packages/dal/pydal/base.py",
>  line 586, in define_table
>     table = self.lazy_define_table(tablename, *fields, **args)
>   File 
> "/home/gabrielschubert/Documents/web2py/web2py/gluon/packages/dal/pydal/base.py",
>  line 620, in lazy_define_table
>     polymodel=polymodel)
>   File 
> "/home/gabrielschubert/Documents/web2py/web2py/gluon/packages/dal/pydal/adapters/base.py",
>  line 797, in create_table
>     return self.migrator.create_table(*args, **kwargs)
>   File 
> "/home/gabrielschubert/Documents/web2py/web2py/gluon/packages/dal/pydal/migrator.py",
>  line 282, in create_table
>     self.adapter.execute(query)
>   File 
> "/home/gabrielschubert/Documents/web2py/web2py/gluon/packages/dal/pydal/adapters/__init__.py",
>  line 67, in wrap
>     return f(*args, **kwargs)
>   File 
> "/home/gabrielschubert/Documents/web2py/web2py/gluon/packages/dal/pydal/adapters/base.py",
>  line 412, in execute
>     rv = self.cursor.execute(command, *args[1:], **kwargs)
> ProgrammingError: function addgeometrycolumn(unknown, unknown, unknown, 
> integer, unknown, integer) does not exist
> LINE 1: SELECT AddGeometryColumn ('', 'geostuff', 'geometry', 4326, ...
>                ^
> HINT:  No function matches the given name and argument types. You might need 
> to add explicit type casts.
>
>
> I'm using the following code:
>
>
> # -*- coding: utf-8 -*-
> db = DAL('postgres://web2py:web2py@localhost:5432/leaflet', lazy_tables=False)
>
> db.define_table('geostuff',
>     Field('name', 'string'),
>     Field('geometry', 'geometry()'),
> )
>
>
> n_rows = db(db.geostuff).count()
> if not n_rows:
>     db.geostuff.insert(name="My first geo point (London!)", 
> geometry="POINT(-0.091109 51.512622)")
>     db.geostuff.insert(name="My first linestring", geometry="LINESTRING 
> (8.791595 45.660281, 11.343062 44.494932, 10.394590 43.722998)")
>
>
> Could you help me please?
>
>
> Ty.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to