qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.04k stars 2.92k forks source link

temporary stratch layers filter doesn't get saved with the project #34392

Open tudorbarascu opened 4 years ago

tudorbarascu commented 4 years ago

How to Reproduce

  1. Create a temporary stratch layer (add a field name "whatever" integer)
  2. Add some features with "whatever" values between 1 and 10
  3. Make a provider feature filter (it works..) with "whatever" < 5 you can see it works
  4. Save the project
  5. Open the project and the feature filter is gone.. (I know the data is gone but my expectations are that the filtering gets saved and adding new features there..should show only those with the "whatever" < 5 that should have been saved,

QGIS and OS versions

QGIS version 3.11.0-Master QGIS code revision 3c64bbdcf9
Compiled against Qt 5.12.5 Running against Qt 5.12.5
Compiled against GDAL/OGR 3.0.4 Running against GDAL/OGR 3.0.4
Compiled against GEOS 3.8.0-CAPI-1.13.1 Running against GEOS 3.8.0-CAPI-1.13.1
Compiled against SQLite 3.31.1 Running against SQLite 3.31.1
PostgreSQL Client Version 12.1 (Debian 12.1-2) SpatiaLite Version 4.3.0a
QWT Version 6.1.4 QScintilla2 Version 2.11.2
Compiled against PROJ 6.3.0 Running against PROJ Rel. 6.3.0, January 1st, 2020
OS Version Debian GNU/Linux bullseye/sid
Active python plugins pluginbuilder3;
roya0045 commented 4 years ago

Well the whole layer is gone in this case. Personally I don't think this is a bug. I think that the layer should be removed entirely from the layertree instead as is it temporary and should only last as long as the project is active.

tudorbarascu commented 4 years ago

Only the data is gone, the layer styling and everything else is there, except for the filtering option. The use case that I had while stumbling on it is to fill that layer with problems found from a query and I sometimes I only want to show critical problems. I have ways around it but it's a bug from my point of view because except for the data (and the filter), everything else is already saved.

nyalldawson commented 4 years ago

@tudorbarascu could you use a rule based renderer to filter this?

tudorbarascu commented 4 years ago

@nyalldawson That's what I actually do as a workaround. Should have written here. Thanks. I can close this if no one else feels it's a bug.