-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QGIS expression function overlay_nearest with filter condition: different result for first few features #53494
Comments
@Babelgit, thanks for reporting. Please attach a simple layer to reproduce the issue directly to this issue report and please use a currently supported release according to the roadmap. Anyway, it seems to me there is an inconsistency in your report: the minimal reproducible example linked in the GIS Stackexchange question you are referring in this report does contain the following attribute table: and such attribute table is different from the attribute table visible in the provided screenshot. In the minimal reproducible example linked in the GIS Stackexchange question layer, the only 2 features with "name"='A' have the "id" field with 0 an 1 value, so the result of the provided expression could only be a combination of 0 and 1. Could you please better explains the issue, providing the correct data and expression? |
Sorry for the confusion. I created a new test Geopackage here: I run QGIS 3.30.3 with a new, clean user profile on Win 10. I have 11 points with field In my understanding, the output for each feature should be the same per field, so result_A should always contain This is the epxression I used for
|
The issues occur when the the source layer is used as target layer. See also #47201. @Babelgit, it seems to me that, as a workaround, you can duplicate the layer (or add the same layer two time with different names) and use the duplicated layer (or the same layer added a second time with different name) as target layer in order to obtain the expected results. Side note: when a virtual field is create using the provided expression and the source layer is used as target layer, the following errors are logged in the Log Messages panel opening the Attribute table
|
Duplicates #47201? |
What is the bug or the crash?
QGIS returns different results when using
overlay_nearest()
function with filter condition for the first few features.Steps to reproduce the issue
See comment below for a more consistent dataset
A minimal reproducible example is linked in the GIS Stackexchange question. I have a point layer with fields
id
andname
and use overlay_nearest with filter condition to find all features with the name =A
:The result should return the same value for all 11 features, namely
1,2,4
. However, in some cases, it returns just two features instead of 3, namely for the first three features.Versions
<style type="text/css"> p, li { white-space: pre-wrap; } </style>Active Python plugins
joinmultiplelines
Version 0.4.1
LAStools
1.4
processing_saga_nextgen
0.0.7
qfieldsync
v4.5.0
qgiscloud
3.8.5
QuickOSM
2.2.2
vector_tiles_reader
3.2.2
db_manager
0.1.20
grassprovider
2.12.99
processing
2.12.99
Supported QGIS version
New profile
Additional context
https://gis.stackexchange.com/q/461886/88814 and https://gis.stackexchange.com/a/461863/88814 (see comments)
The text was updated successfully, but these errors were encountered: