<?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 Error after publishing the Spatially Enabled DataFrame in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-after-publishing-the-spatially-enabled/m-p/838891#M3432</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to publish a SEDF to ArcGIS Portal. In the Jupyter notebook, it indicates it succeeded after I run&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my_sedf.spatial.to_featurelayer("new layer name")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but when I&amp;nbsp;go to portal to inspect the published service, there's an error despite the service seems working OK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/506694_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to overwrite the web layer from ArcGIS Pro to get rid of this error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a tiny bug in the API?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Sep 2020 05:11:27 GMT</pubDate>
    <dc:creator>simoxu</dc:creator>
    <dc:date>2020-09-10T05:11:27Z</dc:date>
    <item>
      <title>Error after publishing the Spatially Enabled DataFrame</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-after-publishing-the-spatially-enabled/m-p/838891#M3432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to publish a SEDF to ArcGIS Portal. In the Jupyter notebook, it indicates it succeeded after I run&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my_sedf.spatial.to_featurelayer("new layer name")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but when I&amp;nbsp;go to portal to inspect the published service, there's an error despite the service seems working OK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/506694_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to overwrite the web layer from ArcGIS Pro to get rid of this error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a tiny bug in the API?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Sep 2020 05:11:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-after-publishing-the-spatially-enabled/m-p/838891#M3432</guid>
      <dc:creator>simoxu</dc:creator>
      <dc:date>2020-09-10T05:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: Error after publishing the Spatially Enabled DataFrame</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-after-publishing-the-spatially-enabled/m-p/1145406#M7131</link>
      <description>&lt;P&gt;I am seeing something similar where publishing from a SDF like sdf.spatial.to_featurelayer() creates the layer but there are no features.&lt;/P&gt;&lt;P&gt;I have followed the&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/sample-notebooks/html-table-to-pandas-data-frame-to-portal-item/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/python/sample-notebooks/html-table-to-pandas-data-frame-to-portal-item/&lt;/A&gt;&amp;nbsp;example but in my case I only need to produce the SDF from known Lat Long fields so I use the following code basically I have tried all the methods out there and all produce broken services or services with features that only show up in the map view classic?&amp;nbsp; No Idea.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;sdf = pd.read_excel("combined gis.xlsx")

#used this as a work around to try instead of the from_xy() same result lat longs are backward in my sheet 
sdf['SHAPE'] = sdf.apply(lambda row : arcgis.geometry.Geometry({'x': row['Long'], 'y': row['Lat'], 'spatialReference': {'wkid': 4326}}), axis=1 )

sdf.spatial.set_geometry(sdf['SHAPE'])
#used this but produces a empty service but the sdf plots fine in the map in my browser
# sdf = dataframe1.spatial.from_xy(dataframe1, x_column='Long', y_column='Lat')

print(len(sdf))
#filtered features with 0,0 in case that was causing a problem
sdf = sdf[sdf.Lat != 0]
print(len(sdf))
print(sdf.spatial.sr)
# print(sdf)

#the import just creates an empty service
# fc = gis.content.import_data(sdf)

#this also creates an empty service
lyr = sdf.spatial.to_featurelayer('EMPTY USELESS LAYER', gis)

#sdf plots fine in the jupyter notebook browser
map1 = gis.map()
map1.add_layer(sdf)
map1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This workflow has never worked for me and so I have always just saved things locally to a feature class in FGDB then published from there.&amp;nbsp; If anyone has any ideas I am listening!&amp;nbsp; from_xy is simple enough but there is something happening when I try to import it or publish it - maybe with the projection?&amp;nbsp; Maybe I am missing something simple.&lt;/P&gt;&lt;P&gt;I have looked at all samples and people have had similar issues but this scenario is even more basic than most and it doesn't work.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 22:44:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-after-publishing-the-spatially-enabled/m-p/1145406#M7131</guid>
      <dc:creator>RobertWeber</dc:creator>
      <dc:date>2022-02-17T22:44:09Z</dc:date>
    </item>
  </channel>
</rss>

