Interface IGeometryDefEdit
- Namespace
- ESRI.ArcGIS.Geodatabase
- Assembly
- ESRI.Server.Geodatabase.dll
Provides access to members that modify the geometry definition.
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("439A0D51-3915-11D1-9CA7-0000F8780619")]
public interface IGeometryDefEdit : IGeometryDef
Remarks
The IGeometryDefEdit interface is used when creating a GeometryDef object. You would normally use this interface when defining a new feature class. You cannot use IGeometryDefEdit to modify an existing GeometryDef which is attached to a feature class; the same restrictions apply when using the standard ArcGIS user interface. For example, you cannot change the spatial reference of an existing feature class.
The following are valid Geometry types for a new feature class (from esriGeometryType):
esriGeometryPoint
esriGeometryMultipoint
esriGeometryPolyline
esriGeometryPolygon
esriGeometryMultiPatch
The SpatialReference property should always be set when creating a new GeometryDef. If a GeometryDef without a spatial reference is used to create a stand-alone feature class, an error will occur.
If a feature class is created in a feature dataset, and the SpatialReference property does not match the spatial reference of the feature dataset, the property will be modified to match that of the feature dataset.
The code below shows how to create a geometry field, assuming a spatial reference has already been created:
// Create the GeometryDef and set its spatial reference and geometry type.
IGeometryDef geometryDef = new GeometryDefClass();
IGeometryDefEdit geometryDefEdit = (IGeometryDefEdit)geometryDef;
geometryDefEdit.SpatialReference_2 = spatialReference;
geometryDefEdit.GeometryType_2 = esriGeometryType.esriGeometryPolyline;
// Set the grid count to 1 and the grid size to 0 to allow ArcGIS to
// determine a valid grid size.
geometryDefEdit.GridCount_2 = 1;
geometryDefEdit.set_GridSize(0, 0);
// Create a geometry field and assign the GeometryDef to it.
IField field = new FieldClass();
IFieldEdit fieldEdit = (IFieldEdit)field;
fieldEdit.Name_2 = "SHAPE";
fieldEdit.Type_2 = esriFieldType.esriFieldTypeGeometry;
fieldEdit.GeometryDef_2 = geometryDef;
The code below shows how to create a geometry field, assuming a spatial reference has already been created:
' Create the GeometryDef and set its spatial reference and geometry type.
Dim geometryDef As IGeometryDef = New GeometryDefClass()
Dim geometryDefEdit As IGeometryDefEdit = CType(geometryDef, IGeometryDefEdit)
geometryDefEdit.SpatialReference_2 = spatialReference
geometryDefEdit.GeometryType_2 = esriGeometryType.esriGeometryPolyline
' Set the grid count to 1 and the grid size to 0 to allow ArcGIS to
' determine a valid grid size.
geometryDefEdit.GridCount_2 = 1
geometryDefEdit.GridSize_2(0) = 0
' Create a geometry field and assign the GeometryDef to it.
Dim field As IField = New FieldClass()
Dim fieldEdit As IFieldEdit = CType(field, IFieldEdit)
fieldEdit.Name_2 = "SHAPE"
fieldEdit.Type_2 = esriFieldType.esriFieldTypeGeometry
fieldEdit.GeometryDef_2 = geometryDef
Properties
AvgNumPoints
int AvgNumPoints { get; }
Property Value
AvgNumPoints_2
The estimated average number of points per feature.
int AvgNumPoints_2 { set; }
Property Value
GeometryType
esriGeometryType GeometryType { get; }
Property Value
GeometryType_2
The geometry type.
esriGeometryType GeometryType_2 { set; }
Property Value
GridCount
int GridCount { get; }
Property Value
Remarks
GridCount specifies the number of spatial index grids. Personal Geodatabase feature classes only support one spatial index. Any additional indexes will be ignored. File and ArcSDE Geodatabase feature classes support up to 3 spatial indexes. Each additional index must be larger than the previous index.
GridCount_2
The number of spatial index grids.
int GridCount_2 { set; }
Property Value
GridSize[int]
double GridSize[int Index] { get; }
Parameters
Indexint
Property Value
GridSize_2[int]
The size of a spatial index grid.
double GridSize_2[int Index] { set; }
Parameters
Indexint
Property Value
HasM
bool HasM { get; }
Property Value
HasM_2
Indicates if the feature class will support M values.
bool HasM_2 { set; }
Property Value
HasZ
bool HasZ { get; }
Property Value
HasZ_2
Indicates if the feature class will support Z values.
bool HasZ_2 { set; }
Property Value
SpatialReference
ISpatialReference SpatialReference { get; }
Property Value
SpatialReference_2
The spatial reference of the dataset.
ISpatialReference SpatialReference_2 { set; }