<?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: Working from geometry to feature to map, can't display polygon feature in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/working-from-geometry-to-feature-to-map-can-t/m-p/830447#M3165</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jill,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the API documentation, I can tell the add_layer is used to add an existing item from your portal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://esri.github.io/arcgis-python-api/apidoc/html/arcgis.widgets.html?highlight=add_layer#arcgis.widgets.MapView.add_layer" title="http://esri.github.io/arcgis-python-api/apidoc/html/arcgis.widgets.html?highlight=add_layer#arcgis.widgets.MapView.add_layer"&gt;arcgis.widgets module — arcgis 1.0 documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since your CTPloy is not an item, it may not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe you can try draw(),&amp;nbsp;&lt;A class="link-titled" href="http://esri.github.io/arcgis-python-api/apidoc/html/arcgis.widgets.html?highlight=draw#arcgis.widgets.MapView.draw" title="http://esri.github.io/arcgis-python-api/apidoc/html/arcgis.widgets.html?highlight=draw#arcgis.widgets.MapView.draw"&gt;arcgis.widgets module — arcgis 1.0 documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Jan 2017 18:01:01 GMT</pubDate>
    <dc:creator>XuehanJing</dc:creator>
    <dc:date>2017-01-26T18:01:01Z</dc:date>
    <item>
      <title>Working from geometry to feature to map, can't display polygon feature</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/working-from-geometry-to-feature-to-map-can-t/m-p/830446#M3164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've created a valid polygon geometry.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;CTcorners = { 'rings' : [[[-72.0,42.0],[-72.1,42.0],[-72.1,42.1],[-72.0,42.1],[-72.0,42.0]]]} # clockwise &lt;BR /&gt;&lt;P&gt;CTpolygeom = arcgis.geometry.Polygon(CTcorners)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I converted it to a feature.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;CTpoly = arcgis.features.Feature(CTpolygeom)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;That step seems to work properly, but when I try to add it to the map,&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;map2 = gis.map('Connecticut') # focus on CT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;map2.basemap = 'topo'&lt;BR /&gt;map2.add_layer(CTpoly)&lt;BR /&gt;map2&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;it throws the error:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;SPAN class=""&gt; TypeError: argument of type 'Feature' is not iterable&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;on the add_layer line.&amp;nbsp; Do I need to make a layer of it for display maybe? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ps -- is 'rings' a reserved term in this context or arbitrary?&amp;nbsp; Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2017 16:37:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/working-from-geometry-to-feature-to-map-can-t/m-p/830446#M3164</guid>
      <dc:creator>JillKelly</dc:creator>
      <dc:date>2017-01-26T16:37:14Z</dc:date>
    </item>
    <item>
      <title>Re: Working from geometry to feature to map, can't display polygon feature</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/working-from-geometry-to-feature-to-map-can-t/m-p/830447#M3165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jill,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the API documentation, I can tell the add_layer is used to add an existing item from your portal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://esri.github.io/arcgis-python-api/apidoc/html/arcgis.widgets.html?highlight=add_layer#arcgis.widgets.MapView.add_layer" title="http://esri.github.io/arcgis-python-api/apidoc/html/arcgis.widgets.html?highlight=add_layer#arcgis.widgets.MapView.add_layer"&gt;arcgis.widgets module — arcgis 1.0 documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since your CTPloy is not an item, it may not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe you can try draw(),&amp;nbsp;&lt;A class="link-titled" href="http://esri.github.io/arcgis-python-api/apidoc/html/arcgis.widgets.html?highlight=draw#arcgis.widgets.MapView.draw" title="http://esri.github.io/arcgis-python-api/apidoc/html/arcgis.widgets.html?highlight=draw#arcgis.widgets.MapView.draw"&gt;arcgis.widgets module — arcgis 1.0 documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2017 18:01:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/working-from-geometry-to-feature-to-map-can-t/m-p/830447#M3165</guid>
      <dc:creator>XuehanJing</dc:creator>
      <dc:date>2017-01-26T18:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: Working from geometry to feature to map, can't display polygon feature</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/working-from-geometry-to-feature-to-map-can-t/m-p/830448#M3166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"item" seems a little vague.&amp;nbsp; I can, for example, add_layer a set of points:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;df1 = pandas.read_csv('CTpolygon.csv', header=0, names=['longitude', 'latitude'])&lt;BR /&gt;rows = np.random.choice(df1.index.values, 499)&lt;BR /&gt;df = df1.ix[rows]&lt;/P&gt;&lt;P&gt;CTpoints = gis.content.import_data(df)&lt;/P&gt;&lt;P&gt;map1 = gis.map('Connecticut') # focus on CT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;map1.basemap = 'topo'&lt;BR /&gt;map1.add_layer(CTpoints)&lt;BR /&gt;map1&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;How is a polygon feature any different in terms of being an "item"?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2017 20:03:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/working-from-geometry-to-feature-to-map-can-t/m-p/830448#M3166</guid>
      <dc:creator>JillKelly</dc:creator>
      <dc:date>2017-01-26T20:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: Working from geometry to feature to map, can't display polygon feature</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/working-from-geometry-to-feature-to-map-can-t/m-p/830449#M3167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A Feature is not a layer and you wont be able to use map.add_layer() to draw the&amp;nbsp;feature in the map widget. You can convert the feature to a featureset and use map.draw() to draw it:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;map.draw(FeatureSet([&lt;SPAN style="background-color: #f6f6f6;"&gt;CTpoly]))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;import_data() results in a FeatureCollection which is a layer that can be added to a map widget.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Feb 2017 19:32:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/working-from-geometry-to-feature-to-map-can-t/m-p/830449#M3167</guid>
      <dc:creator>RohitSingh2</dc:creator>
      <dc:date>2017-02-06T19:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Working from geometry to feature to map, can't display polygon feature</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/working-from-geometry-to-feature-to-map-can-t/m-p/830450#M3168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rohit.&amp;nbsp; I had tried converting it to a Layer, but I overlooked FeatureSet.&amp;nbsp; It works!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2017 14:38:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/working-from-geometry-to-feature-to-map-can-t/m-p/830450#M3168</guid>
      <dc:creator>JillKelly</dc:creator>
      <dc:date>2017-02-07T14:38:47Z</dc:date>
    </item>
  </channel>
</rss>

