<?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: ERROR 000732 when converting kml to layer with python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/error-000732-when-converting-kml-to-layer-with/m-p/1252271#M66688</link>
    <description>&lt;P&gt;from&amp;nbsp;&lt;A href="https://community.esri.com/t5/python-questions/python-standalone-script-using-arcgis-pro-license/td-p/429606" target="_blank"&gt;Solved: Python standalone script using ArcGIS Pro license - Esri Community&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;for kmz in arcpy.ListFiles("*.km*"):
    print("CONVERTING: {0}".format(os.path.join(arcpy.env.workspace, kmz)))

    kmzFile = os.path.join(arcpy.env.workspace, kmz)
    arcpy.KMLToLayer_conversion(kmzFile, out_location)&lt;/LI-CODE&gt;&lt;P&gt;You just did the path joining for the print statement but didn't carry it over to the KMLToLayer line&lt;/P&gt;</description>
    <pubDate>Fri, 27 Jan 2023 10:26:43 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2023-01-27T10:26:43Z</dc:date>
    <item>
      <title>ERROR 000732 when converting kml to layer with python</title>
      <link>https://community.esri.com/t5/python-questions/error-000732-when-converting-kml-to-layer-with/m-p/1252248#M66686</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am relatively new to python. I am trying to convert km* files into layers in a GDB but I am getting the following error: &lt;EM&gt;ERROR 000732: Input KML File: Dataset 413 REDD Project.kml does not exist or is not supported&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Failed to execute (KMLToLayer).&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Any comments would be highly appreciated&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;arcpy&lt;BR /&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;os&lt;BR /&gt;&lt;SPAN&gt;# Set workspace (where all the KMLs are)&lt;BR /&gt;&lt;/SPAN&gt;arcpy.env.workspace = &lt;SPAN&gt;r'H:\My Drive\map of carbon projects\kmz'&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;# Set local variables and location for the consolidated file geodatabase&lt;BR /&gt;&lt;/SPAN&gt;outLocation = &lt;SPAN&gt;r'H:\My Drive\map of carbon projects\shp'&lt;BR /&gt;&lt;/SPAN&gt;MasterGDB = &lt;SPAN&gt;'AllKMLLayers.gdb'&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;MasterGDBLocation = os.path.join(outLocation&lt;SPAN&gt;, &lt;/SPAN&gt;MasterGDB)&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Create the master FileGeodatabase&lt;BR /&gt;&lt;/SPAN&gt;arcpy.CreateFileGDB_management(outLocation&lt;SPAN&gt;, &lt;/SPAN&gt;MasterGDB)&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Convert all KMZ and KML files found in the current workspace&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;for &lt;/SPAN&gt;kmz &lt;SPAN&gt;in &lt;/SPAN&gt;arcpy.ListFiles(&lt;SPAN&gt;'*.KM*'&lt;/SPAN&gt;):&lt;BR /&gt;    &lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;"CONVERTING: {0}"&lt;/SPAN&gt;.format(os.path.join(arcpy.env.workspace&lt;SPAN&gt;, &lt;/SPAN&gt;kmz)))&lt;BR /&gt;    arcpy.KMLToLayer_conversion(kmz&lt;SPAN&gt;, &lt;/SPAN&gt;outLocation)&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Change the workspace to fGDB location&lt;BR /&gt;&lt;/SPAN&gt;arcpy.env.workspace = outLocation&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Loop through all the FileGeodatabases within the workspace&lt;BR /&gt;&lt;/SPAN&gt;wks = arcpy.ListWorkspaces(&lt;SPAN&gt;'*'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'FileGDB'&lt;/SPAN&gt;)&lt;BR /&gt;&lt;SPAN&gt;# Skip the Master GDB&lt;BR /&gt;&lt;/SPAN&gt;wks.remove(MasterGDBLocation)&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for &lt;/SPAN&gt;fgdb &lt;SPAN&gt;in &lt;/SPAN&gt;wks:&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;# Change the workspace to the current FileGeodatabase&lt;BR /&gt;&lt;/SPAN&gt;    arcpy.env.workspace = fgdb&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;# For every Featureclass inside, copy it to the Master and use the name from the original fGDB&lt;BR /&gt;&lt;/SPAN&gt;    featureClasses = arcpy.ListFeatureClasses(&lt;SPAN&gt;'*'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;''&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'Placemarks'&lt;/SPAN&gt;)&lt;BR /&gt;    &lt;SPAN&gt;for &lt;/SPAN&gt;fc &lt;SPAN&gt;in &lt;/SPAN&gt;featureClasses:&lt;BR /&gt;        &lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;"COPYING: {0} FROM: {1}"&lt;/SPAN&gt;.format(fc&lt;SPAN&gt;, &lt;/SPAN&gt;fgdb))&lt;BR /&gt;        fcCopy = os.path.join(fgdb&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'Placemarks'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;fc)&lt;BR /&gt;        arcpy.FeatureClassToFeatureClass_conversion(fcCopy&lt;SPAN&gt;, &lt;/SPAN&gt;MasterGDBLocation&lt;SPAN&gt;, &lt;/SPAN&gt;fgdb[fgdb.rfind(os.sep) + &lt;SPAN&gt;1&lt;/SPAN&gt;:-&lt;SPAN&gt;4&lt;/SPAN&gt;])&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 27 Jan 2023 07:11:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-000732-when-converting-kml-to-layer-with/m-p/1252248#M66686</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-01-27T07:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 000732 when converting kml to layer with python</title>
      <link>https://community.esri.com/t5/python-questions/error-000732-when-converting-kml-to-layer-with/m-p/1252249#M66687</link>
      <description>&lt;P&gt;Could it be a problem that the kml name starts with a number or the spaces in your pathnames?&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/data-management-blog/how-to-name-things-in-arcgis/ba-p/897194" target="_blank"&gt;https://community.esri.com/t5/data-management-blog/how-to-name-things-in-arcgis/ba-p/897194&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2023 07:37:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-000732-when-converting-kml-to-layer-with/m-p/1252249#M66687</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2023-01-27T07:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 000732 when converting kml to layer with python</title>
      <link>https://community.esri.com/t5/python-questions/error-000732-when-converting-kml-to-layer-with/m-p/1252271#M66688</link>
      <description>&lt;P&gt;from&amp;nbsp;&lt;A href="https://community.esri.com/t5/python-questions/python-standalone-script-using-arcgis-pro-license/td-p/429606" target="_blank"&gt;Solved: Python standalone script using ArcGIS Pro license - Esri Community&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;for kmz in arcpy.ListFiles("*.km*"):
    print("CONVERTING: {0}".format(os.path.join(arcpy.env.workspace, kmz)))

    kmzFile = os.path.join(arcpy.env.workspace, kmz)
    arcpy.KMLToLayer_conversion(kmzFile, out_location)&lt;/LI-CODE&gt;&lt;P&gt;You just did the path joining for the print statement but didn't carry it over to the KMLToLayer line&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2023 10:26:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-000732-when-converting-kml-to-layer-with/m-p/1252271#M66688</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-01-27T10:26:43Z</dc:date>
    </item>
  </channel>
</rss>

