<?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: Calculating a destination point based on an origin, distance and bearing? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/calculating-a-destination-point-based-on-an-origin/m-p/1167782#M64413</link>
    <description>&lt;P&gt;Thanks! &amp;nbsp;I’ll investigate that more.&lt;/P&gt;</description>
    <pubDate>Tue, 26 Apr 2022 00:20:28 GMT</pubDate>
    <dc:creator>EricEagle</dc:creator>
    <dc:date>2022-04-26T00:20:28Z</dc:date>
    <item>
      <title>Calculating a destination point based on an origin, distance and bearing?</title>
      <link>https://community.esri.com/t5/python-questions/calculating-a-destination-point-based-on-an-origin/m-p/1167719#M64394</link>
      <description>&lt;P&gt;I'm porting a tool from R to be run in a managed ArcGIS Pro instance (no access to R).&amp;nbsp; In the script, destination points are calculated from a known origin based on bearing and distance.&lt;/P&gt;&lt;P&gt;The script relies on the geosphere &lt;STRONG&gt;destPoint()&lt;/STRONG&gt; method to do it, and is invoked like this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;x = destPoint(origin, bearing, distance)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;x is a location object with &lt;STRONG&gt;.latitude&lt;/STRONG&gt; and &lt;STRONG&gt;.longitude&lt;/STRONG&gt; properties that return as floats for use in further processing.&lt;/P&gt;&lt;P&gt;This seems like a super straightforward geometric problem but I am struggling to find how to use ArcPy to accomplish it.&amp;nbsp; For initial testing purposes I gave up and just pip installed GeoPy, using&amp;nbsp;&lt;STRONG&gt;geopy.distance.distance(unit=distance).destination((origin.Y, origin.X), bearing)&lt;/STRONG&gt; and it works beautifully but I do not like delivering stuff with janky 3rd party dependencies.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I do this in ArcPy without re-writing half of GeoPy?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 20:38:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculating-a-destination-point-based-on-an-origin/m-p/1167719#M64394</guid>
      <dc:creator>EricEagle</dc:creator>
      <dc:date>2022-04-25T20:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating a destination point based on an origin, distance and bearing?</title>
      <link>https://community.esri.com/t5/python-questions/calculating-a-destination-point-based-on-an-origin/m-p/1167740#M64397</link>
      <description>&lt;P&gt;You might try the&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/2.8/tool-reference/data-management/bearing-distance-to-line.htm" target="_self"&gt;Bearing Distance to Line&lt;/A&gt;&amp;nbsp;tool.&lt;BR /&gt;&lt;BR /&gt;How do you know GeoPy is janky? Did you test it against your R tool and get different results?&lt;BR /&gt;&lt;BR /&gt;Another great option is to use&amp;nbsp;&lt;A href="https://geographiclib.sourceforge.io/html/python/" target="_self"&gt;geographiclib.&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 21:56:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculating-a-destination-point-based-on-an-origin/m-p/1167740#M64397</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-04-25T21:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating a destination point based on an origin, distance and bearing?</title>
      <link>https://community.esri.com/t5/python-questions/calculating-a-destination-point-based-on-an-origin/m-p/1167742#M64398</link>
      <description>&lt;P&gt;From a point feature class as input:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

# samplept is a point feature class with xcoord, ycoord fields as double, calculated geometry to wgs84,
#also added dist field, and bearing fields both as double, both field calculated with the distance and bearing values.
 
input_table = r"C:\Data\Points\points_data.gdb\samplept"
output_line = r"C:\Data\Points\points_data.gdb\bearingLine"

# BearingDistanceToLine
#https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/bearing-distance-to-line.htm
arcpy.BearingDistanceToLine_management(input_table, output_line, 'xcoord', 'ycoord', 'dist', 
                                       'KILOMETERS', 'bearing', 'DEGREES','GEODESIC')

#Feature-vertices-to-points.htm
#https://pro.arcgis.com/en/pro-app/2.8/tool-reference/data-management/feature-vertices-to-points.htm
out_point = r"C:\Data\Points\points_data.gdb\bearingPoints"
arcpy.management.FeatureVerticesToPoints(output_line, out_point, "END")       
&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;output&amp;nbsp; is point feature class also.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 22:01:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculating-a-destination-point-based-on-an-origin/m-p/1167742#M64398</guid>
      <dc:creator>JamesHood</dc:creator>
      <dc:date>2022-04-25T22:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating a destination point based on an origin, distance and bearing?</title>
      <link>https://community.esri.com/t5/python-questions/calculating-a-destination-point-based-on-an-origin/m-p/1167748#M64401</link>
      <description>&lt;LI-CODE lang="python"&gt;import arcpy
pnt = arcpy.Point(300000, 5000000)
SR = "NAD 1983 CSRS MTM  9"
pnt = arcpy.Point(300000, 5000000)
p_geom = arcpy.PointGeometry(pnt, spatial_reference=SR)

# -- make a new p_geom at 45 degrees from N at 1000m
new_p = p_geom.pointFromAngleAndDistance(angle=45.0, distance=1000, method='GEODESIC')
new_p[0]
 &amp;lt;Point (300707.56992333446, 5000706.502158922, #, #)&amp;gt;

# --- lots more
dir(new_p)
['JSON', 'WKB', 'WKT', '__add__', '__class__', '__cmp__', '__delattr__', 
  '__dict__', '__dir__', '__doc__', '__eq__', '__format__',
...snip
 'angleAndDistanceTo', 'area', 'boundary', 'buffer', 'centroid', 'clip',
 'contains', 'convexHull', 'crosses', 'cut', 'densify', 'difference',
 'disjoint', 'distanceTo', 'equals', 'extent', 'firstPoint', 'generalize',
 'getArea', 'getGeohash', 'getLength', 'getPart', 'hasCurves',
 'hullRectangle', 'intersect', 'isMultipart', 'labelPoint', 'lastPoint',
 'length', 'length3D', 'measureOnLine', 'overlaps', 'partCount',
 'pointCount', 'pointFromAngleAndDistance', 'positionAlongLine', 'projectAs',
 'queryPointAndDistance', 'segmentAlongLine', 'snapToLine',
 'spatialReference', 'symmetricDifference', 'toCoordString', 'touches',
 'trueCentroid', 'type', 'union', 'within']&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 25 Apr 2022 22:24:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculating-a-destination-point-based-on-an-origin/m-p/1167748#M64401</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-04-25T22:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating a destination point based on an origin, distance and bearing?</title>
      <link>https://community.esri.com/t5/python-questions/calculating-a-destination-point-based-on-an-origin/m-p/1167769#M64408</link>
      <description>&lt;P&gt;Sorry! &amp;nbsp;I don’t mean GeoPy is janky only the dependency management inside a Python toolbox for ArcGIS Pro is janky with any third party dependency.&lt;/P&gt;&lt;P&gt;I’d like to avoid the Bearing Distance to Line tool because it is IO bound (needs output to disk) and I don’t need lines and all the overhead, just points derived within memory space.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 23:33:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculating-a-destination-point-based-on-an-origin/m-p/1167769#M64408</guid>
      <dc:creator>EricEagle</dc:creator>
      <dc:date>2022-04-25T23:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating a destination point based on an origin, distance and bearing?</title>
      <link>https://community.esri.com/t5/python-questions/calculating-a-destination-point-based-on-an-origin/m-p/1167771#M64409</link>
      <description>&lt;P&gt;This is great but I’d like to do it in memory like with GeoPy without incurring overhead of writing feature classes to disk.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 23:35:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculating-a-destination-point-based-on-an-origin/m-p/1167771#M64409</guid>
      <dc:creator>EricEagle</dc:creator>
      <dc:date>2022-04-25T23:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating a destination point based on an origin, distance and bearing?</title>
      <link>https://community.esri.com/t5/python-questions/calculating-a-destination-point-based-on-an-origin/m-p/1167772#M64410</link>
      <description>&lt;P&gt;Nice! &amp;nbsp;This looks way closer to what I’m looking for. &amp;nbsp;Will give it a shot and report back, thanks Dan&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 23:37:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculating-a-destination-point-based-on-an-origin/m-p/1167772#M64410</guid>
      <dc:creator>EricEagle</dc:creator>
      <dc:date>2022-04-25T23:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating a destination point based on an origin, distance and bearing?</title>
      <link>https://community.esri.com/t5/python-questions/calculating-a-destination-point-based-on-an-origin/m-p/1167775#M64411</link>
      <description>&lt;P&gt;No apologies needed - It's always worth testing and reporting problems or discontinuity between different solutions. Totally understand the need for tool and environment portability.&lt;/P&gt;&lt;P&gt;It looks like Dan's solution is what you're looking for. For posterity it's worth nothing you should be able to write the Bearing Distance to Line output to memory.&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/basics/the-in-memory-workspace.htm" target="_self"&gt;https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/basics/the-in-memory-workspace.htm&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 23:46:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculating-a-destination-point-based-on-an-origin/m-p/1167775#M64411</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-04-25T23:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating a destination point based on an origin, distance and bearing?</title>
      <link>https://community.esri.com/t5/python-questions/calculating-a-destination-point-based-on-an-origin/m-p/1167782#M64413</link>
      <description>&lt;P&gt;Thanks! &amp;nbsp;I’ll investigate that more.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 00:20:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculating-a-destination-point-based-on-an-origin/m-p/1167782#M64413</guid>
      <dc:creator>EricEagle</dc:creator>
      <dc:date>2022-04-26T00:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating a destination point based on an origin, distance and bearing?</title>
      <link>https://community.esri.com/t5/python-questions/calculating-a-destination-point-based-on-an-origin/m-p/1167945#M64417</link>
      <description>&lt;P&gt;Just for reference I modified my approach to no longer output&amp;nbsp; intermediates to hard disk.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

# samplept is a point feature class with xcoord, ycoord fields as double, calculated geometry to wgs84,
#also added dist field, and bearing fields both as double, both field calculated with the distance and bearing values.
 
input_table = r"C:\Data\Points\points_data.gdb\samplept"
output_line = r"in_memory\bearingLine"

# BearingDistanceToLine
#https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/bearing-distance-to-line.htm
arcpy.BearingDistanceToLine_management(input_table, output_line, 'xcoord', 'ycoord', 'dist', 
                                       'KILOMETERS', 'bearing', 'DEGREES','GEODESIC')

#Feature-vertices-to-points.htm
#https://pro.arcgis.com/en/pro-app/2.8/tool-reference/data-management/feature-vertices-to-points.htm
out_point = r"in_memory\bearingPoints"
arcpy.management.FeatureVerticesToPoints(output_line, out_point, "END")&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 26 Apr 2022 15:16:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculating-a-destination-point-based-on-an-origin/m-p/1167945#M64417</guid>
      <dc:creator>JamesHood</dc:creator>
      <dc:date>2022-04-26T15:16:14Z</dc:date>
    </item>
  </channel>
</rss>

