Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Display extent properly if query returns a list of values
  • Loading branch information
jgrocha committed Mar 1, 2020
1 parent 496531b commit c5c7427
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 c5c7427

Please sign in to comment.