ilvalle / w2pgis Goto Github PK
View Code? Open in Web Editor NEWApp to show how to use geojson(postgis/st_asgeojson) along with web2py
License: Other
App to show how to use geojson(postgis/st_asgeojson) along with web2py
License: Other
Hello,
I'm trying to run your application 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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.