Skip to content

Commit

Permalink
Merge pull request #34795 from jgrocha/fix-db-manager-extent-to-string
Browse files Browse the repository at this point in the history
Fix TypeError when displaying Postgis layers extent
  • Loading branch information
rouault committed Mar 11, 2020
2 parents 0ee1d12 + c5c7427 commit ab1755c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions python/plugins/db_manager/db_plugins/info_model.py
Expand Up @@ -397,12 +397,18 @@ def spatialInfo(self):
self.table.blockSignals(False)

if self.table.estimatedExtent is not None and self.table.estimatedExtent[0] is not None:
estimated_extent_str = '%.5f, %.5f - %.5f, %.5f' % self.table.estimatedExtent
if isinstance(self.table.estimatedExtent, list):
estimated_extent_str = ', '.join('%.5f' % e for e in self.table.estimatedExtent)
else:
estimated_extent_str = '%.5f, %.5f - %.5f, %.5f' % self.table.estimatedExtent
tbl.append((QApplication.translate("DBManagerPlugin", "Estimated extent:"), estimated_extent_str))

# extent
if self.table.extent is not None and self.table.extent[0] is not None:
extent_str = '%.5f, %.5f - %.5f, %.5f' % self.table.extent
if isinstance(self.table.extent, list):
extent_str = ', '.join('%.5f' % e for e in self.table.extent)
else:
extent_str = '%.5f, %.5f - %.5f, %.5f' % self.table.extent
else:
extent_str = QApplication.translate("DBManagerPlugin",
'(unknown) (<a href="action:extent/get">find out</a>)')
Expand Down

0 comments on commit ab1755c

Please sign in to comment.