<?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: Publishing Feature Layer from SDF creates empty service in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/publishing-feature-layer-from-sdf-creates-empty/m-p/1145462#M7133</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/92801"&gt;@RobertWeber&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Can you share a sample of the spreadsheet?&lt;/P&gt;</description>
    <pubDate>Fri, 18 Feb 2022 01:12:17 GMT</pubDate>
    <dc:creator>MehdiPira1</dc:creator>
    <dc:date>2022-02-18T01:12:17Z</dc:date>
    <item>
      <title>Publishing Feature Layer from SDF creates empty service</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/publishing-feature-layer-from-sdf-creates-empty/m-p/1145410#M7132</link>
      <description>&lt;P&gt;Python API 1.9.1&lt;/P&gt;&lt;P&gt;I am seeing something similar to a few other posts where publishing from a SDF like sdf.spatial.to_featurelayer() creates the layer but there are no features or there is some other problem.&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 nofollow noreferrer"&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 viewer classic?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&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;/PRE&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:53:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/publishing-feature-layer-from-sdf-creates-empty/m-p/1145410#M7132</guid>
      <dc:creator>RobertWeber</dc:creator>
      <dc:date>2022-02-17T22:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: Publishing Feature Layer from SDF creates empty service</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/publishing-feature-layer-from-sdf-creates-empty/m-p/1145462#M7133</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/92801"&gt;@RobertWeber&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Can you share a sample of the spreadsheet?&lt;/P&gt;</description>
      <pubDate>Fri, 18 Feb 2022 01:12:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/publishing-feature-layer-from-sdf-creates-empty/m-p/1145462#M7133</guid>
      <dc:creator>MehdiPira1</dc:creator>
      <dc:date>2022-02-18T01:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: Publishing Feature Layer from SDF creates empty service</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/publishing-feature-layer-from-sdf-creates-empty/m-p/1145625#M7137</link>
      <description>&lt;P&gt;sent&lt;/P&gt;</description>
      <pubDate>Fri, 18 Feb 2022 15:16:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/publishing-feature-layer-from-sdf-creates-empty/m-p/1145625#M7137</guid>
      <dc:creator>RobertWeber</dc:creator>
      <dc:date>2022-02-18T15:16:48Z</dc:date>
    </item>
    <item>
      <title>Re: Publishing Feature Layer from SDF creates empty service</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/publishing-feature-layer-from-sdf-creates-empty/m-p/1145796#M7139</link>
      <description>&lt;P&gt;Looks like the empty service is due to some date fields not being of type datetime and one of them being a Timestamp value in the excel sheet so I think this is the issue.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Feb 2022 21:03:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/publishing-feature-layer-from-sdf-creates-empty/m-p/1145796#M7139</guid>
      <dc:creator>RobertWeber</dc:creator>
      <dc:date>2022-02-18T21:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: Publishing Feature Layer from SDF creates empty service</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/publishing-feature-layer-from-sdf-creates-empty/m-p/1146016#M7149</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/92801"&gt;@RobertWeber&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;That's good to hear.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Feb 2022 01:32:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/publishing-feature-layer-from-sdf-creates-empty/m-p/1146016#M7149</guid>
      <dc:creator>MehdiPira1</dc:creator>
      <dc:date>2022-02-21T01:32:23Z</dc:date>
    </item>
  </channel>
</rss>

