Skip to content

Commit

Permalink
[oracle-stgeom] Check for not null geom before unpacking
Browse files Browse the repository at this point in the history
  • Loading branch information
bertday committed Jan 19, 2017
1 parent a2baeb9 commit 358bb71
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions datum/oracle_stgeom/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,13 @@ def read(self, fields=None, aliases=None, geom_field=None, to_srid=None,
rows = []

# Unpack geometry.
for source_row in self._c:
for i, source_row in enumerate(self._c):
if i % 5 == 0: print(i)

row = list(source_row)
if geom_field:
row[geom_field_i] = row[geom_field_i].read()
geom = row[geom_field_i]
row[geom_field_i] = geom.read() if geom else None
rows.append(row)

# If there were no rows returned, don't move on to next step where
Expand Down

0 comments on commit 358bb71

Please sign in to comment.