diff --git a/orangecontrib/geo/widgets/owchoropleth.py b/orangecontrib/geo/widgets/owchoropleth.py index 3d3b5b4..daa6d26 100644 --- a/orangecontrib/geo/widgets/owchoropleth.py +++ b/orangecontrib/geo/widgets/owchoropleth.py @@ -686,7 +686,10 @@ def effective_variables(self): @property def effective_data(self): - return self.data.transform(Domain(self.effective_variables)) + eff_var = self.effective_variables + if eff_var and self.attr_lat.name == self.attr_lon.name: + eff_var = [self.attr_lat] + return self.data.transform(Domain(eff_var)) # Input @Inputs.data diff --git a/orangecontrib/geo/widgets/owmap.py b/orangecontrib/geo/widgets/owmap.py index 976565d..63e9ba3 100644 --- a/orangecontrib/geo/widgets/owmap.py +++ b/orangecontrib/geo/widgets/owmap.py @@ -1,6 +1,6 @@ import numpy as np from AnyQt.QtCore import Qt -from Orange.data import Table, ContinuousVariable +from Orange.data import Table, Domain, ContinuousVariable from Orange.widgets import gui, settings from Orange.widgets.utils.widgetpreview import WidgetPreview from Orange.widgets.utils.itemmodels import DomainModel @@ -228,6 +228,13 @@ def effective_variables(self): return [self.attr_lat, self.attr_lon] \ if self.attr_lat and self.attr_lon else [] + @property + def effective_data(self): + eff_var = self.effective_variables + if eff_var and self.attr_lat.name == self.attr_lon.name: + eff_var = [self.attr_lat] + return self.data.transform(Domain(eff_var)) + def showEvent(self, ev): super().showEvent(ev) # reset the map on show event since before that we didn't know the