<?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: import Pandas DataFrame with Polyline field using Python API in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/import-pandas-dataframe-with-polyline-field-using/m-p/838142#M3421</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks - so it seems like Esri still has some work to do on this API....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Feb 2017 15:58:38 GMT</pubDate>
    <dc:creator>Jay_Gregory</dc:creator>
    <dc:date>2017-02-27T15:58:38Z</dc:date>
    <item>
      <title>import Pandas DataFrame with Polyline field using Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/import-pandas-dataframe-with-polyline-field-using/m-p/838137#M3416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Been playing around with the Python API. &amp;nbsp;I'm using a Pandas dataframe, to which I've added a column that has a Polyline (arcgis.geometry.Polyline class) as it's attribute. &amp;nbsp;I would like to add this dataframe to a map, but the import_data method only seems to work on dataframes with x,y or lat,long column names, and I couldn't find a way to specify the Shape field when invoking the method. &amp;nbsp;Is this possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code, in general, looks like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fc_lines = &amp;nbsp;gis.content.import_data(df_lines)&lt;/P&gt;&lt;P&gt;map1 = gis.map()&lt;BR /&gt;map1.add_layer(fc_lines)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;df_lines is a dataframe with a column, named "Lines" that contains an arcgis.geometry.Polyline object. &amp;nbsp;At least I think it contains an object - when I print out the dataframe, that column has something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #000000; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;{"paths": [[32.08138, 40.17111], [35.182777, 39.4016666]], "spatialReference": {"wkid": 4326}}&lt;BR /&gt;&lt;BR /&gt;which is the string representation of the object. But if it's actually stored as a string, that's a different matter (and maybe why it won't work). &amp;nbsp;&lt;/P&gt;&lt;P style="color: #000000; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;/P&gt;&lt;P style="color: #000000; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;Is there a way to do what I want using the Python API, or should I somehow export the dataframe to a feature class, if that's even possible. &amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2017 17:06:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/import-pandas-dataframe-with-polyline-field-using/m-p/838137#M3416</guid>
      <dc:creator>Jay_Gregory</dc:creator>
      <dc:date>2017-02-10T17:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: import Pandas DataFrame with Polyline field using Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/import-pandas-dataframe-with-polyline-field-using/m-p/838138#M3417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you actually have a polyline geometry, try following it with &lt;/P&gt;&lt;P&gt;lines = arcgis.features.Feature(fc_lines)&lt;BR /&gt;lines1 = arcgis.features.FeatureSet([lines])&lt;/P&gt;&lt;P&gt;and then&lt;/P&gt;&lt;P&gt;map1.draw(lines1) instead of add_layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If not, to get from the text string to a geometry, you'd need&lt;/P&gt;&lt;P&gt;fc_lines = arcgis.geometry.Polyline(fc_string_thing)&lt;/P&gt;&lt;P&gt;before all that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this works; I got it working for pandas-dataframe-to-polygon.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Feb 2017 15:44:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/import-pandas-dataframe-with-polyline-field-using/m-p/838138#M3417</guid>
      <dc:creator>JillKelly</dc:creator>
      <dc:date>2017-02-21T15:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: import Pandas DataFrame with Polyline field using Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/import-pandas-dataframe-with-polyline-field-using/m-p/838139#M3418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would love to see a code example if you have one. &amp;nbsp;I could not get this to work. &amp;nbsp;I am able to create a FeatureSet made up of Features (the feature is of type "Polyline"), but I can't pass the FeatureSet into draw (I believe the function only takes one item to draw, not a list). &amp;nbsp;And even if I pass in a single Feature, the map refreshes, but I don't see any graphics...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#lines1 = features.FeatureSet(features = df_lines['Lines'])&lt;/P&gt;&lt;P&gt;map1 = gis.map()&lt;BR /&gt;symbol = {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;"type": "esriSLS",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;"style": "esriSLSSolid",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;"color": [115,76,0,255],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;"width": 3&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;for item in df_lines['Lines']:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;print("drawing " + str(item.geometry))&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;map1.draw(shape = item.geometry, symbol=symbol)&lt;BR /&gt;map1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the very least, I can't even get this simple example to work: can you?&lt;/P&gt;&lt;P&gt;my_line = arcgis.geometry.Polyline({"paths": [[38.8,-78.8],[34.2,-117]]})&lt;BR /&gt;my_line_feature = arcgis.features.Feature(my_line, attributes=None)&lt;/P&gt;&lt;P&gt;map1.draw(my_line, symbol=symbol)&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;map1.draw(my_line_feature, symbol=symbol)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2017 20:20:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/import-pandas-dataframe-with-polyline-field-using/m-p/838139#M3418</guid>
      <dc:creator>Jay_Gregory</dc:creator>
      <dc:date>2017-02-24T20:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: import Pandas DataFrame with Polyline field using Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/import-pandas-dataframe-with-polyline-field-using/m-p/838140#M3419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Even though I mixed up x and y, it still won't work &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2017 20:42:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/import-pandas-dataframe-with-polyline-field-using/m-p/838140#M3419</guid>
      <dc:creator>Jay_Gregory</dc:creator>
      <dc:date>2017-02-24T20:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: import Pandas DataFrame with Polyline field using Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/import-pandas-dataframe-with-polyline-field-using/m-p/838141#M3420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Much stripped down, this works:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;my_line_geom = {'paths' : [[[-78.8,38.8],[-78.8,38.2]]]}&lt;BR /&gt;my_line = arcgis.geometry.Polyline(my_line_geom)&lt;BR /&gt;my_line_feature = arcgis.features.Feature(my_line)&lt;BR /&gt;my_line_feature_set = arcgis.features.FeatureSet([my_line_feature])&lt;BR /&gt;map1 = gis.map('Orkney Springs')&lt;BR /&gt;map1.draw(my_line_feature_set)&lt;BR /&gt;map1&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I have not been able to draw both features of a two-feature feature set.&amp;nbsp; Only the second one shows up.&amp;nbsp; Nor have I had any success setting the symbology.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Feb 2017 22:56:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/import-pandas-dataframe-with-polyline-field-using/m-p/838141#M3420</guid>
      <dc:creator>JillKelly</dc:creator>
      <dc:date>2017-02-25T22:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: import Pandas DataFrame with Polyline field using Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/import-pandas-dataframe-with-polyline-field-using/m-p/838142#M3421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks - so it seems like Esri still has some work to do on this API....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2017 15:58:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/import-pandas-dataframe-with-polyline-field-using/m-p/838142#M3421</guid>
      <dc:creator>Jay_Gregory</dc:creator>
      <dc:date>2017-02-27T15:58:38Z</dc:date>
    </item>
  </channel>
</rss>

