<?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: Converting geodataframe feature layer to AGOL in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/converting-geodataframe-feature-layer-to-agol/m-p/1584443#M11146</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The way that I have done this in the past is like this:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create a spatially enabled dataframe from a geodataframe via geoaccessor's &lt;A href="https://developers.arcgis.com/python/latest/api-reference/arcgis.features.toc.html#arcgis.features.GeoAccessor.from_geodataframe" target="_self"&gt;from_geodataframe&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Then, just publish using to_featurelayer()&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Something like this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.features import GeoAccessor

sdf = GeoAccessor.from_geodataframe(you_gdf)
lyr = sdf.spatial.to_featurelayer("layer_name")&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 12 Feb 2025 14:26:39 GMT</pubDate>
    <dc:creator>EarlMedina</dc:creator>
    <dc:date>2025-02-12T14:26:39Z</dc:date>
    <item>
      <title>Converting geodataframe feature layer to AGOL</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/converting-geodataframe-feature-layer-to-agol/m-p/1584226#M11145</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I'm trying to convert my geodataframe to a feature layer so I can overlay it with other layers from AGOL.&lt;/P&gt;&lt;P&gt;I've been researching for a way to do it; the best way is hosted feature layer. When I publish to my content it only has a table view but I want it has polygons as well.&lt;/P&gt;&lt;P&gt;I was following the documentation from ESRI.&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="HieuTran12_0-1739307348585.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/125114iE278986EEE1BC0D7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HieuTran12_0-1739307348585.png" alt="HieuTran12_0-1739307348585.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2025 20:56:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/converting-geodataframe-feature-layer-to-agol/m-p/1584226#M11145</guid>
      <dc:creator>HieuTran12</dc:creator>
      <dc:date>2025-02-11T20:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: Converting geodataframe feature layer to AGOL</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/converting-geodataframe-feature-layer-to-agol/m-p/1584443#M11146</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The way that I have done this in the past is like this:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create a spatially enabled dataframe from a geodataframe via geoaccessor's &lt;A href="https://developers.arcgis.com/python/latest/api-reference/arcgis.features.toc.html#arcgis.features.GeoAccessor.from_geodataframe" target="_self"&gt;from_geodataframe&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Then, just publish using to_featurelayer()&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Something like this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.features import GeoAccessor

sdf = GeoAccessor.from_geodataframe(you_gdf)
lyr = sdf.spatial.to_featurelayer("layer_name")&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 12 Feb 2025 14:26:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/converting-geodataframe-feature-layer-to-agol/m-p/1584443#M11146</guid>
      <dc:creator>EarlMedina</dc:creator>
      <dc:date>2025-02-12T14:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Converting geodataframe feature layer to AGOL</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/converting-geodataframe-feature-layer-to-agol/m-p/1584461#M11148</link>
      <description>&lt;P&gt;Thanks for your reply. I tried with that solution as well, but this error persists!&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;AttributeError: `np.NaN` was removed in the NumPy 2.0 release. Use `np.nan` instead.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to reinstall numpy but still no luck. Is there any way to overlay data from gdf to an imagery layer from living atlas?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2025 15:32:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/converting-geodataframe-feature-layer-to-agol/m-p/1584461#M11148</guid>
      <dc:creator>HieuTran12</dc:creator>
      <dc:date>2025-02-12T15:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: Converting geodataframe feature layer to AGOL</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/converting-geodataframe-feature-layer-to-agol/m-p/1584631#M11151</link>
      <description>&lt;P&gt;Hmm, that error makes me think maybe the gdf needs a bit of cleanup before getting converted to a sedf? When does that error show up? On the publish attempt, or when trying to do the conversion?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2025 20:50:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/converting-geodataframe-feature-layer-to-agol/m-p/1584631#M11151</guid>
      <dc:creator>EarlMedina</dc:creator>
      <dc:date>2025-02-12T20:50:55Z</dc:date>
    </item>
  </channel>
</rss>

