Functions | Properties
Shapefile geoprocessing
Shapefile modules

Functions

Shapefile Shapefile.AggregateShapes (bool SelectedOnly, int FieldIndex)
 Creates a new shapefile by merging shapes with the same value of the specified attribute.
Shapefile 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.
Shapefile Shapefile.Clip (bool SelectedOnlySubject, Shapefile sfOverlay, bool SelectedOnlyOverlay)
 Clips current shapefile by the definition shapefile.
Shapefile Shapefile.Difference (bool SelectedOnlySubject, Shapefile sfOverlay, bool SelectedOnlyOverlay)
 Calculates difference of 2 shapefiles.
Shapefile Shapefile.Dissolve (int FieldIndex, bool SelectedOnly)
 Merges shapes of the input shapefile based on specified attribute.
Shapefile 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 Shapefile.ExportSelection ()
 Creates a new instance of the shapefile class and copies selected shapes of the input shapefile to it.
bool Shapefile.FixUpShapes (out Shapefile retval)
 Creates a new shapefile by fixing invalid shapes of the input shapefile.
Shapefile Shapefile.GetIntersection (bool SelectedOnlyOfThis, Shapefile sf, bool SelectedOnly, ShpfileType fileType, ICallback cBack)
 Calculates intersection of 2 input shapefiles.
Shapefile Shapefile.Merge (bool SelectedOnlyThis, Shapefile sf, bool SelectedOnly)
 Creates a new instance of shapefile class which holds shapes from 2 input shapefiles.
Shapefile Shapefile.Reproject (GeoProjection newProjection, ref int reprojectedCount)
 Creates a new shapefile by reprojecting the current one.
bool Shapefile.ReprojectInPlace (GeoProjection newProjection, ref int reprojectedCount)
 Reprojects shapes of the current shapefile.
bool Shapefile.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.
Shapefile Shapefile.SimplifyLines (double Tolerance, bool SelectedOnly)
 Creates a new shapefile by removing excessive vertices from the current shapefile.
Shapefile Shapefile.Sort (int FieldIndex, bool Ascending)
 Sorts shapes in the shapefile based on the specified attribute.
Shapefile Shapefile.SymmDifference (bool SelectedOnlySubject, Shapefile sfOverlay, bool SelectedOnlyOverlay)
 Calculates symmetrical difference of the 2 shapefiles.
Shapefile Shapefile.Union (bool SelectedOnlySubject, Shapefile sfOverlay, bool SelectedOnlyOverlay)
 Calculates union of 2 shapefiles.

Properties

tkGeometryEngine Shapefile.GeometryEngine [get, set]
 Gets or sets the engine (library) to use for geoprocessing operations.

Detailed Description

Here is a list of methods to perform geoprocessing tasks using shapefile data. This module is a part of the documentation of Shapefile class.

dot_inline_dotgraph_26.png

Graph description


Function Documentation

Shapefile Shapefile.AggregateShapes ( bool  SelectedOnly,
int  FieldIndex 
)

Creates a new shapefile by merging shapes with the same value of the specified attribute.

This operation commonly leads to the creation of multi-part shapes.

Parameters:
SelectedOnlyA boolean value which indicates whether all or only selected shapes will be processed.
FieldIndexThe index of field to group shapes by.
Returns:
Reference to the shapefile on success or NULL reference on failure.
New API 4.8:
Added in version 4.8
Shapefile 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.

Parameters:
DistanceThe distance to build buffer at.
nSegmentsNumber of segments to approximate a circular buffer.
SelectedOnlyA value which indicates whether all only selected shapes of the shapefile will be processed.
MergeResultsA value which indicates whether overlapping buffered shapes will be merged into a single shapes.
Returns:
A reference to the ouput shapefile or NULL reference on failure.
New API 4.8:
Added in version 4.8
Examples:
CreateBuffer.cs.
Shapefile Shapefile.Clip ( bool  SelectedOnlySubject,
Shapefile  sfOverlay,
bool  SelectedOnlyOverlay 
)

Clips current shapefile by the definition shapefile.

Parameters:
SelectedOnlySubjectA value which indicates whether all or only selected shape of this shapefile will be treated as input.
sfOverlayThe definintion shapefile.
SelectedOnlyOverlayA value which indicates whether all or only selected shape of the definition shapefile will be treated as input.
Returns:
Reference to the output shapefile or NULL reference on failure.
New API 4.8:
Added in version 4.8
Shapefile Shapefile.Difference ( bool  SelectedOnlySubject,
Shapefile  sfOverlay,
bool  SelectedOnlyOverlay 
)

Calculates difference of 2 shapefiles.

Parameters:
SelectedOnlySubjectA value which indicates whether all or only selected shape of this shapefile will be treated as input.
sfOverlayThe overlay shapefile.
SelectedOnlyOverlayA value which indicates whether all or only selected shape of the overlay shapefile will be treated as input.
Returns:
Reference to the output shapefile or NULL reference on failure.
New API 4.8:
Added in version 4.8
Examples:
CreateBuffer.cs.
Shapefile Shapefile.Dissolve ( int  FieldIndex,
bool  SelectedOnly 
)

Merges shapes of the input shapefile based on specified attribute.

All shapes with the same value of the attribute will be merged in a single shape. If the shapes aren't adjacent, then multipart shape will be created.

Parameters:
FieldIndexAn index of field from attribute table of the shapefile to dissolve by.
SelectedOnlyA boolean value which indicates whether all or only selected shapes will be processed.
Returns:
Reference to the output shapefile or NULL reference on failure.
New API 4.8:
Added in version 4.8
Shapefile 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.

Single-part input shapes are moved to the output shapefile without changes. Attribute values are copied to the output shapefile without changes.

Parameters:
SelectedOnlyA value which indicates whether the operation will be applied to the selected shapes only.
Returns:
A new instance of Shapefile class with resultant shapes or NULL reference on failure.
New API 4.8:
Added in version 4.8

Creates a new instance of the shapefile class and copies selected shapes of the input shapefile to it.

Returns:
A new instance of shapefile class with selected shapes or NULL reference on failure.
New API 4.8:
Added in version 4.8
bool Shapefile.FixUpShapes ( out Shapefile  retval)

Creates a new shapefile by fixing invalid shapes of the input shapefile.

Parameters:
retvalThe output shapefile.
Returns:
True on successful fixing of all shapes and false if at least one shapes wasn't fixed.
New API 4.8:
Added in version 4.8
Shapefile Shapefile.GetIntersection ( bool  SelectedOnlyOfThis,
Shapefile  sf,
bool  SelectedOnly,
ShpfileType  fileType,
ICallback  cBack 
)

Calculates intersection of 2 input shapefiles.

Intesection can generate shapes of different types. For example, the intersection of 2 polygons can be a polygon, a polyline, a point or any combination of those. With SHP_NULLSHAPE fileType paramater the most obvious type will be used: for example SHP_POLYGON for 2 polygon shapefiles.

Parameters:
SelectedOnlyOfThisA value which indicates whether operation will be applied to the selected shapes of the current shapefile only.
sfThe second shapefile to perfrom intersection.
SelectedOnlyA value which indicates whether operation will be applied to the selected shapes of the second shapefile only.
fileTypeThe type of output shapefiles. SHP_NULLSHAPE value should be passed for automatic choosing of type.
cBackAn instance of class implementing ICallback interface.
Returns:
Reference to the output shapefile or NULL reference on failure.
New API 4.8:
Added in version 4.8
Shapefile Shapefile.Merge ( bool  SelectedOnlyThis,
Shapefile  sf,
bool  SelectedOnly 
)

Creates a new instance of shapefile class which holds shapes from 2 input shapefiles.

Both shapefiles must have the same ShpfileType. No changes to geometry of individual shapes are made. Attribute values of both input shapefile will be passed to the resuting one.

Parameters:
SelectedOnlyThisThe value which indicates whether the operation will be applied only to the selected shapes of the first shapefile.
sfThe second shapefile to take shapes from.
SelectedOnlyA value which Indicates whether the operation will be applied only to the selected shapes of the second shapefile
Returns:
Reference to the output shapefile or NULL reference on failure
New API 4.8:
Added in version 4.8
Shapefile Shapefile.Reproject ( GeoProjection  newProjection,
ref int  reprojectedCount 
)

Creates a new shapefile by reprojecting the current one.

Parameters:
newProjectionThe projection of the output shapefile.
reprojectedCountThe output value with the number of shapes successfully reprojected.
Returns:
Reference to the output shapefile or NULL refererence on failure.
New API 4.8:
Added in version 4.8
bool Shapefile.ReprojectInPlace ( GeoProjection  newProjection,
ref int  reprojectedCount 
)

Reprojects shapes of the current shapefile.

Parameters:
newProjectionThe new projection.
reprojectedCountThe number of shapes successfully reprojected.
Returns:
Returns true on success and false otherwise.
New API 4.8:
Added in version 4.8
bool Shapefile.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.

Parameters:
sfThe definition shapefile.
RelationThe target relation between shapes of the 2 shapefiles.
SelectedOnlyThe value which indicates whether only selected shapes of the definition shapefile will be used.
ResultThe resulting array of long data type with shape indices.
cBackA callback object for passing to the client the information about the progress and errors.
Returns:
True in case at least one shape was selected and false otherwise.
New API 4.8:
Added in version 4.8
Shapefile Shapefile.SimplifyLines ( double  Tolerance,
bool  SelectedOnly 
)

Creates a new shapefile by removing excessive vertices from the current shapefile.

Applicable to the polyline or polygon shapefiles only. The initial shapefile remains intact. Attribute values are copied to the output shapefile without changes.

Parameters:
ToleranceThe minimal distance between 2 succeeding points. A succeeding point lying closer than this value, will be removed.
SelectedOnlyA value which indicates whether all or only selected shapes will be processed.
Returns:
A reference to the output shapefile or NULL reference on failure.
New API 4.8:
Added in version 4.8
Shapefile Shapefile.Sort ( int  FieldIndex,
bool  Ascending 
)

Sorts shapes in the shapefile based on the specified attribute.

Parameters:
FieldIndexThe index of field to set the sorting order.
AscendingA value which defines the sorting order.
Returns:
Reference to the output shapefileor NULL reference on failure.
New API 4.8:
Added in version 4.8
Shapefile Shapefile.SymmDifference ( bool  SelectedOnlySubject,
Shapefile  sfOverlay,
bool  SelectedOnlyOverlay 
)

Calculates symmetrical difference of the 2 shapefiles.

The operation consists of 2 mirror-like Difference operations. Attribute values of both shapefiles are passed to the output one without changes. Both input shapefiles remain intact.

Parameters:
SelectedOnlySubjectA value which indicates that only selected shapes of the first shapefile will be procecessed.
sfOverlayThe second shapefile.
SelectedOnlyOverlayA value which indicates that only selected shapes of the second shapefile will be procecessed.
Returns:
A reference to the output shapefile or NULL reference on failure.
New API 4.8:
Added in version 4.8
Shapefile Shapefile.Union ( bool  SelectedOnlySubject,
Shapefile  sfOverlay,
bool  SelectedOnlyOverlay 
)

Calculates union of 2 shapefiles.

The operation consists of intersection operation and 2 mirror-like difference operations.

Parameters:
SelectedOnlySubjectThe value which indicates that only selected shapes of the first shapefile will be processed.
sfOverlayThe second shapefile.
SelectedOnlyOverlayThe value which indicates that only selected shapes of the second shapefile will be processed.
Returns:
A reference to the output shapefile or NULL reference on failure.
New API 4.8:
Added in version 4.8

Properties

Gets or sets the engine (library) to use for geoprocessing operations.

The following methods are affected by this property.

New API 4.8:
Added in version 4.8
 All Classes Files Functions Enumerations Properties