<?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 Using geoprocessing tools in Python script that give warning and NO data in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/using-geoprocessing-tools-in-python-script-that/m-p/255631#M19637</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Part of the script that I am writing is to take the geocoded results and copy them both to an existing yearly file and to a file that is stamped with the date run and the userid.&amp;nbsp; Both of these will 'create' in the file geodatabase but both return the WARNING 000117:&amp;nbsp; Warning empty output generated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have checked the spatial reference for both the copied from the original feature class and the newly created feature class and both are the SAME as the geocoded results file.&amp;nbsp; I would expect to get this warning on the one that I am running fc2fc using an empty template for, but not for the one that I am appending data to a direct copy of the original.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The if..else section criteria about the arcpy.exists will be changed in the future, I just want it to work right now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Python code snippet:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# import &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy, time, datetime, getpass&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#getting current time and user&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;now = datetime.datetime.today()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;date_stamp = now.strftime("%m%d%Y")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;maintid = getpass.getuser()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;curyear = now.strftime("%Y")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#variables&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;wksp = arcpy.env.workspace = (r"j:\NewData.gdb")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd = arcpy.mapping.MapDocument(r"j:\mxdfiles\NewData.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;df = arcpy.mapping.ListDataFrames(mxd,"Layers")[0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;saveGeocode = arcpy.GetParameterAsText(0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outFile = r"\FeatTable_"+maintid+"_"+date_stamp&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;yearlyFile = wksp+"\FeatTable"+curyear+"_"+maintid&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;curGeocode = wksp+outFile&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;templateFC = wksp+"\FCTemplate"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#Set up the env&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#arcpy.env.overwriteOutput = True&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if saveGeocode == 'Y' or saveGeocode == 'y':&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; layer2manipulate = arcpy.mapping.ListLayers(mxd,"FeatTable",df)[0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if arcpy.Exists(layer2manipulate):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.FeatureClassToFeatureClass_conversion(templateFC,wksp,outFile)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Append_management(layer2manipulate,yearlyFile,"NO_TEST")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Append_management(layer2manipulate,curGeocode,"NO_TEST")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage(r"Geocoded data has been archived (saved) for future reference.")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage(r"You must run the geocoding process first.")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;else:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage(r"Geocoding data will not be saved and will be overwritten next time.")&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Aug 2011 19:24:27 GMT</pubDate>
    <dc:creator>LorindaGilbert</dc:creator>
    <dc:date>2011-08-03T19:24:27Z</dc:date>
    <item>
      <title>Using geoprocessing tools in Python script that give warning and NO data</title>
      <link>https://community.esri.com/t5/python-questions/using-geoprocessing-tools-in-python-script-that/m-p/255631#M19637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Part of the script that I am writing is to take the geocoded results and copy them both to an existing yearly file and to a file that is stamped with the date run and the userid.&amp;nbsp; Both of these will 'create' in the file geodatabase but both return the WARNING 000117:&amp;nbsp; Warning empty output generated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have checked the spatial reference for both the copied from the original feature class and the newly created feature class and both are the SAME as the geocoded results file.&amp;nbsp; I would expect to get this warning on the one that I am running fc2fc using an empty template for, but not for the one that I am appending data to a direct copy of the original.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The if..else section criteria about the arcpy.exists will be changed in the future, I just want it to work right now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Python code snippet:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# import &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy, time, datetime, getpass&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#getting current time and user&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;now = datetime.datetime.today()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;date_stamp = now.strftime("%m%d%Y")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;maintid = getpass.getuser()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;curyear = now.strftime("%Y")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#variables&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;wksp = arcpy.env.workspace = (r"j:\NewData.gdb")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd = arcpy.mapping.MapDocument(r"j:\mxdfiles\NewData.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;df = arcpy.mapping.ListDataFrames(mxd,"Layers")[0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;saveGeocode = arcpy.GetParameterAsText(0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outFile = r"\FeatTable_"+maintid+"_"+date_stamp&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;yearlyFile = wksp+"\FeatTable"+curyear+"_"+maintid&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;curGeocode = wksp+outFile&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;templateFC = wksp+"\FCTemplate"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#Set up the env&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#arcpy.env.overwriteOutput = True&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if saveGeocode == 'Y' or saveGeocode == 'y':&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; layer2manipulate = arcpy.mapping.ListLayers(mxd,"FeatTable",df)[0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if arcpy.Exists(layer2manipulate):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.FeatureClassToFeatureClass_conversion(templateFC,wksp,outFile)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Append_management(layer2manipulate,yearlyFile,"NO_TEST")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Append_management(layer2manipulate,curGeocode,"NO_TEST")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage(r"Geocoded data has been archived (saved) for future reference.")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage(r"You must run the geocoding process first.")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;else:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage(r"Geocoding data will not be saved and will be overwritten next time.")&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2011 19:24:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-geoprocessing-tools-in-python-script-that/m-p/255631#M19637</guid>
      <dc:creator>LorindaGilbert</dc:creator>
      <dc:date>2011-08-03T19:24:27Z</dc:date>
    </item>
  </channel>
</rss>

