<?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: Using in_memory in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/using-in-memory/m-p/237392#M18449</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Any suggestions on how I can speed this process up?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Don't know much about geocoding first hand, but came across this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://blogs.esri.com/dev/blogs/geocoding/archive/2011/02/09/tuning-a-locator-for-improved-performance.aspx"&gt;http://blogs.esri.com/dev/blogs/geocoding/archive/2011/02/09/tuning-a-locator-for-improved-performance.aspx&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Oct 2011 20:48:41 GMT</pubDate>
    <dc:creator>MathewCoyle</dc:creator>
    <dc:date>2011-10-26T20:48:41Z</dc:date>
    <item>
      <title>Using in_memory</title>
      <link>https://community.esri.com/t5/python-questions/using-in-memory/m-p/237387#M18444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I want to build my input table in memory to help speed the geocoding process up. However, when I try it tells me the table does not exsist. What am I doing wrong?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

Input_address = arcpy.GetParameterAsText(0)
Input_city = arcpy.GetParameterAsText(1)
Input_state = arcpy.GetParameterAsText(2)
Input_zip = arcpy.GetParameterAsText(3)

address = Input_address
city = Input_city
state = Input_state
zipcode = Input_zip
print address + ', ' + city + ', ' + state, zipcode

#Table Creation
Distance_gdb = 'in_memory\\'
Test_DB = Distance_gdb + '\\temp.dbf'

arcpy.CreateTable_management(Distance_gdb, "temp.dbf", "", "")
arcpy.AddField_management(Test_DB, "address", "TEXT", "", "", "", "", "NON_NULLABLE", "REQUIRED", "")
arcpy.AddField_management(Test_DB, "city", "TEXT", "", "", "", "", "NON_NULLABLE", "NON_REQUIRED", "")
arcpy.AddField_management(Test_DB, "state", "TEXT", "", "", "", "", "NON_NULLABLE", "NON_REQUIRED", "")
arcpy.AddField_management(Test_DB, "zipcode", "TEXT", "", "", "", "", "NULLABLE", "NON_REQUIRED", "")

Add_field = 'address'
City_field = 'city'
state_field = 'state'
zip_field = 'zipcode'

#Table populate
cur = arcpy.InsertCursor(Test_DB)
row = cur.newRow()
row.setValue(Add_field, address)
row.setValue(City_field, city)
row.setValue(state_field, state)
row.setValue(zip_field, zipcode)
cur.insertRow(row)

#Geocode 
Input_Table = Test_DB 
US_StreetAddress_Enhanced = "Z:\\NewYork\\US_StreetAddress_Enhanced" #Locator
Geo_Address = 'in_memory\\Geo_Point' #Geocoded results
arcpy.GeocodeAddresses_geocoding(Input_Table, US_StreetAddress_Enhanced, "Street address VISIBLE NONE;City City VISIBLE NONE;State State VISIBLE NONE;ZIP zipcode VISIBLE NONE", Geo_Address, "STATIC")
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The table creation works fine but the Add Field fails&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.&lt;BR /&gt;ERROR 000732: Input Table: Dataset in_memory\\temp.dbf does not exist or is not supported&lt;BR /&gt;Failed to execute (AddField).&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:57:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-in-memory/m-p/237387#M18444</guid>
      <dc:creator>ScottBlankenbeckler</dc:creator>
      <dc:date>2021-12-11T11:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using in_memory</title>
      <link>https://community.esri.com/t5/python-questions/using-in-memory/m-p/237388#M18445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'll go out on a limb and say you can't make a dBase file in the in_memory workspace. My understanding is that in_memory is like a GDB-lite (only GDB tables and feature classes allowed). I'd try deleting all ".dbf"s.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Oct 2011 20:21:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-in-memory/m-p/237388#M18445</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2011-10-26T20:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: Using in_memory</title>
      <link>https://community.esri.com/t5/python-questions/using-in-memory/m-p/237389#M18446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can put tables in memory. In another script I am placing the results of arcpy.GenerateNearTable_analysis(Geo_Address_P, "Zip_p2", Table_of_Zipcode_Distances, "", "NO_LOCATION", "NO_ANGLE", "ALL", "0")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; into memory and&amp;nbsp; then using it for further processes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;DOH now I understand what you are saying. If I tell it just \\temp and not \\temp.dbf if works.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now my only problem is it still takes way to long to create and geocode. 2.7s to Create and 38.6 sec to geocode.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Oct 2011 20:28:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-in-memory/m-p/237389#M18446</guid>
      <dc:creator>ScottBlankenbeckler</dc:creator>
      <dc:date>2011-10-26T20:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: Using in_memory</title>
      <link>https://community.esri.com/t5/python-questions/using-in-memory/m-p/237390#M18447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Aye, even though it lets you "create" the table in memory using .dbf, it will simply ignore that and reference the base name. Something like the following should work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
...
arcpy.CreateTable_management("in_memory", "temp")
arcpy.AddField_management(r"in_memory\temp", "address", "TEXT", "", "", "", "", "NON_NULLABLE", "REQUIRED", "")
...
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:57:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-in-memory/m-p/237390#M18447</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2021-12-11T11:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using in_memory</title>
      <link>https://community.esri.com/t5/python-questions/using-in-memory/m-p/237391#M18448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;$ python test4.py '301 Park Ave' 'New York' NY 10022&lt;BR /&gt;301 Park Ave, New York, NY 10022&lt;BR /&gt;Time elapsed Table Create:&amp;nbsp; 2.65299987793 s&lt;BR /&gt;Time elapsed Table Populate:&amp;nbsp; 0.0160000324249 s&lt;BR /&gt;Time elapsed Geocode:&amp;nbsp; 14.6960000992 s&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions on how I can speed this process up?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Oct 2011 20:40:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-in-memory/m-p/237391#M18448</guid>
      <dc:creator>ScottBlankenbeckler</dc:creator>
      <dc:date>2011-10-26T20:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: Using in_memory</title>
      <link>https://community.esri.com/t5/python-questions/using-in-memory/m-p/237392#M18449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Any suggestions on how I can speed this process up?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Don't know much about geocoding first hand, but came across this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://blogs.esri.com/dev/blogs/geocoding/archive/2011/02/09/tuning-a-locator-for-improved-performance.aspx"&gt;http://blogs.esri.com/dev/blogs/geocoding/archive/2011/02/09/tuning-a-locator-for-improved-performance.aspx&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Oct 2011 20:48:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-in-memory/m-p/237392#M18449</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2011-10-26T20:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using in_memory</title>
      <link>https://community.esri.com/t5/python-questions/using-in-memory/m-p/237393#M18450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I always thought that when you use in_memory, it creates a file geodatabase in your temp drive, so it is not really 'in memory', there will likely be minimal performance gains, it is more of a convenience factor (although with it being stated using this does improve performance, I may be wrong).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Some goods tips on improving performance from the 2011 UC here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/gallery/file/geoprocessing/details?entryID=3E582F8E-1422-2418-88A4-9DF6FE3C2CFE"&gt;http://resources.arcgis.com/gallery/file/geoprocessing/details?entryID=3E582F8E-1422-2418-88A4-9DF6FE3C2CFE&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2011 10:57:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-in-memory/m-p/237393#M18450</guid>
      <dc:creator>AnthonyFarndon</dc:creator>
      <dc:date>2011-10-27T10:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using in_memory</title>
      <link>https://community.esri.com/t5/python-questions/using-in-memory/m-p/237394#M18451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002w0000005s000000"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002w0000005s000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in_memory is in memory, if it were on disk there wouldn't be restrictions on what operations could or couldn't be written to it. It may reference a location on the hard drive for some file management reason over my head, but it is held directly in memory as well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, from the UC performance tips slides you linked&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;When you write intermediate data&lt;BR /&gt;-Do use in_memoryworkspace&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2011 12:33:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-in-memory/m-p/237394#M18451</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2011-10-27T12:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: Using in_memory</title>
      <link>https://community.esri.com/t5/python-questions/using-in-memory/m-p/237395#M18452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002w0000005s000000"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002w0000005s000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;in_memory is in memory&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ah, so it is, I stand corrected.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2011 15:27:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-in-memory/m-p/237395#M18452</guid>
      <dc:creator>AnthonyFarndon</dc:creator>
      <dc:date>2011-10-27T15:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: Using in_memory</title>
      <link>https://community.esri.com/t5/python-questions/using-in-memory/m-p/237396#M18453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;While there is probably some performance increase having the address list stored in_memory, the real perfomance gain would be any enhancements that could be made to your geocoding service... Have you set it up correctly and in the most efficient way possible?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you ever seen this? &lt;/SPAN&gt;&lt;A href="http://code.google.com/p/geopy"&gt;http://code.google.com/p/geopy&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's pretty dang cool...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2011 19:50:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-in-memory/m-p/237396#M18453</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2011-10-27T19:50:42Z</dc:date>
    </item>
  </channel>
</rss>

