Python Toolbox Parameter Data Types - GP and DE?

720
1
05-25-2019 10:18 PM
hashimotoy2
New Contributor III

Can someone please explain the definitive rationale behind the distinction between data types as GP* and DE*?

The majority of Python Toolbox parameter data types are prefixed with either "GP" or "DE", which I presume stand for 'geoprocessing object' and 'data element'. An illustrative example is the GPLayer and DELayer; the former refers to a geoprocessing layer object while the latter refers to a layer file representing a unit of data (aka data element). The distinction between data types is intuitive in some instances as in this 'layer' example but seems idiosyncratic in others. e.g. Why is a workspace identified as "DE"? Why not a GPWorkspace as a workspace refers to the container in which geoprocessing functions take place? Why "DETool" and not  "GPTool"? Why is a server connection identified as DE data element and not a GP geoprocessing object?

I ask because I have little recall and can't keep them straight in my head and am tired of revisiting the data type help pages whenever I create a new parameter. 

:S

Tags (1)
1 Reply
DanPatterson_Retired
MVP Esteemed Contributor

Can't speak for arcmap, but in ArcGIS pro... you can follow the gp, env trail. 

Workspace is under env, while listworkspaces is in gp. 

Explore a bit when you find the 'arcpy' folder...

# ---- basic geoprocessing information
import arcpy.geoprocessing as ag
dir(ag)
['Geoprocessor', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__',
 '__name__', '__package__', '__path__', '__spec__', '_base', 'env', 'gp']

ag.__path__
['C:\\arc_pro\\Resources\\ArcPy\\arcpy\\geoprocessing']

ag.__file__
'C:\\arc_pro\\Resources\\ArcPy\\arcpy\\geoprocessing\\__init__.py'


# ---- on to gp and env
from arcpy.geoprocessing import gp
dir(gp)

# the list will follow

from arcpy.geoprocessing import env
dir(env)
[.... snip ...., 'workspace']‍‍‍‍‍‍‍‍