<?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: creating a Feature layer fromcsv and excel data using makeFeatureLayer and want to add this layer to a newly created webmap . in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/creating-a-feature-layer-fromcsv-and-excel-data/m-p/1333272#M68926</link>
    <description>&lt;P&gt;Thanks for the help. done as said please provide solution&lt;/P&gt;</description>
    <pubDate>Thu, 28 Sep 2023 09:56:22 GMT</pubDate>
    <dc:creator>abhishek_choudhary</dc:creator>
    <dc:date>2023-09-28T09:56:22Z</dc:date>
    <item>
      <title>creating a Feature layer fromcsv and excel data using makeFeatureLayer and want to add this layer to a newly created webmap .</title>
      <link>https://community.esri.com/t5/python-questions/creating-a-feature-layer-fromcsv-and-excel-data/m-p/1333246#M68924</link>
      <description>&lt;P&gt;I created a feature layer from excel and csv data using makeFeatureLayer method and after creating the feature layer i want to add this feature layer to a newly created webmap object and then host it to AGOL&lt;BR /&gt;Is this possible if not suggest other way for this workFlow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def make_feature_layer_using_csv_excel():
file_path=input("Enter the file Path: ")
file_name = os.path.splitext(os.path.basename(file_path))[0]
wm = WebMap()

feature_class_file_name=file_name+'_'+'featureClass'
feature_layer_name=file_name+'_'+'Layer'



print("fileName: ",file_name)
output_file_dir=os.path.join(os.getcwd(),"MyProject1.gdb")
output_file_path=os.path.join(output_file_dir,feature_class_file_name)
feature_layer_path=os.path.join(os.getcwd(),file_name+'.lyrx')
print("outputfilePath: ",feature_layer_path)

file_extension=os.path.splitext(file_path)[1].lower()

if file_extension == '.csv':
arcpy.conversion.TableToTable(file_path, output_file_dir, file_name)
elif file_extension in ['.xlsx', '.xls', '.xlsb']:
arcpy.conversion.ExcelToTable(file_path, output_file_dir,file_name)
else:
return "Unknown"

arcpy.management.XYTableToPoint(file_path, output_file_path,"Longitude", "Latitude")
feature_layer=arcpy.management.MakeFeatureLayer(output_file_path, out_layer='featureLayer')

arcpy.management.SaveToLayerFile('featureLayer',feature_layer_path )
featureLayer=feature_layer.getOutput(0)
print(type(featureLayer))
insertLyr = arcpy.mp.LayerFile(feature_layer_path)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;this is the logic for feature layer creation&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 09:54:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-a-feature-layer-fromcsv-and-excel-data/m-p/1333246#M68924</guid>
      <dc:creator>abhishek_choudhary</dc:creator>
      <dc:date>2023-09-28T09:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: creating a Feature layer fromcsv and excel data using makeFeatureLayer and want to add this layer to a newly created webmap .</title>
      <link>https://community.esri.com/t5/python-questions/creating-a-feature-layer-fromcsv-and-excel-data/m-p/1333255#M68925</link>
      <description>&lt;P&gt;&lt;A href="https://community.esri.com/t5/python-blog/code-formatting-the-community-version/ba-p/1007633" target="_blank"&gt;Code formatting ... the Community Version - Esri Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;would help to check for errors and provide help&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 07:04:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-a-feature-layer-fromcsv-and-excel-data/m-p/1333255#M68925</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-09-28T07:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: creating a Feature layer fromcsv and excel data using makeFeatureLayer and want to add this layer to a newly created webmap .</title>
      <link>https://community.esri.com/t5/python-questions/creating-a-feature-layer-fromcsv-and-excel-data/m-p/1333272#M68926</link>
      <description>&lt;P&gt;Thanks for the help. done as said please provide solution&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 09:56:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-a-feature-layer-fromcsv-and-excel-data/m-p/1333272#M68926</guid>
      <dc:creator>abhishek_choudhary</dc:creator>
      <dc:date>2023-09-28T09:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: creating a Feature layer fromcsv and excel data using makeFeatureLayer and want to add this layer to a newly created webmap .</title>
      <link>https://community.esri.com/t5/python-questions/creating-a-feature-layer-fromcsv-and-excel-data/m-p/1333475#M68927</link>
      <description>&lt;P&gt;It lacks proper indentation, hence it won't work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it was properly indented, you don't indicate what it did, or is it untried?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 17:33:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-a-feature-layer-fromcsv-and-excel-data/m-p/1333475#M68927</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-09-28T17:33:22Z</dc:date>
    </item>
  </channel>
</rss>

