In my vector layer I want to select points within a buffer of 12 meters and with an exception (if 'Name' is not "James" than select).
Is this possible with "select by expression"?
bufferdistanceqgisselect-by-location
In my vector layer I want to select points within a buffer of 12 meters and with an exception (if 'Name' is not "James" than select).
Is this possible with "select by expression"?
Best Answer
Yes this is possible. You need to calculate the distance between every point and your reference point using the
distance
function (a buffer is a misleading idea), and add a second condition using theAND
operator. This could give something like:where
$geometry
are all the points, andgeomFromWKT('POINT(4 4)')
your reference point (in Well Known Text format). Make sure you get the single and double quotes right: double quotes are for field names and single quotes for strings.