Describing data

About describing data

Geoprocessing tools work with all types of data, such as geodatabase feature classes, shapefiles, rasters, tables, topologies, and networks. Each piece of data has properties that can be used to control the flow of a program or the parameters of a tool. For example, the output feature type of an intersect operation is dependent on the type of data being intersected. When the Intersect tool is run in a program on a list of input datasets, it must be able to determine the data types used so the correct output type can be set.
Using the GeoProcessor's getDataElement method, a dataset's properties can be determined and used to make decisions.
The getDataElement method creates an IDataElement object that can be used to describe the given value. All data element classes support the IDataElementinterface. See the following code example:
// Describe the input feature class.
    "C:/program files/arcgis/java/samples/data/usa/usa.gdb");
DEFeatureClass fc = (DEFeatureClass)gp.getDataElement("states", "");
//Open the feature class data element and get the shape type.
if (fc.getShapeType() == esriGeometryType.esriGeometryPolygon){
    System.out.println("Shapetype is a polygon");