Class FieldClass
- Namespace
- ESRI.ArcGIS.Geodatabase
- Assembly
- ESRI.Server.Geodatabase.dll
[Guid("F94F7534-9FDF-11D0-BEC7-00805F7C4268")]
[ClassInterface(ClassInterfaceType.None)]
public class FieldClass : Field, IFieldEdit, IField, IModelInfo, IClone, IGPValue, IXMLSerialize, IPersistStream, IPersist, IGPDescribe
- Inheritance
-
FieldClass
- Implements
- Inherited Members
Constructors
FieldClass()
public FieldClass()
Explicit Interface Implementations
AliasName
The alias name of the field.
virtual string AliasName { get; }
Returns
Remarks
This is only supported on fields from object classes and feature classes that are registered with the geodatabase; Personal, File or ArcSDE geodatabases. For fields coming from other data sources (shapefiles, coverages, etc) the AliasName will be the same string as the field name.
Assign(IClone)
Assigns the properties of src to the receiver.
virtual void Assign(IClone src)
Parameters
srcIClone
CheckValue(object)
Indicates if the value is valid given the field definition.
virtual bool CheckValue(object Value)
Parameters
Valueobject
Returns
Clone()
Clones the receiver and assigns the result to *clone.
virtual IClone Clone()
Returns
DataType
The data type of the value object.
virtual IGPDataType DataType { get; }
Returns
Remarks
The DataType property returns the DataType object associated with this Value object.
DefaultValue
The default value of the field.
virtual object DefaultValue { get; }
Returns
Describe(string)
The description of the named object.
virtual object Describe(string Name)
Parameters
Namestring
Returns
Deserialize(IXMLSerializeData)
Deserializes an object from XML.
virtual void Deserialize(IXMLSerializeData data)
Parameters
dataIXMLSerializeData
Domain
The default domain of the field.
virtual IDomain Domain { get; }
Returns
DomainFixed
Indicates if the field's domain is fixed.
virtual bool DomainFixed { get; }
Returns
Editable
Indicates if the field is editable.
virtual bool Editable { get; }
Returns
Remarks
The Editable property of a field should always be set to TRUE. Setting it to FALSE will prevent all users from editing the contents of the field. To set a field to be read-only, use the IFieldInfo3.ReadOnly property.
It is best to loop through the fields of a feature and skip the fields that are not editable, rather than allowing users to attempt to edit fields that cannot be edited.
Empty()
Clears the value object.
virtual void Empty()
Remarks
The Empty method clears this Value object and releases any associated objects.
GeometryDef
The geometry definition for the field if IsGeometry is TRUE.
virtual IGeometryDef GeometryDef { get; }
Returns
Remarks
<P>The <STRONG>GeometryDef</STRONG> object defines the spatial qualities of a feature class. The most fundmental spatial quality is the Geometry type, for example, point, line, and polygon. Other information necessary to define the feature class includes the spatial referencing system, whether the vertices have height or measure data, and, for geodatabases, the spatial index parameters.</P> <P>The <STRONG>GeometryDef </STRONG>can be accessed from a shape field, that is a field of type <STRONG>esriFieldTypeGeometry</STRONG>. The actual geometry type is defined by the <STRONG>esriGeometryType </STRONG>enumeration, though currently only four values are acceptable with respect to <STRONG>GeometryDef </STRONG>objects: <STRONG>esriGeometryPoint</STRONG>, <STRONG>esriGeometryMultipoint</STRONG>, <STRONG>esriGeometryPolyline</STRONG>, and <STRONG>esriGeometryPolygon</STRONG>.</P> <P>Beware of the confusion between the <STRONG>esriGeometryType</STRONG> enumeration and the similarly named <STRONG>esriFeatureType</STRONG> and <STRONG>esriShapeType</STRONG>. The following table shows the different roles of those enumerations.</P> <DIV class=tablediv> <TABLE class=dtTABLE cellSpacing=0> <TBODY> <TR vAlign=top> <TH class=t width="33%">ArcObjects Enumeration</TH> <TH class=t width="33%">Values</TH> <TH class=t width="33%">Interfaces that use the enumeration</TH></TR> <TR vAlign=top> <TD width="33%"><STRONG>esriGeometryType</STRONG><BR><BR>Type of geometry in a geodatabase. Those in bold are valid for feature classes, others are component geometry objects.</TD> <TD class=t width="33%"><STRONG>esriGeometryPoint<BR>esriGeometryMultipoint<BR>esriGeometryPolygon<BR>esriGeometryPolyline<BR>esriGeometryLine</STRONG><BR>esriGeometryCircularArc<BR>esriGeometryEllipticArc<BR>esriGeometryBezier3Curve<BR>esriGeometryPath<BR>esriGeometryNull<BR>esriGeometryRing<BR>esriGeometryEnvelope<BR>esriGeometryAny<BR>esriGeometryBag<BR>esriGeometryMultiPatch<BR>esriGeometryTriangleStrip<BR>esriGeometryTriangleFan<BR>esriGeometryRay<BR>esriGeometrySphere<BR>esriGeometryTriangles<BR></TD> <TD width="33%">IFeatureClass::ShapeType<BR>IGeometry::GeometryType<BR>IGeometryDef::GeometryType<BR><BR>also<BR>IGeometryDefEdit,<BR>IGeometryFactory,<BR>IEditSketchExtension,<BR>IGridConversionOp,<BR>IDimensionConstructor</TD></TR> <TR vAlign=top> <TD width="33%"><STRONG>esriFeatureType</STRONG><BR><BR>Feature types defined by<BR>feature class extensions</TD> <TD class=t width="33%">esriFTSimple<BR>esriFTSimpleJunction<BR>esriFTSimpleEdge<BR>esriFTComplexJunction<BR>esriFTComplexEdge<BR>esriFTAnnotation<BR>esriFTCoverageAnnotation<BR>esriFTDimension<BR>esriFTRasterCatalogItem<BR></TD> <TD width="33%">IFeature::FeatureType<BR>IFeatureClass::FeatureType<BR>IFeatureClassDescription::FeatureType<BR>IFeatureWorkspace::CreateFeatureClass<BR>IFeatureDataset::CreateFeatureClass<BR><BR>also, IGeometricNetwork and<BR>INetworkLoader</TD></TR> <TR vAlign=top> <TD width="33%"><STRONG>esriShapeType</STRONG><BR><BR>Type of geometry in a<BR>shapefile</TD> <TD class=t width="33%">See the help for esriShapeType<BR>for a full list </TD> <TD width="33%">IFeature::FeatureType<BR>IFeatureClass::FeatureType<BR>IFeatureClassDescription::FeatureType<BR>IFeatureWorkspace::CreateFeatureClass<BR>IFeatureDataset::CreateFeatureClass<BR><BR>also, IGeometricNetwork and<BR>INetworkLoader</TD></TR></TBODY></TABLE></DIV>
GetAsText()
Provides the value of the value object.
virtual string GetAsText()
Returns
Remarks
The GetAsText method returns this Value object as a text string. For DataElement value objects it is the NameString. For simple value objects it is the text string for the scalar value.
GetClassID(out Guid)
virtual void GetClassID(out Guid pClassID)
Parameters
pClassIDGuid
GetSizeMax(out _ULARGE_INTEGER)
virtual void GetSizeMax(out _ULARGE_INTEGER pcbSize)
Parameters
pcbSize_ULARGE_INTEGER
IFieldEdit_AliasName
virtual string IFieldEdit_AliasName { get; }
Returns
Remarks
This is only supported on fields from object classes and feature classes that are registered with a personal, File or ArcSDE geodatabase.
This is not supported for shapefiles, coverages, or other data sources.
You can register a table within the geodatabase to become an object class by right-clicking on the table in ArcCatalog and clicking on "Register with Geodatabase".
IFieldEdit_AliasName_2
The alias name of the field.
virtual string IFieldEdit_AliasName_2 { set; }
Returns
IFieldEdit_CheckValue(object)
virtual bool IFieldEdit_CheckValue(object Value)
Parameters
Valueobject
Returns
IFieldEdit_DefaultValue
virtual object IFieldEdit_DefaultValue { get; }
Returns
IFieldEdit_DefaultValue_2
The default value of the field.
virtual object IFieldEdit_DefaultValue_2 { set; }
Returns
IFieldEdit_Domain
virtual IDomain IFieldEdit_Domain { get; }
Returns
IFieldEdit_DomainFixed
virtual bool IFieldEdit_DomainFixed { get; }
Returns
IFieldEdit_DomainFixed_2
Indicates if the field's domain cannot be modified.
virtual bool IFieldEdit_DomainFixed_2 { set; }
Returns
IFieldEdit_Domain_2
The default domain of the field.
virtual IDomain IFieldEdit_Domain_2 { set; }
Returns
IFieldEdit_Editable
virtual bool IFieldEdit_Editable { get; }
Returns
IFieldEdit_Editable_2
Indicates if the field can be edited. This should always be set to true.
virtual bool IFieldEdit_Editable_2 { set; }
Returns
IFieldEdit_GeometryDef
virtual IGeometryDef IFieldEdit_GeometryDef { get; }
Returns
IFieldEdit_GeometryDef_2
The geometry definition if IsGeometry is TRUE.
virtual IGeometryDef IFieldEdit_GeometryDef_2 { set; }
Returns
Remarks
<P>The <STRONG>GeometryDef</STRONG> object defines the spatial qualities of a feature class. The most fundmental spatial quality is the Geometry type, for example, point, line, and polygon. Other information necessary to define the feature class includes the spatial referencing system, whether the vertices have height or measure data, and, for geodatabases, the spatial index parameters.</P> <P>The <STRONG>GeometryDef </STRONG>can be accessed from a shape field, that is a field of type <STRONG>esriFieldTypeGeometry</STRONG>. The actual geometry type is defined by the <STRONG>esriGeometryType </STRONG>enumeration, though currently only four values are acceptable with respect to <STRONG>GeometryDef </STRONG>objects: <STRONG>esriGeometryPoint</STRONG>, <STRONG>esriGeometryMultipoint</STRONG>, <STRONG>esriGeometryPolyline</STRONG>, and <STRONG>esriGeometryPolygon</STRONG>.</P> <P>Beware of the confusion between the <STRONG>esriGeometryType</STRONG> enumeration and the similarly named <STRONG>esriFeatureType</STRONG> and <STRONG>esriShapeType</STRONG>. The following table shows the different roles of those enumerations.</P> <DIV class=tablediv> <TABLE class=dtTABLE cellSpacing=0> <TBODY> <TR vAlign=top> <TH class=t width="33%">ArcObjects Enumeration</TH> <TH class=t width="33%">Values</TH> <TH class=t width="33%">Interfaces that use the enumeration</TH></TR> <TR vAlign=top> <TD width="33%"><STRONG>esriGeometryType</STRONG><BR><BR>Type of geometry in a geodatabase. Those in bold are valid for feature classes, others are component geometry objects.</TD> <TD class=t width="33%"><STRONG>esriGeometryPoint<BR>esriGeometryMultipoint<BR>esriGeometryPolygon<BR>esriGeometryPolyline<BR>esriGeometryLine</STRONG><BR>esriGeometryCircularArc<BR>esriGeometryEllipticArc<BR>esriGeometryBezier3Curve<BR>esriGeometryPath<BR>esriGeometryNull<BR>esriGeometryRing<BR>esriGeometryEnvelope<BR>esriGeometryAny<BR>esriGeometryBag<BR>esriGeometryMultiPatch<BR>esriGeometryTriangleStrip<BR>esriGeometryTriangleFan<BR>esriGeometryRay<BR>esriGeometrySphere<BR>esriGeometryTriangles<BR></TD> <TD width="33%">IFeatureClass::ShapeType<BR>IGeometry::GeometryType<BR>IGeometryDef::GeometryType<BR><BR>also<BR>IGeometryDefEdit,<BR>IGeometryFactory,<BR>IEditSketchExtension,<BR>IGridConversionOp,<BR>IDimensionConstructor</TD></TR> <TR vAlign=top> <TD width="33%"><STRONG>esriFeatureType</STRONG><BR><BR>Feature types defined by<BR>feature class extensions</TD> <TD class=t width="33%">esriFTSimple<BR>esriFTSimpleJunction<BR>esriFTSimpleEdge<BR>esriFTComplexJunction<BR>esriFTComplexEdge<BR>esriFTAnnotation<BR>esriFTCoverageAnnotation<BR>esriFTDimension<BR>esriFTRasterCatalogItem<BR></TD> <TD width="33%">IFeature::FeatureType<BR>IFeatureClass::FeatureType<BR>IFeatureClassDescription::FeatureType<BR>IFeatureWorkspace::CreateFeatureClass<BR>IFeatureDataset::CreateFeatureClass<BR><BR>also, IGeometricNetwork and<BR>INetworkLoader</TD></TR> <TR vAlign=top> <TD width="33%"><STRONG>esriShapeType</STRONG><BR><BR>Type of geometry in a<BR>shapefile</TD> <TD class=t width="33%">See the help for esriShapeType<BR>for a full list </TD> <TD width="33%">IFeature::FeatureType<BR>IFeatureClass::FeatureType<BR>IFeatureClassDescription::FeatureType<BR>IFeatureWorkspace::CreateFeatureClass<BR>IFeatureDataset::CreateFeatureClass<BR><BR>also, IGeometricNetwork and<BR>INetworkLoader</TD></TR></TBODY></TABLE></DIV>
IFieldEdit_IsNullable
virtual bool IFieldEdit_IsNullable { get; }
Returns
IFieldEdit_IsNullable_2
Indicates if field values can be null.
virtual bool IFieldEdit_IsNullable_2 { set; }
Returns
IFieldEdit_Length
virtual int IFieldEdit_Length { get; }
Returns
IFieldEdit_Length_2
The maximum length, in bytes, for field values.
virtual int IFieldEdit_Length_2 { set; }
Returns
IFieldEdit_Name
virtual string IFieldEdit_Name { get; }
Returns
IFieldEdit_Name_2
The name of the field.
virtual string IFieldEdit_Name_2 { set; }
Returns
IFieldEdit_Precision
virtual int IFieldEdit_Precision { get; }
Returns
Remarks
Precision is always returned as 0 from personal or File geodatabase fields.
IFieldEdit_Precision_2
The precision for field values.
virtual int IFieldEdit_Precision_2 { set; }
Returns
IFieldEdit_RasterDef
virtual IRasterDef IFieldEdit_RasterDef { get; }
Returns
IFieldEdit_RasterDef_2
The raster column definition.
virtual IRasterDef IFieldEdit_RasterDef_2 { set; }
Returns
Remarks
<P>The <STRONG>RasterDef</STRONG> object specifies the property of a raster column, such as description of the column, spatial reference, and for Personal and File geodatabases, whether the Raster field is managed by the geodatabase.</P>
IFieldEdit_Required
virtual bool IFieldEdit_Required { get; }
Returns
IFieldEdit_Required_2
Indicates if the field is required.
virtual bool IFieldEdit_Required_2 { set; }
Returns
IFieldEdit_Scale
virtual int IFieldEdit_Scale { get; }
Returns
Remarks
Precision is always returned as 0 from personal or File geodatabase fields.
IFieldEdit_Scale_2
The scale for field values.
virtual int IFieldEdit_Scale_2 { set; }
Returns
IFieldEdit_Type
virtual esriFieldType IFieldEdit_Type { get; }
Returns
IFieldEdit_Type_2
The type for the field.
virtual esriFieldType IFieldEdit_Type_2 { set; }
Returns
IFieldEdit_VarType
virtual int IFieldEdit_VarType { get; }
Returns
IPersistStream_GetClassID(out Guid)
virtual void IPersistStream_GetClassID(out Guid pClassID)
Parameters
pClassIDGuid
IsDirty()
virtual void IsDirty()
IsEmpty()
Indicates if the value object is empty.
virtual bool IsEmpty()
Returns
Remarks
The IsEmpty method returns if this Value object has been set or not.
IsEqual(IClone)
Indicates if the receiver and other have the same properties.
virtual bool IsEqual(IClone other)
Parameters
otherIClone
Returns
IsIdentical(IClone)
Indicates if the receiver and other are the same object.
virtual bool IsIdentical(IClone other)
Parameters
otherIClone
Returns
IsNullable
Indicates if the field can contain null values.
virtual bool IsNullable { get; }
Returns
Length
The maximum length, in bytes, for values described by the field.
virtual int Length { get; }
Returns
Load(IStream)
virtual void Load(IStream pstm)
Parameters
pstmIStream
ModelName
The model name of the field.
virtual string ModelName { get; set; }
Returns
Remarks
Returns the model name currently associated with the field or object class.
Name
The name of the field.
virtual string Name { get; }
Returns
Remarks
Geodatabase feature classes, depending on their geometry type, may contain automatically generated fields for shape length and area. In personal and file geodatabases, these fields will be named using the name of the shape field suffixed with "_Length" and "_Area". In an SDE geodatabase, the names of these fields will be dependant on the underlying DBMS.
The IFeatureClass::ShapeFieldName property should be used to determine the name of the length and area fields for a feature class.
Precision
The precision for field values.
virtual int Precision { get; }
Returns
Remarks
Precision is the number of digits in a number. For example, the number 56.78 has a precision of 4. Precision is only valid for fields that are numeric. Precision is always returned as 0 from personal or File geodatabase fields.
RasterDef
The raster column definition.
virtual IRasterDef RasterDef { get; }
Returns
Remarks
<P>The <STRONG>RasterDef</STRONG> object specifies the property of a raster column, such as description of the column, spatial reference, and for Personal and File geodatabases, whether the Raster field is managed by the geodatabase.</P>
Required
Indicates if the field is required.
virtual bool Required { get; }
Returns
Save(IStream, int)
virtual void Save(IStream pstm, int fClearDirty)
Parameters
Scale
The scale for field values.
virtual int Scale { get; }
Returns
Remarks
Scale is the number of digits to the right of the decimal point in a number. For example, the number 56.78 has a scale of 2. Scale applies only to fields that are double. Scale is always returned as 0 from personal or File geodatabase fields.
Serialize(IXMLSerializeData)
Serializes an object to XML.
virtual void Serialize(IXMLSerializeData data)
Parameters
dataIXMLSerializeData
SetAsText(string)
Provides the value of the value object with the given string value.
virtual IGPMessage SetAsText(string text)
Parameters
textstring
Returns
Remarks
The SetAsText method sets the value of this Value object as a text string. For DataElement value objects it is the NameString. For simple value objects it is the text string representing the scalar value.
Type
The type of the field.
virtual esriFieldType Type { get; }
Returns
Remarks
For more information on the relation between esriFieldType values and the underlying SDE and DBMS data types, see the following articles in the ArcGIS Help:
- "A comparison of ArcGIS, ArcSDE, and DB2 data types"
- "A comparison of ArcGIS, ArcSDE, and Informix data types"
- "A comparison of ArcGIS, ArcSDE, and PostgreSQL data types"
- "A comparison of ArcGIS, ArcSDE, and Oracle data types"
- "A comparison of ArcGIS, ArcSDE, and SQL Server data types"
The following table outlines the equivalent field data types in ArcCatalog, ArcObjects and .NET:
| ArcCatalog |
esriFieldType (IField::Type) |
.NET Variable Type |
|---|---|---|
| Short Integer | esriFieldTypeSmallInteger | System.Int16 |
| Long Integer | esriFieldTypeInteger | System.Int32 |
| Float | esriFieldTypeSingle | System.Single |
| Double | esriFieldTypeDouble | System.Double |
| Text | esriFieldTypeString | System.String |
| Date | esriFieldTypeDate | System.DateTime |
| Object ID | esriFieldTypeOID | System.Int32 |
| Geometry | esriFieldTypeGeometry | ESRI.ArcGIS.Geometry.IGeometry |
| Blob | esriFieldTypeBlob | ESRI.ArcGIS.esriSystem.IMemoryBlobStream |
| Raster | esriFieldTypeRaster | ESRI.ArcGIS.Geodatabase.IRasterValue |
| GUID | esriFieldTypeGUID | System.String |
| GlobalID | esriFieldTypeGlobalID | System.String |
The following table outlines the Coverage, INFO Item to Geodatabase field mapping:
| Item type | Item width | Geodatabase field type (esriFieldType) |
|---|---|---|
| B | 4 | esriFieldTypeInteger |
| C | 1-320 | esriFieldTypeString |
| D | 8 | esriFieldTypeDate |
| F | 4 | esriFieldTypeSingle |
| F | 8 | esriFieldTypeDouble |
| I | 1-4 | esriFieldTypeSmallInteger |
| I | 5-9 | esriFieldTypeInteger |
| I | 10-16 | esriFieldTypeDouble |
| N | 1-9 | esriFieldTypeSingle |
| N | 10-16 | esriFieldTypeDouble |
The following table outlines the Shapefile, dBASE field to Geodatabase field mapping:
| Field type | Field width | Geodatabase field type (esriFieldType) |
|---|---|---|
| Date | - | esriFieldTypeDate |
| String | 1-255 | esriFieldTypeString |
| Boolean | - | esriFieldTypeString |
| Number | 1-16 (decimals = 0) | esriFieldTypeInteger |
| Number | 1-16 (decimals > 0) | esriFieldTypeDouble |
VarType
The VARTYPE of the field (e.g. VT_I4).
virtual int VarType { get; }
Returns
Remarks
| Field type | VarType |
|---|---|
|
esriFieldTypeSmallInteger esriFieldTypeInteger esriFieldTypeSingle esriFieldTypeDouble esriFieldTypeString esriFieldTypeDate esriFieldTypeOID esriFieldTypeGeometry esriFieldTypeBlob esriFieldTypeRaster esriFieldTypeGUID esriFieldTypeGlobalID |
2 3 4 5 8 7 3 13 13 13 8 8 |