/[thuban]/branches/WIP-pyshapelib-bramz/test/postgissupport.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/test/postgissupport.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2714 by bernhard, Mon Nov 6 10:09:14 2006 UTC revision 2717 by bernhard, Mon Jan 1 21:44:05 2007 UTC
# Line 712  def upload_shapefile(filename, db, table Line 712  def upload_shapefile(filename, db, table
712    
713      srid -- The srid of the spatial references system used by the table      srid -- The srid of the spatial references system used by the table
714              and the data              and the data
715    
716        The tables will be explicitely created WITH OIDS. This has been
717        default for PostgreSQL <8.0 and some tests relied on it (end of 2006).
718      """      """
719      import dbflib, shapelib      import dbflib, shapelib
720    
# Line 750  def upload_shapefile(filename, db, table Line 753  def upload_shapefile(filename, db, table
753          fields.append(name)          fields.append(name)
754          fields_decl.append("%s %s" % (name, typemap[ftype]))          fields_decl.append("%s %s" % (name, typemap[ftype]))
755          insert_formats.append("%%(%s)s" % name)          insert_formats.append("%%(%s)s" % name)
756      stmt = "CREATE TABLE %s (\n    %s\n);" % (tablename,      stmt = "CREATE TABLE %s (\n    %s\n) WITH OIDS ;" % (tablename,
757                                                ",\n    ".join(fields_decl))                                                ",\n    ".join(fields_decl))
758      cursor.execute(stmt)      cursor.execute(stmt)
759      #print stmt      #print stmt

Legend:
Removed from v.2714  
changed lines
  Added in v.2717

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26