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 |
|
|
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 |