Public Member Functions | Properties
Shapefile Class Reference

Provides a functionality for accessing and editing ESRI shapefiles. More...

List of all members.

Public Member Functions

Shapefile AggregateShapes (bool SelectedOnly, int FieldIndex)
 Creates a new shapefile by creating multi-part shapes from shapes with the same value of specified attribute.
Shapefile AggregateShapesWithStats (bool SelectedOnly, int FieldIndex=-1, FieldStatOperations statOperations=null)
 Creates a new shapefile by creating multi-part shapes from shapes with the same value of specified attribute.
bool BeginPointInShapefile ()
 Caches the coordinates of shapefile points for faster point in shape test.
Shapefile BufferByDistance (double Distance, int nSegments, bool SelectedOnly, bool MergeResults)
 Creates a new shapefile by building a buffer around the shapes of the input shapefile.
void ClearCachedGeometries ()
 Clears GEOS geometries cached during certain geoprocessing tasks.
Shapefile Clip (bool SelectedOnlySubject, Shapefile sfOverlay, bool SelectedOnlyOverlay)
 Clips current shapefile by the definition shapefile.
Shapefile Clone ()
 Creates a copy of the shapefile.
bool Close ()
 Closes shapefile and releases all the resources.
bool CreateNew (string ShapefileName, ShpfileType ShapefileType)
 Initializes in-memory shapefile of the specified type.
bool CreateNewWithShapeID (string ShapefileName, ShpfileType ShapefileType)
 Initializes in-memory shapefile of the specified type with unique index field.
bool CreateSpatialIndex (string ShapefileName)
 Creates a new spatial index.
void Deserialize (bool LoadSelection, string newVal)
 Restores the state of shapefile from the string.
Shapefile Difference (bool SelectedOnlySubject, Shapefile sfOverlay, bool SelectedOnlyOverlay)
 Calculates difference of 2 shapefiles.
Shapefile Dissolve (int FieldIndex, bool SelectedOnly)
 Merges shapes of the input shapefile based on specified attribute.
Shapefile DissolveWithStats (int FieldIndex, bool SelectedOnly, FieldStatOperations statOperations=null)
 Merges shapes of the input shapefile based on specified attribute.
bool Dump (string ShapefileName, ICallback cBack=null)
 Writes the contents of the shapefile to specified file.
int 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.
int EditAddShape (Shape Shape)
 Adds a new shape to the shapefile.
bool 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 EditClear ()
 Deletes all the shapes from the shapefile.
bool EditDeleteField (int FieldIndex, ICallback cBack)
 Deletes a field with the specified index from the attribute table. The table must be in editing mode.
bool EditDeleteShape (int ShapeIndex)
 Deletes a shape from the shapefile.
bool EditInsertField (Field NewField, ref int FieldIndex, ICallback cBack)
 Inserts a new field in the shapefile attribute table. The table must be in editing mode.
bool EditInsertShape (Shape Shape, ref int ShapeIndex)
 Inserts a new shape in the shapefile.
bool EditUpdateShape (int ShapeIndex, Shape shpNew)
 Substitutes shape at specified index with another instance.
void EndPointInShapefile ()
 Clears the cached data allocated by Shapefile.BeginPointInShapefile.
Shapefile ExplodeShapes (bool SelectedOnly)
 Creates a new instance of shapefile class with single-part shapes produced from the multi-part shapes of the input shapefile.
Shapefile ExportSelection ()
 Creates a new instance of the shapefile class and copies selected shapes of the input shapefile to it.
bool FixUpShapes (out Shapefile retval)
 Creates a new shapefile by fixing invalid shapes of the input shapefile.
bool FixUpShapes2 (bool SelectedOnly, out Shapefile result)
 Fixes invalid shapes in the shapefile.
int GenerateLabels (int FieldIndex, tkLabelPositioning Method, bool LargestPartOnly)
 Generates labels for the shapefile based on values of the specified attribute.
bool get_CanUseSpatialIndex (Extents pArea)
 Gets the value which indicates whether spatial index will be used for displaying certain extents of the shapefile.
object get_CellValue (int FieldIndex, int ShapeIndex)
 Gets the value of the specified field for the shape.
string get_ErrorMsg (int ErrorCode)
 Gets the description of the specific error code.
Field get_Field (int FieldIndex)
 Gets a specific field stored in the attribute table.
Field get_FieldByName (string Fieldname)
 Gets specific field stored in the attribute table.
int get_FieldIndexByName (string FieldName)
 Gets index of field with specified name.
int get_numPoints (int ShapeIndex)
 Returns the number of points in the specified shape of the shapefile.
Shape get_Shape (int ShapeIndex)
 Gets the reference to the specified shape.
int get_ShapeCategory (int ShapeIndex)
 Gets the index of the visualization category which is used for the drawing of the specified shape.
string get_ShapeCategory2 (int ShapeIndex)
 Get the name of the ShapefileCategory for the shape with specified index.
ShapefileCategory get_ShapeCategory3 (int ShapeIndex)
 Gets the shapefile category for the shape with specified index.
bool get_ShapeIsHidden (int ShapeIndex)
 Gets a value indicating whether a shape is hidden.
bool get_ShapeModified (int ShapeIndex)
 Gets a value indicating whether particular shape was modified after shapefile was opened.
bool get_ShapeRendered (int ShapeIndex)
 Gets a value indicating whether particular shape is currently displayed on the screen.
double get_ShapeRotation (int ShapeIndex)
 Gets rotation angle for a shape.
bool get_ShapeSelected (int ShapeIndex)
 Gets the state of selection for the specified shape.
bool get_ShapeVisible (int ShapeIndex)
 Gets visibility of shape.
bool GetClosestVertex (double x, double y, double maxDistance, out int ShapeIndex, out int PointIndex, out double Distance)
 Gets the vertex closest to the specified point.
Shapefile GetIntersection (bool SelectedOnlyOfThis, Shapefile sf, bool SelectedOnly, ShpfileType fileType, ICallback cBack)
 Calculates intersection of 2 input shapefiles.
bool GetRelatedShapes (int referenceIndex, tkSpatialRelation Relation, ref object resultArray)
 Gets shapes which are located at specified spatial relation to reference shape.
bool GetRelatedShapes2 (Shape referenceShape, tkSpatialRelation Relation, ref object resultArray)
 Gets shapes which are located at specified spatial relation to reference shape.
bool HasInvalidShapes ()
 Checks whether there are invalid shapes within shapefile.
void InvertSelection ()
 Inverts selection of the shapefile, i.e. selection state of every shape is changed to the opposite value.
bool IsSpatialIndexValid ()
 Checks the validity of the spatial index.
bool LoadDataFrom (string ShapefileName, ICallback cBack=null)
 Loads data into in-memory shapefile from the specified shapefile on the disk.
Shapefile Merge (bool SelectedOnlyThis, Shapefile sf, bool SelectedOnly)
 Creates a new instance of shapefile class which holds shapes from 2 input shapefiles.
bool Move (double xOffset, double yOffset)
 Moves shapefile at specified offset.
bool Open (string ShapefileName, ICallback cBack)
 Opens shapefile from the disk.
bool PointInShape (int ShapeIndex, double x, double y)
 Returns boolean value which indicates whether the given point is located within the specified shape.
int PointInShapefile (double x, double y)
 Returns a number which indicates the index of shapes within which a test point is situated.
Extents QuickExtents (int ShapeIndex)
 Returns the extents of the shape with the given index.
Point QuickPoint (int ShapeIndex, int PointIndex)
 Returns the specified point of shape.
System.Array QuickPoints (int ShapeIndex, ref int numPoints)
 Returns an array with the coordinates of points of the specified shape.
bool RefreshExtents ()
 Refreshes extents of all shapes in the shapefile.
bool RefreshShapeExtents (int ShapeId)
 Refreshes the extents of the particular shape in the shapefile.
bool RemoveSpatialIndex ()
 Removes spatial index associated with shapefile (.mwd and .mwx files).
Shapefile Reproject (GeoProjection newProjection, ref int reprojectedCount)
 Creates a new shapefile by re-projecting the current one.
bool ReprojectInPlace (GeoProjection newProjection, ref int reprojectedCount)
 Reprojects shapes of the current shapefile.
bool Resource (string newShpPath)
 Changes file associated with the current instance of the shapefile class.
bool Save (ICallback cBack)
 Saves edits of the in-memory shapefile to the disk without closing editing mode.
bool SaveAs (string ShapefileName, ICallback cBack)
 Saves in-memory shapefile to the disk.
bool SaveAsEx (string newFilename, bool stopEditing, bool unboundFile)
 Saves shapefile to the disk.
Shapefile Segmentize ()
 Splits polylines at intersection with any other polylines. Works for polyline shapefile only.
void SelectAll ()
 Selects all the shapes in the shapefile.
bool SelectByShapefile (Shapefile sf, tkSpatialRelation Relation, bool SelectedOnly, ref object Result, ICallback cBack)
 aka SpatialQuery. Returns an array with indices of shapes of the current shapefile which are in the specified relation to the definition shapefile.
void SelectNone ()
 Clears selection from all shapes.
bool SelectShapes (Extents BoundBox, double Tolerance, SelectMode SelectMode, ref object Result)
 Returns an array with indices of shapes which are located inside specified bounds.
string Serialize (bool SaveSelection)
 Saves the state of the shapefile in XML string.
string Serialize2 (bool SaveSelection, bool SerializeCategories)
 Serializes the state shapefile object, but not the data itself.
void set_ShapeCategory (int ShapeIndex, int pVal)
 Sets the index of the visualization category to use for the drawing of the specified shape.
void set_ShapeCategory2 (int ShapeIndex, string categoryName)
 Sets the shapefile category for the shape.
void set_ShapeCategory3 (int ShapeIndex, ShapefileCategory Category)
 Sets the shapefile category for the shape.
void set_ShapeIsHidden (int ShapeIndex, bool pVal)
 When set to true prevents shape from being displayed.
void set_ShapeModified (int ShapeIndex, bool newVal)
 Sets a value indicating whether particular shape was modified after shapefile was opened.
void set_ShapeRotation (int ShapeIndex, double pVal)
 Sets rotation angle for a shape.
void set_ShapeSelected (int ShapeIndex, bool pVal)
 Selects or deselects the specified shape.
Shapefile SimplifyLines (double Tolerance, bool SelectedOnly)
 Creates a new shapefile by removing excessive vertices from the current shapefile.
Shapefile Sort (int FieldIndex, bool Ascending)
 Sorts shapes in the shapefile based on the specified attribute.
bool StartAppendMode ()
 Starts append mode for the shapefile.
bool StartEditingShapes (bool StartEditTable, ICallback cBack)
 Starts editing mode for the shapefile.
bool StartEditingTable (ICallback cBack)
 Opens editing mode for the attribute table.
void StopAppendMode ()
 Stops append mode for the shapefile.
bool StopEditingShapes (bool ApplyChanges, bool StopEditTable, ICallback cBack)
 Stops editing modes for the shapefile and optionally saves the changes.
bool StopEditingTable (bool ApplyChanges, ICallback cBack)
 Closes the editing mode for the attribute table.
Shapefile SymmDifference (bool SelectedOnlySubject, Shapefile sfOverlay, bool SelectedOnlyOverlay)
 Calculates symmetrical difference of the 2 shapefiles.
Shapefile Union (bool SelectedOnlySubject, Shapefile sfOverlay, bool SelectedOnlyOverlay)
 Calculates union of 2 shapefiles.
void UpdateSortField ()
 The sorting of the shapefile will be reapplied before next redraw after calling this method.

Properties

bool AppendMode [get, set]
 Gets a value indicating whether shapefile is in append mode. Any shapes added with Shapefile.EditAddShape will be immediately written to the disk.
bool CacheExtents [get, set]
 Gets or sets a boolean value which indicates whether extents of shape will be recalculated before each redraw.
ShapefileCategories Categories [get, set]
 Gets or sets an instance of ShapefileCategories class associated with the shapefile.
string CdlgFilter [get]
 Gets expression to be set for OpenFileDialog.Filter property to select ESRI shapefiles.
Charts Charts [get, set]
 Gets or sets an instance of Charts class associated with the shapefile.
tkCollisionMode CollisionMode [get, set]
 Gets or sets collision mode for point symbols for point and multi-point shapefiles.
ShapeDrawingOptions DefaultDrawingOptions [get, set]
 Gets or sets an instance of ShapeDrawingOptions class which holds default drawing options.
bool EditingShapes [get]
 Gets the value indicating whether editing operations are allowed for shapefile.
bool EditingTable [get]
 Gets the value indicating whether editing operations are allowed for shapefile attribute table.
Extents Extents [get]
 Gets bounding box which encompass all the shapes in the shapefile.
bool FastMode [get, set]
 Gets or sets the value which indicates whether fast mode will be used for the shapefile.
int FileHandle [get]
 Returns the handle of the shapefile. For inner use only.
string Filename [get]
 Gets the name of the file which is used as a source for this instance of Shapefile class.
tkGeometryEngine GeometryEngine [get, set]
 Gets or sets the engine (library) to use for geoprocessing operations.
GeoProjection GeoProjection [get, set]
 Get or sets an instance of GeoProjection class associated with the shapefile.
ICallback GlobalCallback [get, set]
 Gets or sets a Callback object which handles progress and error messages of the Shapefile class.
bool HasSpatialIndex [get, set]
 Gets the value indicating whether spatial index exists for the shapefile.
bool Identifiable [get, set]
 Gets or sets a value indicating whether this shapefile will be visible to cmIdentify tool.
bool InteractiveEditing [get, set]
 Gets or sets a value indicating whether a shapefile can be edited with built-in interactive tools.
string Key [get, set]
 A text string associated with the shapefile. Any value can be stored by developer in this property.
Labels Labels [get, set]
 Gets or sets the instance of the Labels class associated with the shapefile.
int LastErrorCode [get]
 Gets the code of last error which took place inside this object.
ShapeValidationInfo LastInputValidation [get]
 Gets results of input data validation for geoprocessing methods.
ShapeValidationInfo LastOutputValidation [get]
 Gets results of output data validation for geoprocessing methods.
int MinDrawingSize [get, set]
 Gets or sets the value which affects the drawing of small shapes on the screen.
int NumFields [get]
 Gets the number of fields in attribute table of the shapefile.
int NumSelected [get]
 Gets the number of selected shapes in the shapefile.
int NumShapes [get]
 Gets the number of shapes in the shapefile.
string Projection [get, set]
 Gets or sets the projection string for shapefile. String in proj4 and ESRI WKT formats are supported.
tkSelectionAppearance SelectionAppearance [get, set]
 Gets or sets the way shapefile selection will be displayed.
uint SelectionColor [get, set]
 The colour of the selected shapes.
ShapeDrawingOptions SelectionDrawingOptions [get, set]
 The drawing options used for visualization of the selected shapes.
byte SelectionTransparency [get, set]
 Gets or sets the value which defines the transparency of the selection. Values from 0 (transparent) to 255(opaque) are applicable.
ShpfileType ShapefileType [get]
 Gets the type of the shapefile.
ShpfileType ShapefileType2D [get]
 Gets "flattened" shapefile type, i.e. Z and M components will be ignored.
bool Snappable [get, set]
 Gets or sets a value indicating whether interactive editing tools can snap to vertices of the shapefile.
bool SortAscending [get, set]
 Gets or sets a value indicating whether shapes will be sorted in ascending order.
string SortField [get, set]
 The name of the field to be used to determine the drawing order of point shapes and labels.
tkShapefileSourceType SourceType [get]
 Gets the value which indicate the type the data used by shapefile object.
double SpatialIndexMaxAreaPercent [get, set]
 Gets or sets the value which affects the usage of spatial index.
IStopExecution StopExecution [set]
 Sets an object which implements IStopExecution interface and facilitates stopping of the geoprocessing operations.
Table Table [get]
 Gets the reference to the attribute table associated with the shapefile.
bool UseQTree [get, set]
 Gets or sets a value which indicates whether built-in quad-tree spatial index should be used for shapefile.
bool UseSpatialIndex [get, set]
 Gets or sets a value which indicates whether spatial index should be used while working with shapefile.
string VisibilityExpression [get, set]
 Gets or sets the expression which defines shapes to be visible on the map.
bool Volatile [get, set]
 Gets or sets a value indicating whether shapefile can be redrawn without redrawing other layer on the map.

Detailed Description

Provides a functionality for accessing and editing ESRI shapefiles.

A class which encapsulates all the operation with ESRI shapefiles, for both file-based and in-memory mode. Facilitates creation, editing, querying and geoprocessing of shapefiles. Shapefile holds geometry of objects (.shp and .shx part) and their attribute values (.dbf part)

Here is a diagram for the Shapefile class.

dot_inline_dotgraph_61.png

Graph description

Here are groups of API members for Shapefile class:

dot_shapefilegroups.png
Graph description

Examples:
AddCategoryRange.cs, AddLayers.cs, CalculateArea.cs, CreateBuffer.cs, CreatePointShapefile.cs, CreatePolygonShapefile.cs, EditAttributes.cs, GenerateLabelsManually.cs, IntersectionLength.cs, LabelSelection.cs, LinePattern.cs, MarkPoints.cs, MinimalDistance.cs, PointIcons.cs, PolygonsWithHoles.cs, RemoveShape.cs, Segmentation.cs, SelectBox.cs, SelectByDistance.cs, SelectByQuery.cs, ShapefileToDrawingLayer.cs, ShowAttributes.cs, SortLayers.cs, SplitByAttribute.cs, ToolTip.cs, TrackCars.cs, Tracking.cs, and ZoomToValues.cs.

Member Function Documentation

void Shapefile.Deserialize ( bool  LoadSelection,
string  newVal 
)

Restores the state of shapefile from the string.

Parameters:
LoadSelectionThe value which indicates whether selection state of individual shapes should be restored.
newValA string with state information generated by Shapefile.Serialize method.
New API 4.8:
Added in version 4.8
bool Shapefile.FixUpShapes2 ( bool  SelectedOnly,
out Shapefile  result 
)

Fixes invalid shapes in the shapefile.

Parameters:
SelectedOnlyOnly selected shapes will be fixed.
resultThe resulting shapefile.
Returns:
True if the operations was successful.
New API 4.9.4:
Added in version 4.9.4
int Shapefile.GenerateLabels ( int  FieldIndex,
tkLabelPositioning  Method,
bool  LargestPartOnly 
)

Generates labels for the shapefile based on values of the specified attribute.

Parameters:
FieldIndexThe index of field in the attribute table to take the values from.
MethodThe method for calculation of label positions.
LargestPartOnlyA value which indicates whether all the parts of a multi-part shape should be supplied with individual labels or only the largest (longest) one.
Returns:
The number of labels generated. Normally it is equal to the number of shapes. Labels of the multi-part shape are treated like a single label.
New API 4.8:
Added in version 4.8
string Shapefile.get_ErrorMsg ( int  ErrorCode)

Gets the description of the specific error code.

Parameters:
ErrorCodeThe error code returned by Shapefile.LastErrorCode.
Returns:
The string with the description.
Shape Shapefile.get_Shape ( int  ShapeIndex)

Gets the reference to the specified shape.

In the disk-based mode (Shapefile.SourceType = sstDiskBased) a new instance of the Shape class will be created on each call of this property which is time consuming. Try to avoid calling this property in large cycles or open editing mode prior such cycles. In editing mode shape objects stored in memory, so there is no overhead in passing the reference.

Parameters:
ShapeIndexThe index of shape to retrieve.
Returns:
The reference to the shape or NULL reference on invalid index.
int Shapefile.get_ShapeCategory ( int  ShapeIndex)

Gets the index of the visualization category which is used for the drawing of the specified shape.

Parameters:
ShapeIndexThe index of the shape.
Returns:
The index of the category. -1 will be returned in case no category is set to the shape or invalid shape index was passed.
See also:
Shapefile.Categories
New API 4.8:
Added in version 4.8
string Shapefile.get_ShapeCategory2 ( int  ShapeIndex)

Get the name of the ShapefileCategory for the shape with specified index.

Parameters:
ShapeIndexIndex of shape.
Returns:
The name of the category.
New API 4.9.1:
Added in version 4.9.1

Gets the shapefile category for the shape with specified index.

Parameters:
ShapeIndexIndex of shape.
Returns:
Shapefile category, or null if no category for the shape was set.
New API 4.9.1:
Added in version 4.9.1
bool Shapefile.get_ShapeIsHidden ( int  ShapeIndex)

Gets a value indicating whether a shape is hidden.

Even when this property is set to false, the shape may still be invisible because of other settings. Use Shapefile.get_ShapeVisible to check if it will actually be displayed on the screen when corresponding portion of map is rendered.

Parameters:
ShapeIndexIndex of shape.
Returns:
True in case shape is hidden.
New API 4.9.3:
Added in version 4.9.3
bool Shapefile.get_ShapeRendered ( int  ShapeIndex)

Gets a value indicating whether particular shape is currently displayed on the screen.

Parameters:
ShapeIndex
Returns:

This property is set during the core rendering process, therefore it accounts for all possible ways for a certain shape to be hidden, like collision avoidance for point symbols or dynamic visibility for categories.

New API 4.9.3:
Added in version 4.9.3
double Shapefile.get_ShapeRotation ( int  ShapeIndex)

Gets rotation angle for a shape.

Parameters:
ShapeIndexIndex of shape.
Returns:
Angle in degrees (0-360).

This value will be applied for icons of point shapefiles only (ShapeDrawingOptions.PointType = ptSymbolPicture). Values other then 0.0 will override ShapeDrawingOptions.PointRotation property for shapefile and categories.

New API 4.9.2:
Added in version 4.9.2
bool Shapefile.get_ShapeVisible ( int  ShapeIndex)

Gets visibility of shape.

Parameters:
ShapeIndexIndex of shape.
Returns:
True if shape is visible.

The property takes into account Shapefile.VisibilityExpression, Shapefile.get_ShapeIsHidden, ShapeDrawingOptions.Visible

New API 4.9.2:
Added in version 4.9.2
bool Shapefile.Move ( double  xOffset,
double  yOffset 
)

Moves shapefile at specified offset.

Shapefile must be in editing mode in order for this method to succeed.

Parameters:
xOffsetX component of offset.
yOffsetY component of offset.
Returns:
True on success.
New API 4.9.3:
Added in version 4.9.3
string Shapefile.Serialize ( bool  SaveSelection)

Saves the state of the shapefile in XML string.

Serialization covers shapefile properties and all child classes (drawing options, labels, charts, categories). Geometry of shapes and values of attribute table will not be serialized.

Parameters:
SaveSelectionThe value which indicates whether selection state of individual shapes should be saved.
Returns:
A string with serialized state or empty string on failure. Use Shapefile.ErrorMsg(Shapefile.LastErrorCode) to find out the reason of failure.
New API 4.8:
Added in version 4.8
string Shapefile.Serialize2 ( bool  SaveSelection,
bool  SerializeCategories 
)

Serializes the state shapefile object, but not the data itself.

Parameters:
SaveSelectionTrue is selection on per-shape basis should be serialized.
SerializeCategoriesTrue if categories should be serialize on per-shape basis. The option should be used when categories were applied manually with Shapefile.put_ShapeCategory.
Returns:
XML string with serialized state.
See also:
Shapefile.Serialize
New API 4.9.3:
Added in version 4.9.3
void Shapefile.set_ShapeCategory ( int  ShapeIndex,
int  pVal 
)

Sets the index of the visualization category to use for the drawing of the specified shape.

Parameters:
ShapeIndexThe index of the shape.
pValThe index of the visualization category.
See also:
Shapefile.Categories
New API 4.8:
Added in version 4.8
void Shapefile.set_ShapeCategory2 ( int  ShapeIndex,
string  categoryName 
)

Sets the shapefile category for the shape.

Parameters:
ShapeIndexIndex of shape.
categoryNameName of the category. Category must be created first. Name comparison is case-sensitive.
New API 4.9.1:
Added in version 4.9.1
void Shapefile.set_ShapeCategory3 ( int  ShapeIndex,
ShapefileCategory  Category 
)

Sets the shapefile category for the shape.

Parameters:
ShapeIndexIndex of shape.
CategoryShapefile category to set. The category must be added to shapefile beforehand.
New API 4.9.1:
Added in version 4.9.1
void Shapefile.set_ShapeIsHidden ( int  ShapeIndex,
bool  pVal 
)

When set to true prevents shape from being displayed.

This property is used internally by interactive editing tools.

Parameters:
ShapeIndexIndex of shape.
pValValue indicating whether the shape is hidden.
New API 4.9.3:
Added in version 4.9.3
void Shapefile.set_ShapeRotation ( int  ShapeIndex,
double  pVal 
)

Sets rotation angle for a shape.

Parameters:
ShapeIndexIndex of shape.
pValAngle in degrees (0-360).

This value will be applied for icons of point shapefiles only (ShapeDrawingOptions.PointType = ptSymbolPicture). Values other then 0.0 will override ShapeDrawingOptions.PointRotation property for shapefile and categories.

New API 4.9.2:
Added in version 4.9.2

Starts append mode for the shapefile.

Returns:
True on success
New API 4.9.4:
Added in version 4.9.4

Stops append mode for the shapefile.

New API 4.9.4:
Added in version 4.9.4

The sorting of the shapefile will be reapplied before next redraw after calling this method.

New API 4.9.4:
Added in version 4.9.4

Property Documentation

bool Shapefile.AppendMode [get, set]

Gets a value indicating whether shapefile is in append mode. Any shapes added with Shapefile.EditAddShape will be immediately written to the disk.

New API 4.9.4:
Added in version 4.9.4

Gets or sets an instance of ShapefileCategories class associated with the shapefile.

The property can't be set to NULL (there is always an instance ShapefileCategories class associated with the Shapefile).

New API 4.8:
Added in version 4.8
Examples:
AddCategoryRange.cs, CreateBuffer.cs, MinimalDistance.cs, PointIcons.cs, and SplitByAttribute.cs.
string Shapefile.CdlgFilter [get]

Gets expression to be set for OpenFileDialog.Filter property to select ESRI shapefiles.

Gets or sets an instance of Charts class associated with the shapefile.

The property can't be set to NULL (there is always an instance of Charts class associated with shapefile).

New API 4.8:
Added in version 4.8
Examples:
IntersectionLength.cs, and Segmentation.cs.

Gets or sets collision mode for point symbols for point and multi-point shapefiles.

See tkCollisionMode enumeration.

New API 4.8:
Added in version 4.8

Gets or sets an instance of ShapeDrawingOptions class which holds default drawing options.

Default options are applied to every shape, which doesn't belong to a shapefile category. The property can't be set to NULL (there is always an instance ShapeDrawingOptions class associated with shapefile).

New API 4.8:
Added in version 4.8
Examples:
AddCategoryRange.cs, CreateBuffer.cs, IntersectionLength.cs, MinimalDistance.cs, PointIcons.cs, Segmentation.cs, ShapefileToDrawingLayer.cs, SplitByAttribute.cs, and Tracking.cs.

Gets bounding box which encompass all the shapes in the shapefile.

When fast mode is set on, Shapefile.RefreshExtents call is needed to get the correct extents after edits where made.

Examples:
EditAttributes.cs, and ShapefileToDrawingLayer.cs.

Returns the handle of the shapefile. For inner use only.

string Shapefile.Filename [get]

Gets the name of the file which is used as a source for this instance of Shapefile class.

The property should be used for disk-based shapefiles only (see Shapefile.SourceType property).

Get or sets an instance of GeoProjection class associated with the shapefile.

The property can't be set to NULL (there is always an instance of GeoProjection class associated with the shapefile).

New API 4.8:
Added in version 4.8
Examples:
Segmentation.cs, and ShapefileToDrawingLayer.cs.

Gets or sets a Callback object which handles progress and error messages of the Shapefile class.

It's recommended to set it in case time consuming operation will be used (geoprocessing, generation of labels, etc). The property is equal to NULL by default.

Deprecated:
v4.9.3 Use GlobalSettings.ApplicationCallback instead.
Examples:
CreateBuffer.cs.
bool Shapefile.Identifiable [get, set]

Gets or sets a value indicating whether this shapefile will be visible to cmIdentify tool.

See also:
AxMap.CursorMode
New API 4.9.3:
Added in version 4.9.3
string Shapefile.Key [get, set]

A text string associated with the shapefile. Any value can be stored by developer in this property.

Gets or sets the instance of the Labels class associated with the shapefile.

The property can't be set to NULL (there is always an instance Labels class associated with shapefile).

New API 4.8:
Added in version 4.8
Examples:
EditAttributes.cs, LabelSelection.cs, MinimalDistance.cs, RemoveShape.cs, SelectBox.cs, SelectByQuery.cs, ToolTip.cs, TrackCars.cs, Tracking.cs, and ZoomToValues.cs.

Gets the code of last error which took place inside this object.

To retrieve text description of error, use Shapefile.get_ErrorMsg(Shapefile.LastErrorCode). Check this value if a certain method has failed.

Examples:
AddLayers.cs, CalculateArea.cs, MarkPoints.cs, PointIcons.cs, RemoveShape.cs, SelectBox.cs, and ToolTip.cs.
string Shapefile.Projection [get, set]

Gets or sets the projection string for shapefile. String in proj4 and ESRI WKT formats are supported.

Deprecated:
v 4.8 Use Shapefile.GeoProjection property instead.

Gets the type of the shapefile.

It is not possible to change the type of the shapefile without closing it.

Examples:
ShapefileToDrawingLayer.cs, and SortLayers.cs.

Gets "flattened" shapefile type, i.e. Z and M components will be ignored.

New API 4.9.3:
Added in version 4.9.3
bool Shapefile.SortAscending [get, set]

Gets or sets a value indicating whether shapes will be sorted in ascending order.

See also:
SortField
New API 4.9.4:
Added in version 4.9.4
string Shapefile.SortField [get, set]

The name of the field to be used to determine the drawing order of point shapes and labels.

New API 4.9.4:
Added in version 4.9.4

Gets the value which indicate the type the data used by shapefile object.

See details in the description of tkShapefileSourceType enumeration.

New API 4.8:
Added in version 4.8
IStopExecution Shapefile.StopExecution [set]

Sets an object which implements IStopExecution interface and facilitates stopping of the geoprocessing operations.

New API 4.8:
Added in version 4.8
string Shapefile.VisibilityExpression [get, set]

Gets or sets the expression which defines shapes to be visible on the map.

In case of empty or invalid string all the shapes will be visible.

New API 4.8:
Added in version 4.8
Examples:
MinimalDistance.cs.
 All Classes Files Functions Enumerations Properties Events