<div dir="ltr">Hello,<br><br>These QGIS features need to be invoked manually, and I was hoping that these functions (or a similar one) could somehow be called using a Python script from within QGIS. Maybe someone with knowledge of QGIS internal functions can give advice on how these functions can be called.<br><br>Yours sincerely,<br>Pankaj</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 13, 2023 at 4:20 PM Pankajeshwara Sharma <<a href="mailto:pankajeshwara@gmail.com">pankajeshwara@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">Dear Sebastian,<br><br>Thank you so much. I was just wondering if this tool can be called using Python from within QGIS. <br><br>I am trying to write a Python equivalent of the following JavaScript block of code.<div><div style="color:rgb(0,0,0);font-family:Consolas,"Courier New",monospace;font-size:14px;line-height:19px;white-space:pre-wrap"><span style="color:rgb(0,128,0)">nearestPoint = turf.nearestPoint(currentFeature, entire_dataset)</span></div><div style="color:rgb(0,0,0);font-family:Consolas,"Courier New",monospace;font-size:14px;line-height:19px;white-space:pre-wrap"><span style="color:rgb(0,128,0)"><br></span></div><div style="line-height:19px">Yours sincerely,<br>Pankaj  <span style="color:rgb(0,128,0);font-family:Consolas,"Courier New",monospace;font-size:14px;white-space:pre-wrap">
<br></span></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 13, 2023 at 3:10 AM Sebastian Gutwein <<a href="mailto:bas@rdgland.com" target="_blank">bas@rdgland.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">Not that exact function that I am aware of but there is a <b>Distance to nearest hub (points) </b>tool in the processing toolbox that will give you the distance to all of the points and then you can choose the one with the shortest distance. You could also use select by expression using the <b>Closest Point </b>function. </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Nov 12, 2023 at 7:14 AM Pankajeshwara Sharma via QGIS-Developer <<a href="mailto:qgis-developer@lists.osgeo.org" target="_blank">qgis-developer@lists.osgeo.org</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"><div>Dear developers,</div><div><br></div><div>I was wondering of there is a QGIS equivalent of Turf's nearest point function?<br><a href="https://www.npmjs.com/package/@turf/nearest-point" target="_blank">https://www.npmjs.com/package/@turf/nearest-point</a></div><div dir="ltr"><br></div><div dir="ltr">The function takes a reference point and a FeatureCollection of Features with Point geometries and returns the point from the FeatureCollection closest to the reference.<br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">Yours sincerely,<br>Pankaj Sharma<br>Research Fellow<br>University of Auckland<br><a href="mailto:pankaj.sharma@auckland.ac.nz" target="_blank">pankaj.sharma@auckland.ac.nz</a></div></div>
_______________________________________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr">___________________________<br><div dir="ltr"><span>Sebastian "Bas* " Gutwein</span></div><div><span><span>*rhymes with Josh <br></span></span></div><div><span><span><br></span></span></div>Regenerative Design Group<br>1 Chevalier Ave<br>Greenfield, Ma 01301<br>Web: <a href="http://regenerativedesigngroup.com" target="_blank">regenerativedesigngroup.com</a><br>(631) 241-1018<br><br><div dir="ltr"><i><span><span>Look close, think big, make change. </span></span></i></div><div dir="ltr"><span></span></div></div></div>
</blockquote></div>
</blockquote></div>