<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Snapping to a polyline feature in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/snapping-to-a-polyline-feature/m-p/1075337#M4306</link>
    <description>&lt;P&gt;I have an app in AppStudio that contains a map with several feature layers. The user for the application will be interacting with the layers and submitting data from app to elsewhere. I want the user to be able to click on the map (it will never be exact, therefore reasonably close) near a line feature and retrieve the coordinates for the nearest point on the line.&lt;/P&gt;&lt;P&gt;For example, user clicks on or near the polyline feature. This creates a Graphic that is snapped to the nearest point on the polyline feature. This allows the app to retrieve coordinates where the user tapped on the feature.&lt;/P&gt;&lt;P&gt;This is the workflow I would like to implement:&lt;/P&gt;&lt;P&gt;1) User clicks on or near polyline feature&lt;/P&gt;&lt;P&gt;2) Get the coordinates for the point that user tapped on and calculate distance &lt;EM&gt;x&lt;/EM&gt; to polyline feature (using &lt;A href="https://developers.arcgis.com/qt/qml/api-reference/qml-esri-arcgisruntime-geometryengine.html" target="_self"&gt;Geometry Engine&lt;/A&gt;'s distance method).&amp;nbsp;&lt;/P&gt;&lt;P&gt;3) Plot point on line that is &lt;EM&gt;x&lt;/EM&gt; distance away from tapped point to line feature.&lt;/P&gt;&lt;P&gt;4) Place a Graphic on this final point on the line feature to indicate that the snapping has completed.&lt;/P&gt;&lt;P&gt;How can I achieve step 3? I have a distance that I can calculate successfully. Is the best way to do this by calculating a buffer with&amp;nbsp;&lt;EM&gt;x&amp;nbsp;&lt;/EM&gt;radius and then finding points of intersection with the line feature? Or is there a better way? All I want to do is just snap this point that is not on the line to the line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help!&lt;/P&gt;</description>
    <pubDate>Fri, 02 Jul 2021 20:04:52 GMT</pubDate>
    <dc:creator>KevinCheriyan</dc:creator>
    <dc:date>2021-07-02T20:04:52Z</dc:date>
    <item>
      <title>Snapping to a polyline feature</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/snapping-to-a-polyline-feature/m-p/1075337#M4306</link>
      <description>&lt;P&gt;I have an app in AppStudio that contains a map with several feature layers. The user for the application will be interacting with the layers and submitting data from app to elsewhere. I want the user to be able to click on the map (it will never be exact, therefore reasonably close) near a line feature and retrieve the coordinates for the nearest point on the line.&lt;/P&gt;&lt;P&gt;For example, user clicks on or near the polyline feature. This creates a Graphic that is snapped to the nearest point on the polyline feature. This allows the app to retrieve coordinates where the user tapped on the feature.&lt;/P&gt;&lt;P&gt;This is the workflow I would like to implement:&lt;/P&gt;&lt;P&gt;1) User clicks on or near polyline feature&lt;/P&gt;&lt;P&gt;2) Get the coordinates for the point that user tapped on and calculate distance &lt;EM&gt;x&lt;/EM&gt; to polyline feature (using &lt;A href="https://developers.arcgis.com/qt/qml/api-reference/qml-esri-arcgisruntime-geometryengine.html" target="_self"&gt;Geometry Engine&lt;/A&gt;'s distance method).&amp;nbsp;&lt;/P&gt;&lt;P&gt;3) Plot point on line that is &lt;EM&gt;x&lt;/EM&gt; distance away from tapped point to line feature.&lt;/P&gt;&lt;P&gt;4) Place a Graphic on this final point on the line feature to indicate that the snapping has completed.&lt;/P&gt;&lt;P&gt;How can I achieve step 3? I have a distance that I can calculate successfully. Is the best way to do this by calculating a buffer with&amp;nbsp;&lt;EM&gt;x&amp;nbsp;&lt;/EM&gt;radius and then finding points of intersection with the line feature? Or is there a better way? All I want to do is just snap this point that is not on the line to the line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 20:04:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/snapping-to-a-polyline-feature/m-p/1075337#M4306</guid>
      <dc:creator>KevinCheriyan</dc:creator>
      <dc:date>2021-07-02T20:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: Snapping to a polyline feature</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/snapping-to-a-polyline-feature/m-p/1075360#M4307</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/148230"&gt;@KevinCheriyan&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;We have a sample that has nearly the exact workflow you're looking for. It shows how to get the distance and "snap" a mouse click to a polyline (in the case of the sample, it's the edge of a polygon).&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-runtime-samples-qt/tree/main/ArcGISRuntimeSDKQt_QMLSamples/Geometry/NearestVertex" target="_blank"&gt;https://github.com/Esri/arcgis-runtime-samples-qt/tree/main/ArcGISRuntimeSDKQt_QMLSamples/Geometry/NearestVertex&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let us know if this help.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 21:24:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/snapping-to-a-polyline-feature/m-p/1075360#M4307</guid>
      <dc:creator>JamesBallard1</dc:creator>
      <dc:date>2021-07-02T21:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Snapping to a polyline feature</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/snapping-to-a-polyline-feature/m-p/1076021#M4315</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/405084"&gt;@JamesBallard1&lt;/a&gt;&amp;nbsp;! This worked perfectly. I swear I must've looked over the methods in GeometryEngine a few times, but still missed these!&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jul 2021 19:51:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/snapping-to-a-polyline-feature/m-p/1076021#M4315</guid>
      <dc:creator>KevinCheriyan</dc:creator>
      <dc:date>2021-07-06T19:51:37Z</dc:date>
    </item>
  </channel>
</rss>

