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"?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
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 the
AND operator. This could give something like:
distance( geomFromWKT('POINT(4 4)') , $geometry ) <= 12 AND "Name" IS NOT 'James'
$geometry are all the points, and
geomFromWKT('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.