Closed 9ls1 closed 1 year ago
@9ls1, are your fields numeric?
The data set contains several fields: some string, integer and real:
@9ls1, it seems to me the issue is due to the fact that the plugins only obviously calculates the min and max values for numeric fields, so the non numeric fields trigger the error in the line start_actual_val = (start_slider_val/100.0) * (self.fmax - self.fmin) + self.fmin
, since self.fmax
and self.fmin
are None
.
Ok, so the data set can ONLY have numeric fields, no combination with some fields being numeric, others being string?
@9ls1, I think I found the actual cause: not the non numeric fields (which are not used by the plugin), but the numeric fields that have all the values NULL.
@agiudiceandrea, @orcaomar: Finally, I remembered this and found the time to look closer into the matter. My findings so far:
"fid" > 4.000000 AND "fid" < 34.000000 AND "artype" > 12.000000 AND "artype" < 60.000000 AND "areal" > 372.704900 AND "areal" < 74797.924700
Why is not delta_m2 included in the filter? It is included in the legend in the layers panel.Anyway, I find this legend widget very useful and would really like to see it included in QGIS. Any chances for that?
Four numeric fields:
23 features:
16 features filtered:
Hey all, sorry I haven't looked at this plugin in quite a while but I'm stoked that others see it could be useful.. and maybe even use it! I'll look into this in the next week or so, try to tidy it up a bit and include a number of different types of fields on the latest QGIS build
Just what I was looking for. Downloaded the plugin as a zip-file and installed it from zip in QGIS 3.24.2. Added a polygon layer and added the the plugin to the legend-property, but it throws an error:
`An error has occurred while executing Python code:
TypeError: unsupported operand type(s) for -: 'NoneType' and 'NoneType' Traceback (most recent call last): File "C:\Users/.../AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis_range_filters-master\data_layer_range_filter_widget.py", line 165, in createWidget return DataLayerRangeFilterWidget(layer) File "C:\Users/.../AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis_range_filters-master\data_layer_range_filter_widget.py", line 116, in init self._add_slider(field.name()) File "C:\Users/.../AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis_range_filters-master\data_layer_range_filter_widget.py", line 133, in _add_slider slider = RangeSlider(self, field_name, field_min, field_max) File "C:\Users/.../AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis_range_filters-master\data_layer_range_filter_widget.py", line 38, in init self.on_value_changed() File "C:\Users/.../AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis_range_filters-master\data_layer_range_filter_widget.py", line 89, in on_value_changed (start_actual_val, end_actual_val) = self._getStartEndValues() File "C:\Users/.../AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis_range_filters-master\data_layer_range_filter_widget.py", line 76, in _getStartEndValues start_actual_val = (start_slider_val/100.0) * (self.fmax - self.fmin) + self.fmin TypeError: unsupported operand type(s) for -: 'NoneType' and 'NoneType'`
Do you have any plans updating/supporting the plugin? Or have you asked QGIS to include such an option in the core version?