Here is a list of properties and methods which control the editing of shapefile. This module is a part of the documentation of Shapefile class.
Graph description
◆ EditAddShape()
int Shapefile.EditAddShape |
( |
Shape |
shape | ) |
|
◆ EditClear()
bool Shapefile.EditClear |
( |
| ) |
|
Deletes all the shapes from the shapefile.
Both shapefile and attribute table must be in editing mode for the successful operation. The records of attribute table will be removed as well to ensure shapefile integrity.
- Returns
- Returns true on success and false otherwise.
◆ EditDeleteShape()
bool Shapefile.EditDeleteShape |
( |
int |
shapeIndex | ) |
|
Deletes a shape from the shapefile.
Both shapefile and attribute table must be in editing mode for the successful operation. Corresponding record will be removed from attribute table to ensure shapefile integrity. Indices of shapes after the deleted one will be decreased by 1 after the operation.
- Parameters
-
shapeIndex | The index of shape to delete. |
- Returns
- Returns true on success and false otherwise.
- See also
- Shapefile.EditingShapes, Shapefile.EditingTable
- Examples
- RemoveShape.cs.
◆ EditInsertShape()
bool Shapefile.EditInsertShape |
( |
Shape |
shape, |
|
|
ref int |
shapeIndex |
|
) |
| |
Inserts a new shape in the shapefile.
Both shapefile and attribute table must be in editing mode for the successful operation. A record will be automatically added to the attribute table to ensure shapefile integrity.
- Parameters
-
shape | The shape object to insert. |
shapeIndex | The index to insert the new shape at. An invalid index will be automatically substituted with closest allowable value without reporting the error. |
- Returns
- True on success and false otherwise.
- Examples
- CreateBuffer.cs, LinePattern.cs, MarkPoints.cs, and SplitByAttribute.cs.
◆ EditUpdateShape()
bool Shapefile.EditUpdateShape |
( |
int |
shapeIndex, |
|
|
Shape |
shpNew |
|
) |
| |
Substitutes shape at specified index with another instance.
The method doesn't affect attribute table values.
- Parameters
-
shapeIndex | Index of shape to substitute. |
shpNew | New shape to substitute an existing one with. |
- Returns
- True on success.
- New API 4.9.3:
- Added in version 4.9.3
◆ get_ShapeModified()
bool Shapefile.get_ShapeModified |
( |
int |
shapeIndex | ) |
|
Gets a value indicating whether particular shape was modified after shapefile was opened.
- Parameters
-
shapeIndex | Index of shape. |
- Returns
- The value of modified flag.
This property is used by OgrLayer.SaveChanges method to determine shape records to be updated in datasource. The flag is set to true automatically only on insertion of a new shape. For other types of edits (editing of vertices, editing of attributes) the flag must be set in the client code.
- New API 4.9.3:
- Added in version 4.9.3
◆ set_ShapeModified()
void Shapefile.set_ShapeModified |
( |
int |
shapeIndex, |
|
|
bool |
newVal |
|
) |
| |
Sets a value indicating whether particular shape was modified after shapefile was opened.
This property is used by OgrLayer.SaveChanges method to determine shape records to be updated in datasource. The flag is set to true automatically only on insertion of a new shape. For other types of edits (editing of vertices, editing of attributes) the flag must be set in the client code.
- Parameters
-
shapeIndex | Index of shape. |
newVal | New value of modified flag. |
- Returns
- New value of modified flag.
- New API 4.9.3:
- Added in version 4.9.3
◆ StartEditingShapes()
bool Shapefile.StartEditingShapes |
( |
bool |
startEditTable, |
|
|
ICallback |
cBack |
|
) |
| |
Starts editing mode for the shapefile.
In case editing mode has already been opened the new call will return true which is different from the behaviour of the earlier versions (before 4.8).
- Parameters
-
startEditTable | A value which indicate whether or not the editing mode will be opened for attribute table associated with the shapefile. |
cBack | A callback object to report errors and progress information. |
- Returns
- Returns true on successful opening of the editing mode and false on failure.
- Examples
- IntersectionLength.cs, MinimalDistance.cs, SelectBox.cs, and ToolTip.cs.
◆ StopEditingShapes()
bool Shapefile.StopEditingShapes |
( |
bool |
applyChanges, |
|
|
bool |
stopEditTable, |
|
|
ICallback |
cBack |
|
) |
| |
Stops editing modes for the shapefile and optionally saves the changes.
- Parameters
-
applyChanges | The value which indicates whether changes made to the shapefile should be saved. |
stopEditTable | The value which indicates whether editing mode for associated attribute table should be closed as well. |
cBack | A callback object to report errors and progress information. |
- Returns
- True on success and false otherwise.
- Examples
- MinimalDistance.cs.
◆ EditingShapes
bool Shapefile.EditingShapes |
|
get |
◆ InteractiveEditing
bool Shapefile.InteractiveEditing |
|
getset |
◆ Snappable
Gets or sets a value indicating whether interactive editing tools can snap to vertices of the shapefile.
- New API 4.9.3:
- Added in version 4.9.3
◆ Volatile
Gets or sets a value indicating whether shapefile can be redrawn without redrawing other layer on the map.
All volatile shapefiles will be placed in main screen buffer (along with drawing layers) rather than data layer buffer, so that their redraw can be forced with AxMap.Redraw2(tkRedrawType.RedrawSkipDataLayers). This can be recommended for in-memory shapefiles with constantly changing values to ensure rendering performance.
- New API 4.9.2:
- Added in version 4.9.2
- Examples
- TrackCars.cs.