Functions | Properties
Shapefile editing
Shapefile modules

Functions

int Shapefile.EditAddShape (Shape Shape)
 Adds a new shape to the shapefile.
bool Shapefile.EditClear ()
 Deletes all the shapes from the shapefile.
bool Shapefile.EditDeleteShape (int ShapeIndex)
 Deletes a shape from the shapefile.
bool Shapefile.EditInsertShape (Shape Shape, ref int ShapeIndex)
 Inserts a new shape in the shapefile.
bool Shapefile.EditUpdateShape (int ShapeIndex, Shape shpNew)
 Substitutes shape at specified index with another instance.
bool Shapefile.get_ShapeModified (int ShapeIndex)
 Gets a value indicating whether particular shape was modified after shapefile was opened.
void Shapefile.set_ShapeModified (int ShapeIndex, bool newVal)
 Sets a value indicating whether particular shape was modified after shapefile was opened.
bool Shapefile.StartEditingShapes (bool StartEditTable, ICallback cBack)
 Starts editing mode for the shapefile.
bool Shapefile.StopEditingShapes (bool ApplyChanges, bool StopEditTable, ICallback cBack)
 Stops editing modes for the shapefile and optionally saves the changes.

Properties

bool Shapefile.EditingShapes [get]
 Gets the value indicating whether editing operations are allowed for shapefile.
bool Shapefile.InteractiveEditing [get, set]
 Gets or sets a value indicating whether a shapefile can be edited with built-in interactive tools.
bool Shapefile.Snappable [get, set]
 Gets or sets a value indicating whether interactive editing tools can snap to vertices of the shapefile.
bool Shapefile.Volatile [get, set]
 Gets or sets a value indicating whether shapefile can be redrawn without redrawing other layer on the map.

Detailed Description

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.

dot_inline_dotgraph_28.png

Graph description


Function Documentation

int Shapefile.EditAddShape ( Shape  Shape)

Adds a new shape to the shapefile.

Parameters:
ShapeThe shape to be added.
Returns:
The index of the new shape or -1 on failure.
Examples:
IntersectionLength.cs, and Segmentation.cs.

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.
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:
ShapeIndexThe index of shape to delete.
Returns:
Returns true on success and false otherwise.
See also:
Shapefile.EditingShapes, Shapefile.EditingTable
Examples:
RemoveShape.cs.
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:
ShapeThe shape object to insert.
ShapeIndexThe 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.
bool Shapefile.EditUpdateShape ( int  ShapeIndex,
Shape  shpNew 
)

Substitutes shape at specified index with another instance.

The method doesn't affect attribute table values.

Parameters:
ShapeIndexIndex of shape to substitute.
shpNewNew shape to substitute an existing one with.
Returns:
True on success.
New API 4.9.3:
Added in version 4.9.3
bool Shapefile.get_ShapeModified ( int  ShapeIndex)

Gets a value indicating whether particular shape was modified after shapefile was opened.

Parameters:
ShapeIndexIndex 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
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:
ShapeIndexIndex of shape.
newValNew value of modified flag.
Returns:
New value of modified flag.
New API 4.9.3:
Added in version 4.9.3
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:
StartEditTableA value which indicate whether or not the editing mode will be opened for attribute table associated with the shapefile.
cBackA 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.
bool Shapefile.StopEditingShapes ( bool  ApplyChanges,
bool  StopEditTable,
ICallback  cBack 
)

Stops editing modes for the shapefile and optionally saves the changes.

Parameters:
ApplyChangesThe value which indicates whether changes made to the shapefile should be saved.
StopEditTableThe value which indicates whether editing mode for associated attribute table should be closed as well.
cBackA callback object to report errors and progress information.
Returns:
True on success and false otherwise.
Examples:
MinimalDistance.cs.

Properties

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

Shapefile.EditInsertShape, Shapefile.EditDeleteShape, Shapefile.EditClear are affected by this property.
Use Shapefile.StartEditingShapes and Shapefile.StopEditingShapes to control the editing mode.

Gets or sets a value indicating whether a shapefile can be edited with built-in interactive tools.

Setting the property to true will automatically call Shapefile.StartEditingShapes if shapefile hasn't been loaded in the memory already. Setting it false won't call Shapefile.StopEditingShapes, only interactive tools will be disabled. Interactive editing mode automatically sets Shapefile.Volatile property to true.

See also:
ShapeEditor, AxMap.CursorMode
New API 4.9.3:
Added in version 4.9.3
bool Shapefile.Snappable [get, set]

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
bool Shapefile.Volatile [get, set]

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
 All Classes Files Functions Enumerations Properties Events