Giter Club home page Giter Club logo

w2pgis's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

tazjel dantoac

w2pgis's Issues

Database issue

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.