<div dir="ltr">This can be done with an 'Action'. I was able to do it with a bit of PyQGIS code. Change the point_layer_name in the snippet below to match your point name. Define the Action on the line layer. Here's how it works <a href="https://ibb.co/vP7KRDd">https://ibb.co/vP7KRDd</a><br><div><br></div><div>line_layer = QgsProject.instance().mapLayer('[% @layer_id %]')<br>point_layer_name = 'points'<br>fid = [% $id %]<br>line_feature = line_layer.getFeature(fid)<br>line_geometry = line_feature.geometry().buffer(40, 5)<br>point_layer = QgsProject.instance().mapLayersByName(point_layer_name)[0]<br>nearby_points = [<a href="http://p.id/" target="_blank">p.id</a>() for p in point_layer.getFeatures()<br> if p.geometry().intersects(line_geometry) ]<br>layer.selectByIds(nearby_points)</div><div><br></div><div><br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div></div><div><table cellpadding="0" cellspacing="0" style="border-spacing:0px;border-collapse:collapse;color:rgb(68,68,68);width:480px;font-size:10pt;font-family:Arial,sans-serif;line-height:normal"><tbody><tr><td valign="top" style="padding:10px 0px 12px;width:160px;vertical-align:top"><a href="https://spatialthoughts.com/" style="background-color:transparent;color:rgb(51,122,183)" target="_blank"><img border="0" alt="Logo" width="141" src="https://spatialthoughts685850346.files.wordpress.com/2019/12/spatial_thoughts_logo.png" style="border:0px;vertical-align:middle;width:141px;height:auto"></a></td><td style="padding:6px 0px;width:320px"><table cellpadding="0" cellspacing="0" style="border-spacing:0px;border-collapse:collapse;background-color:transparent"><tbody><tr><td style="padding:0px;font-size:12pt;font-family:Arial,sans-serif;font-weight:bold;color:rgb(61,60,63)"><span style="color:rgb(0,175,239)">Ujaval Gandhi</span></td></tr><tr><td style="padding:0px 0px 11px;font-size:10pt;font-family:Arial,sans-serif;color:rgb(61,60,63)"><span style="color:rgb(0,175,239)">Spatial Thoughts</span></td></tr><tr><td style="padding:0px;font-size:10pt;font-family:Arial,sans-serif;color:rgb(155,155,155)"><span>mobile: +91-8095684687</span></td></tr><tr><td style="padding:0px;font-size:10pt;font-family:Arial,sans-serif;color:rgb(155,155,155)"><span>email: </span><span style="color:rgb(23,147,210)"><a href="mailto:ujaval@spatialthoughts.com" target="_blank">ujaval@spatialthoughts.com</a></span></td></tr><tr><td style="padding:6px 0px 0px"><span style="display:inline-block;height:22px"><span><a href="https://www.linkedin.com/in/spatialthoughts/" style="background-color:transparent;color:rgb(51,122,183)" target="_blank"><img alt="LinkedIn icon" border="0" width="23" height="23" src="https://codetwocdn.azureedge.net/images/mail-signatures/generator/elegant-logo/ln.png" style="border:0px;vertical-align:middle;height:20px;width:20px"></a> </span><span><a href="https://twitter.com/spatialthoughts" style="background-color:transparent;color:rgb(51,122,183)" target="_blank"><img alt="Twitter icon" border="0" width="23" height="23" src="https://codetwocdn.azureedge.net/images/mail-signatures/generator/elegant-logo/tt.png" style="border:0px;vertical-align:middle;height:20px;width:20px"></a> </span></span></td></tr></tbody></table></td></tr><tr><td colspan="2" style="padding:8px 0px 0px;border-top:1px solid rgb(23,147,210);width:480px;font-family:Arial,sans-serif;color:rgb(155,155,155);text-align:justify"></td></tr></tbody></table><br></div></div></div></div></div></div></div></div></div></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 24, 2020 at 8:02 PM Charles Dixon-Paver <<a href="mailto:charles@kartoza.com">charles@kartoza.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I was very interested to see if this was possible with qgis expressions and symbology, and I got it to work with surprisingly little effort, albeit with some issues [1].<div><br></div><div>I simply used the rule based symbology to highlight the relevant features using an expression [2].</div><div><br></div><div>The expression I used was as follows:</div><div><br></div><div>if(<br> distance($geometry,<br> geometry(<br> get_feature('Lines','fid','1')<br> )<br> ) < 500<br>,true,false)<br></div><div><div><br></div><div></div><div>One caveat is that the view does not automatically update when digitizing a new vertice. As a result I needed to zoom in and out constantly to update the symbol styles. This could probably be modified by using a layer action though.</div><div><br></div><div>Secondly, this expression is limited to a single feature in it's current state. I'm not sure if anyone has a clever workaround for including all geometries from another layer in an expression.</div><div><br></div><div>Lastly, this only tracks actual features, not the cursor.</div><div><br></div><div>There could be many other ways to achieve your result though, but I was interested to see how well this would function so others might find the result quite interesting. It's probably also quite usable for static styles if the objective is just for mapmaking rather than a digitizing tool.</div><div><br></div><div>[1] <a href="https://imgur.com/a/5J0dSt3" target="_blank">https://imgur.com/a/5J0dSt3</a></div><div>[2] <a href="https://imgur.com/a/E043vO7" target="_blank">https://imgur.com/a/E043vO7</a></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 24 Dec 2020 at 15:31, Raffaele Ceretto <<a href="mailto:cerettoraffaele@gmail.com" target="_blank">cerettoraffaele@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I need a tool that allows me to draw a line and that at the same time highlights points within a certain distance (for example 40 meters).<br>I have a map with hundreds of points, I would like when I draw a line what is nearby will light up.<br>There is a specific tool to do this or a simple "magnet" function?<br>Thank you for your help<br><br>waiting for a reply<br><br>regards<br><div><br></div><div>Raffaele</div></div>
_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
</blockquote></div>
_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
</blockquote></div>