Skip to content
Permalink
Browse files

Merge pull request #34795 from jgrocha/fix-db-manager-extent-to-string

Fix TypeError when displaying Postgis layers extent
  • Loading branch information
rouault committed Mar 11, 2020
2 parents 0ee1d12 + c5c7427 commit ab1755c6a211df3b6779deee04e5610a7ff6d7a7
Showing with 8 additions and 2 deletions.
  1. +8 −2 python/plugins/db_manager/db_plugins/info_model.py
@@ -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>)')

0 comments on commit ab1755c

Please sign in to comment.
You can’t perform that action at this time.