[Qgis-user] Filtering layer or selected features by attributes does not work for new added features in QGIS 3.22.8

Tudorache, Marian Marian.Tudorache at navcanada.ca
Thu Jul 21 15:47:27 PDT 2022


Hi,

I am using QGIS 3.22.8 and I have a problem with filtering new added features.
In one of my arc layer I have around 38 arc features.
There is an attribute of interest named ID where I have to apply all kind of filters like
“ID” = 1 or “ID” IN (2,5,7)

Few days ago I added four new feature with the ID attributes 38, 38, 100 and 101.
Today I tried to filter after any of these new attributes and the filter returns nothing.
[cid:image001.png at 01D89D32.513B8350]
I get the message The where clause returned 0 row(s).
[cid:image002.png at 01D89D32.513B8350]

If I put the filter
NOT "ID" != 100
It works fine.
[cid:image003.png at 01D89D32.513B8350]

When I filter features which exited before I added new four it works.

For example “ID” = 35 the filter works fine
[cid:image004.png at 01D89D32.513B8350]


The same thing when I use selectByExpression
When I put
layer.selectByExpression("\"ID\"=37")
layer.selectByExpression("\"ID\"=38")
layer.selectByExpression("\"ID\"=100")
layer.selectByExpression("\"ID\"=101")
no features is selected

but when I put
layer.selectByExpression("\"ID\"=35")
feature with ID = 35 is selected.

Why QGIS 3.22.8 does not filter or select new features by attribute?
I did not have this problem in QGIS 2.18.

Thank you,
Marian







________________________________

This electronic message, as well as any transmitted files included in the electronic message, may contain privileged or confidential information and is intended solely for the use of the individual(s) or entity to which it is addressed. If you have received this electronic message in error please notify the sender immediately and delete the electronic message. Any unauthorized copying, disclosure or distribution of the electronic message is strictly forbidden. NAV CANADA accepts no liability for any damage caused by any virus and/or other malicious code transmitted by this electronic communication.

Le présent message électronique et tout fichier qui peut y être joint peuvent contenir des renseignements privilégiés ou confidentiels destinés à l’usage exclusif des personnes ou des organismes à qui ils s’adressent. Si vous avez reçu ce message électronique par erreur, veuillez en informer l’expéditeur immédiatement et supprimez le. Toute reproduction, divulgation ou distribution du présent message électronique est strictement interdite. NAV CANADA n’assume aucune responsabilité en cas de dommage causé par tout virus ou autre programme malveillant transmis par ce message électronique.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20220721/7fe37de0/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 336224 bytes
Desc: image001.png
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20220721/7fe37de0/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 179330 bytes
Desc: image002.png
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20220721/7fe37de0/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 170212 bytes
Desc: image003.png
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20220721/7fe37de0/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 186469 bytes
Desc: image004.png
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20220721/7fe37de0/attachment-0007.png>


More information about the Qgis-user mailing list