<?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 Re: find closest xy on a polyline from a point in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-closest-xy-on-a-polyline-from-a-point/m-p/1573912#M11022</link>
    <description>&lt;P&gt;From the geometry methods doc and the doc screenshot in that thread, the 2nd value appears to be the distance from the line start along the line.&amp;nbsp; I think it's the 3rd value you're looking for.&amp;nbsp; Without knowing more about your data etc. I'm not sure what may be happening with the results.&lt;/P&gt;&lt;P&gt;I'd print out the JSON of the inputs also and maybe something with the SRID/WKID might show up.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/geometry.htm" target="_blank"&gt;https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/geometry.htm&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Jan 2025 14:29:30 GMT</pubDate>
    <dc:creator>DavidPike</dc:creator>
    <dc:date>2025-01-09T14:29:30Z</dc:date>
    <item>
      <title>find closest xy on a polyline from a point</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-closest-xy-on-a-polyline-from-a-point/m-p/1573505#M11014</link>
      <description>&lt;P&gt;so this sounds simple and if i use Near in Pro it is but i want to create a AGOL python notebook to run once a day to loop over any point features created that day and get the closest XY to a feature service of polylines (50k features)&lt;/P&gt;&lt;P&gt;i tried following the example here &lt;A href="https://developers.arcgis.com/python/latest/guide/part3-spatial-operations-on-geometries/" target="_blank"&gt;Part 3 - Spatial operations on geometries | ArcGIS API for Python&lt;/A&gt;&lt;/P&gt;&lt;P&gt;but even if i just manually populate the geomenty json for both the point and the polyline it returns None&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="StuartMoore_0-1736345673403.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/122945i23DA6CFBBB875941/image-size/medium?v=v2&amp;amp;px=400" role="button" title="StuartMoore_0-1736345673403.png" alt="StuartMoore_0-1736345673403.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2025 14:14:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/find-closest-xy-on-a-polyline-from-a-point/m-p/1573505#M11014</guid>
      <dc:creator>StuartMoore</dc:creator>
      <dc:date>2025-01-08T14:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: find closest xy on a polyline from a point</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-closest-xy-on-a-polyline-from-a-point/m-p/1573696#M11016</link>
      <description>&lt;P&gt;Are you using a standard Notebook?&amp;nbsp; I think you'd require an Advanced Notebook type to then be able to import the required ArcPy module.&lt;/P&gt;&lt;P&gt;access_res.type is probably returning none&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2025 19:25:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/find-closest-xy-on-a-polyline-from-a-point/m-p/1573696#M11016</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2025-01-08T19:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: find closest xy on a polyline from a point</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-closest-xy-on-a-polyline-from-a-point/m-p/1573846#M11017</link>
      <description>&lt;P&gt;thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/167692"&gt;@DavidPike&lt;/a&gt;&amp;nbsp;that was the issue&lt;BR /&gt;&lt;BR /&gt;it looks like its returning the distance now but it looks like its in radians?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="StuartMoore_0-1736415463328.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/123007i8AB992BD89557B61/image-size/medium?v=v2&amp;amp;px=400" role="button" title="StuartMoore_0-1736415463328.png" alt="StuartMoore_0-1736415463328.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 09:39:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/find-closest-xy-on-a-polyline-from-a-point/m-p/1573846#M11017</guid>
      <dc:creator>StuartMoore</dc:creator>
      <dc:date>2025-01-09T09:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: find closest xy on a polyline from a point</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-closest-xy-on-a-polyline-from-a-point/m-p/1573855#M11018</link>
      <description>&lt;P&gt;it also looks like its only getting the closest vertex rather than the closest point on the line unfortunately&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 11:17:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/find-closest-xy-on-a-polyline-from-a-point/m-p/1573855#M11018</guid>
      <dc:creator>StuartMoore</dc:creator>
      <dc:date>2025-01-09T11:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: find closest xy on a polyline from a point</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-closest-xy-on-a-polyline-from-a-point/m-p/1573864#M11019</link>
      <description>&lt;P&gt;Are you able to share the full code and possibly the mapped polyline and point inputs and point result?&amp;nbsp; Values look like a spatial reference issue, possibly. I don't think there's any angles calculated so likely not radians.&lt;/P&gt;&lt;P&gt;I found the Python API Geometry Class docs to be a bit confusing as they suggested a result being a tuple of xy coords and the distance.&lt;BR /&gt;&lt;BR /&gt;Then I found this&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/need-query-point-and-distance-clarification/td-p/1514270" target="_blank"&gt;https://community.esri.com/t5/arcgis-api-for-python-questions/need-query-point-and-distance-clarification/td-p/1514270&lt;/A&gt;&lt;/P&gt;&lt;P&gt;which describes the actual result object (straight from the arcpy function).&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":neutral_face:"&gt;😐&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 11:29:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/find-closest-xy-on-a-polyline-from-a-point/m-p/1573864#M11019</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2025-01-09T11:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: find closest xy on a polyline from a point</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-closest-xy-on-a-polyline-from-a-point/m-p/1573901#M11021</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is the code:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;for xbsg in bsgPoints:
    print(xbsg.attributes["objectid"])
    print(xbsg)
    access_point = Point(xbsg.geometry)
    access_res = access_polyline.query_point_and_distance(access_point)
    if (access_res):
        print(access_res)
        print("--++--")
        print(access_res[0].JSON)
    print("----")&lt;/LI-CODE&gt;&lt;P&gt;this is the code's closest point&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="StuartMoore_1-1736431031199.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/123018iA3F0F25B384D068C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="StuartMoore_1-1736431031199.png" alt="StuartMoore_1-1736431031199.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;but i was expecting this as the closest point:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="StuartMoore_2-1736431090257.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/123019iF691A241F573017A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="StuartMoore_2-1736431090257.png" alt="StuartMoore_2-1736431090257.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and this is the distances returned:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="StuartMoore_3-1736431224694.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/123020i7AA08F466226DE84/image-size/medium?v=v2&amp;amp;px=400" role="button" title="StuartMoore_3-1736431224694.png" alt="StuartMoore_3-1736431224694.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;i also found that post and it suggests that the distance is the second item so&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;0.001106969364200805&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 14:03:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/find-closest-xy-on-a-polyline-from-a-point/m-p/1573901#M11021</guid>
      <dc:creator>StuartMoore</dc:creator>
      <dc:date>2025-01-09T14:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: find closest xy on a polyline from a point</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-closest-xy-on-a-polyline-from-a-point/m-p/1573912#M11022</link>
      <description>&lt;P&gt;From the geometry methods doc and the doc screenshot in that thread, the 2nd value appears to be the distance from the line start along the line.&amp;nbsp; I think it's the 3rd value you're looking for.&amp;nbsp; Without knowing more about your data etc. I'm not sure what may be happening with the results.&lt;/P&gt;&lt;P&gt;I'd print out the JSON of the inputs also and maybe something with the SRID/WKID might show up.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/geometry.htm" target="_blank"&gt;https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/geometry.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 14:29:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/find-closest-xy-on-a-polyline-from-a-point/m-p/1573912#M11022</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2025-01-09T14:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: find closest xy on a polyline from a point</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-closest-xy-on-a-polyline-from-a-point/m-p/1573913#M11023</link>
      <description>&lt;P&gt;this is the geometry of one of the polylines&lt;/P&gt;&lt;LI-CODE lang="python"&gt;{"geometry": {"paths": [[[-1.04626706475298, 52.5312679471987], ........ [-1.0447855316579, 52.5304270718345]]], "spatialReference": {"wkid": 4326, "latestWkid": 4326}}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;this is the geometry for one of the points&lt;/P&gt;&lt;LI-CODE lang="python"&gt;{"geometry": {"x": -1.0453711186340822, "y": 52.53063399067387, "spatialReference": {"wkid": 4326, "latestWkid": 4326}}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for the help&lt;/P&gt;&lt;P&gt;Stu&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 14:36:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/find-closest-xy-on-a-polyline-from-a-point/m-p/1573913#M11023</guid>
      <dc:creator>StuartMoore</dc:creator>
      <dc:date>2025-01-09T14:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: find closest xy on a polyline from a point</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-closest-xy-on-a-polyline-from-a-point/m-p/1573917#M11024</link>
      <description>&lt;P&gt;OK that's WGS84 and the lengths I guess are decimal degrees.&amp;nbsp; Unless there's another Geodesic Method available I think you'd really need to project the coordinates into a planimetric coordinate system to get a meaningful output.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 14:41:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/find-closest-xy-on-a-polyline-from-a-point/m-p/1573917#M11024</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2025-01-09T14:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: find closest xy on a polyline from a point</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-closest-xy-on-a-polyline-from-a-point/m-p/1573955#M11025</link>
      <description>&lt;P&gt;You can get the information for the output tuple from the ArcPy &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/classes/polyline.htm#:~:text=Explanation-,tuple,-Returns%20a%20tuple" target="_blank" rel="noopener"&gt;Polyline&lt;/A&gt; documentation.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clubdebambos_0-1736437329755.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/123030iB9299FE20AB69A73/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clubdebambos_0-1736437329755.png" alt="Clubdebambos_0-1736437329755.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 15:43:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/find-closest-xy-on-a-polyline-from-a-point/m-p/1573955#M11025</guid>
      <dc:creator>Clubdebambos</dc:creator>
      <dc:date>2025-01-09T15:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: find closest xy on a polyline from a point</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-closest-xy-on-a-polyline-from-a-point/m-p/1574280#M11034</link>
      <description>&lt;P&gt;thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/167692"&gt;@DavidPike&lt;/a&gt;&amp;nbsp; i changed the spatial reference when querying my layers and it works, even gives me the correct distance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="StuartMoore_0-1736500519723.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/123096i300BD409F6B44153/image-size/medium?v=v2&amp;amp;px=400" role="button" title="StuartMoore_0-1736500519723.png" alt="StuartMoore_0-1736500519723.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2025 09:22:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/find-closest-xy-on-a-polyline-from-a-point/m-p/1574280#M11034</guid>
      <dc:creator>StuartMoore</dc:creator>
      <dc:date>2025-01-10T09:22:24Z</dc:date>
    </item>
  </channel>
</rss>

