<?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: ArcGIS API for Python - XY to Line in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-xy-to-line/m-p/1143283#M7111</link>
    <description>&lt;P&gt;No, but you can roll out your own if you want to use arcpy or even shapely&lt;/P&gt;</description>
    <pubDate>Fri, 11 Feb 2022 20:04:04 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2022-02-11T20:04:04Z</dc:date>
    <item>
      <title>ArcGIS API for Python - XY to Line</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-xy-to-line/m-p/1143269#M7110</link>
      <description>&lt;P&gt;Is there a function in the ArcGIS API for Python for the XY to Line tool (like arcpy's arcpy.management.XYToLine)? I haven't been able to find it in the documentation if it exists.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Feb 2022 19:42:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-xy-to-line/m-p/1143269#M7110</guid>
      <dc:creator>ChadPeltier</dc:creator>
      <dc:date>2022-02-11T19:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS API for Python - XY to Line</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-xy-to-line/m-p/1143283#M7111</link>
      <description>&lt;P&gt;No, but you can roll out your own if you want to use arcpy or even shapely&lt;/P&gt;</description>
      <pubDate>Fri, 11 Feb 2022 20:04:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-xy-to-line/m-p/1143283#M7111</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-02-11T20:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS API for Python - XY to Line</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-xy-to-line/m-p/1144214#M7124</link>
      <description>&lt;P&gt;Thanks Dan.&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;For anyone else looking for something similar in the future, I ended up using the &lt;A href="https://github.com/GeographicaGS/GeodesicLinesToGIS" target="_self"&gt;GeodesicLinesToGIS module&lt;/A&gt; as the basis for this. Given a DataFrame called 'start_df' that contains two sets of long/lats i.e. X1, Y1, X2, Y2:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from shapely.geometry import Point, LineString
import pandas as pd
from arcgis.features import GeoAccessor
from geodesiclinestogis.geodesicline2gisfile import GeodesicLine2Gisfile
gtg = GeodesicLine2Gisfile()

def make_geodesic_line(row):
    long_lats = tuple(row)
    cd = gtg.gdlComp(long_lats)

    line = [Point(x) for x in cd]
    line = LineString(line)
    line = str(line)
    
    return line
    
lines = start_df.apply(make_geodesic_line, axis = 1)

df = pd.DataFrame({
    'id' : list_of_ids,
    'SHAPE' : lines
})

sedf = pd.DataFrame().spatial.from_df(df, geometry_column = 'SHAPE')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;If you wanted, then it shouldn't be too difficult to take the calculations from the&amp;nbsp;GeodesicLinesToGIS module directly instead of importing it as a dependency.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 18:49:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-xy-to-line/m-p/1144214#M7124</guid>
      <dc:creator>ChadPeltier</dc:creator>
      <dc:date>2022-02-15T18:49:48Z</dc:date>
    </item>
  </channel>
</rss>

