Learn more about in_memory workspace

ArcGIS provides an output feature class write memory and workspace table. As an alternative to writing the processed output geographic location or network location on a disk, the output can be written to the memory workspace. Typically, the data is written to the memory workspace significantly faster than writes to other formats (such as a geographic database feature class or shapefile). However, data is written to memory workspace is temporary and will be deleted when you close the application.

To write data to memory workspace, use the path the in_memory, as shown below.

Work to save memory space

 

In deciding to write output to the working memory space, you must note the following:

caveat caveat:
  • Data written to the memory workspace is temporary and will be deleted when you close the application.
  • Tables, feature classes and raster can be written to memory workspace.
  • Memory workspace does not support extended geodatabase elements such as subtypes, domains, representations, topologies, geometric networks and network datasets.
  • You can not create a feature dataset or folder in the memory workspace.

Managing memory workspace

When data is written to the work memory space, it consumes computer's physical memory (RAM). If you write too much data in this workspace, you may run out of memory all the computers, which can not write additional data to memory. Further, if most or all of the data from this work computer memory space for storage may not have enough memory to efficiently perform a very large amount of computation applications (e.g. ArcGIS). In this case, all tasks execute in the application may be very slow.

In some cases, the use of working memory space will bring the advantages of computing and slow down the application phase offset. When this occurs, the affected system also comprises other applications running and the starting amount of available physical memory. When the application due to data to be written is too large and slow down, avoid using memory workspace.

When you use memory work space, all intermediate data should be deleted as soon as possible to free up system memory resources they take up. You can use the "delete" tool to delete the data memory workspace. Can delete a single table or feature class, you can delete the entire workspace in order to remove all workspace content.

Memory workspace location

Source position table, the feature class or raster will be written to the memory workspace GPInMemoryWorkspace, as shown in FIG.

Memory source location

 

GPInMemoryWorkspace back braces } enclosed {long strings are created and used by the ArcGIS unique identifier.

Use in Python in_memory

You can also use in Python in_memory workspace, as shown in the following code example.

import arcpy

table = arcpy.CreateTable_management("in_memory", "table1") arcpy.AddField_management(table, "Field1", "TEXT", field_length=20) cursor = arcpy.da.InsertCursor(table, ["Field1"]) cursor.insertRow(["Hello World"]) 

in_memory workspace geoprocessing tools only effective; it is not a universal virtual directory can be written to any data.

In the script, use the delete tool to delete the data memory workspace. Can delete a single table or feature class, you can delete the entire workspace in order to remove all workspace content.

Guess you like

Origin www.cnblogs.com/gisoracle/p/11432536.html