129 |
|
|
130 |
class PostGISTable: |
class PostGISTable: |
131 |
|
|
132 |
"""A Table in a PostGIS database""" |
"""A Table in a PostGIS database |
133 |
|
|
134 |
|
A PostgreSQL table may contain columns with types not (yet) |
135 |
|
supported by Thuban. Instances of this class ignore those columns |
136 |
|
and pretend they don't exist, i.e. they won't show up in the column |
137 |
|
descriptions returned by Columns() and other methods. |
138 |
|
""" |
139 |
|
|
140 |
def __init__(self, db, tablename): |
def __init__(self, db, tablename): |
141 |
"""Initialize the PostGISTable. |
"""Initialize the PostGISTable. |
158 |
for i in range(len(description)): |
for i in range(len(description)): |
159 |
for pgtyp, tabletyp in type_map: |
for pgtyp, tabletyp in type_map: |
160 |
if pgtyp == description[i][1]: |
if pgtyp == description[i][1]: |
161 |
col = PostGISColumn(description[i][0], tabletyp, i) |
col = PostGISColumn(description[i][0], tabletyp, |
162 |
|
len(self.columns)) |
163 |
break |
break |
164 |
else: |
else: |
165 |
if description[i][1] == self.db.geometry_type: |
if description[i][1] == self.db.geometry_type: |