Functions | Properties
Shapefile attribute table
Shapefile modules

Functions

int Shapefile.EditAddField (string Name, FieldType Type, int Precision, int Width)
 Adds a field to the attribute table of the shapefile. The table must be in editing mode.
bool Shapefile.EditCellValue (int FieldIndex, int ShapeIndex, object newVal)
 Sets the new value for particular cell in attribute table. The table must be in editing mode.
bool Shapefile.EditDeleteField (int FieldIndex, ICallback cBack)
 Deletes a field with the specified index from the attribute table. The table must be in editing mode.
bool Shapefile.EditInsertField (Field NewField, ref int FieldIndex, ICallback cBack)
 Inserts a new field in the shapefile attribute table. The table must be in editing mode.
object Shapefile.get_CellValue (int FieldIndex, int ShapeIndex)
 Gets the value of the specified field for the shape.
Field Shapefile.get_Field (int FieldIndex)
 Gets a specific field stored in the attribute table.
Field Shapefile.get_FieldByName (string Fieldname)
 Gets specific field stored in the attribute table.
int Shapefile.get_FieldIndexByName (string FieldName)
 Gets index of field with specified name.
bool Shapefile.StartEditingTable (ICallback cBack)
 Opens editing mode for the attribute table.
bool Shapefile.StopEditingTable (bool ApplyChanges, ICallback cBack)
 Closes the editing mode for the attribute table.

Properties

bool Shapefile.EditingTable [get]
 Gets the value indicating whether editing operations are allowed for shapefile attribute table.
int Shapefile.NumFields [get]
 Gets the number of fields in attribute table of the shapefile.
Table Shapefile.Table [get]
 Gets the reference to the attribute table associated with the shapefile.

Detailed Description

Here is a list of properties and methods to for interaction with attribute table associated with a shapefile. This module is a part of the documentation of Shapefile class.

dot_inline_dotgraph_27.png

Graph description


Function Documentation

int Shapefile.EditAddField ( string  Name,
FieldType  Type,
int  Precision,
int  Width 
)

Adds a field to the attribute table of the shapefile. The table must be in editing mode.

Parameters:
NameThe name of field.
TypeThe type of field.
PrecisionThe precision of field.
WidthThe width of field.
Returns:
The index of the new field or -1 on failure.
Examples:
AddCategoryRange.cs, CreateBuffer.cs, RemoveShape.cs, and Segmentation.cs.
bool Shapefile.EditCellValue ( int  FieldIndex,
int  ShapeIndex,
object  newVal 
)

Sets the new value for particular cell in attribute table. The table must be in editing mode.

Parameters:
FieldIndexThe index of field in attribute table.
ShapeIndexThe index of shape (row number in attribute table).
newValThe variant value to be passed (integer, double and string values are accepted depending on field type).
Returns:
True on success and false otherwise.
Examples:
AddCategoryRange.cs, CalculateArea.cs, CreateBuffer.cs, EditAttributes.cs, IntersectionLength.cs, MinimalDistance.cs, and Segmentation.cs.
bool Shapefile.EditDeleteField ( int  FieldIndex,
ICallback  cBack 
)

Deletes a field with the specified index from the attribute table. The table must be in editing mode.

Parameters:
FieldIndexAn index of field to be deleted.
cBackAn instance of class implementing ICallback interface. It's recommended to pass NULL and use Shapefile.GlobalCallback property instead.
Returns:
Returns true on success and false otherwise
bool Shapefile.EditInsertField ( Field  NewField,
ref int  FieldIndex,
ICallback  cBack 
)

Inserts a new field in the shapefile attribute table. The table must be in editing mode.

Parameters:
NewFieldA new instance of field object to insert.
FieldIndexA position to insert the new field. An invalid index will be automatically substituted with 0 or Shapefile.NumFields.
cBackAn instance of class implementing ICallback interface. It's recommended to pass NULL and use Shapefile.GlobalCallback property instead.
Returns:
True on success and false otherwise.
Examples:
IntersectionLength.cs, and MinimalDistance.cs.
object Shapefile.get_CellValue ( int  FieldIndex,
int  ShapeIndex 
)

Gets the value of the specified field for the shape.

The value will be returned as VARIANT data type. When passing to then .NET it will be converted to either integer, double or string data type depending on the type of field.

Parameters:
FieldIndexThe index of field.
ShapeIndexThe index of shape.
Returns:
The value stored in the field.
Examples:
ShowAttributes.cs, and ZoomToValues.cs.
Field Shapefile.get_Field ( int  FieldIndex)

Gets a specific field stored in the attribute table.

Parameters:
FieldIndexThe index of the field to be retrieved.
Returns:
Reference to the field object or NULL reference on failure.
Field Shapefile.get_FieldByName ( string  Fieldname)

Gets specific field stored in the attribute table.

Parameters:
FieldnameThe name of the field to be retrieved. The comparison of the names is case insensitive.
Returns:
Reference to the field object or NULL reference on failure.
int Shapefile.get_FieldIndexByName ( string  FieldName)

Gets index of field with specified name.

Parameters:
FieldNameField name.
Returns:
Index of field in attribute table or -1 if no such field is found.
New API 4.9.3:
Added in version 4.9.3

Opens editing mode for the attribute table.

Parameters:
cBackA callback object to report errors and progress information.
Returns:
True on success and false otherwise.
Examples:
AddCategoryRange.cs, and CalculateArea.cs.
bool Shapefile.StopEditingTable ( bool  ApplyChanges,
ICallback  cBack 
)

Closes the editing mode for the attribute table.

Parameters:
ApplyChangesA boolean value which indicates whether changes made to the memory version of table should be saved to the drive.
cBackA callback object to report errors and progress information.
Returns:
True on success and false otherwise.
Examples:
CalculateArea.cs.

Properties

Gets the value indicating whether editing operations are allowed for shapefile attribute table.

Use Shapefile.StartEditingTable and Shapefile.StopEditingTable to control editing mode.

Examples:
CalculateArea.cs.

Gets the number of fields in attribute table of the shapefile.

Examples:
EditAttributes.cs, MinimalDistance.cs, and ShowAttributes.cs.

Gets the reference to the attribute table associated with the shapefile.

Examples:
AddCategoryRange.cs, CalculateArea.cs, EditAttributes.cs, PointIcons.cs, SelectBox.cs, ShowAttributes.cs, SplitByAttribute.cs, and ToolTip.cs.
 All Classes Files Functions Enumerations Properties Events