Functions | |
Shapefile | Shapefile.AggregateShapes (bool selectedOnly, int fieldIndex) |
Creates a new shapefile by creating multi-part shapes from shapes with the same value of specified attribute. More... | |
Shapefile | 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. More... | |
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. More... | |
void | Shapefile.ClearCachedGeometries () |
Clears GEOS geometries cached during certain geoprocessing tasks. More... | |
Shapefile | Shapefile.Clip (bool selectedOnlySubject, Shapefile sfOverlay, bool selectedOnlyOverlay) |
Clips current shapefile by the definition shapefile. More... | |
Shapefile | Shapefile.Difference (bool selectedOnlySubject, Shapefile sfOverlay, bool selectedOnlyOverlay) |
Calculates difference of 2 shapefiles. More... | |
Shapefile | Shapefile.Dissolve (int fieldIndex, bool selectedOnly) |
Merges shapes of the input shapefile based on specified attribute. More... | |
Shapefile | Shapefile.DissolveWithStats (int fieldIndex, bool selectedOnly, FieldStatOperations statOperations=null) |
Merges shapes of the input shapefile based on specified attribute. More... | |
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. More... | |
Shapefile | Shapefile.ExportSelection () |
Creates a new instance of the shapefile class and copies selected shapes of the input shapefile to it. More... | |
bool | Shapefile.FixUpShapes (out Shapefile retval) |
Creates a new shapefile by fixing invalid shapes of the input shapefile. More... | |
bool | Shapefile.GetClosestSnapPosition (double x, double y, double maxDistance, int shapeIndex, ref double foundX, ref double foundY, ref double foundDistance) |
Calculates the closest snap point (taking the snap mode in account) on (the boundary of) a shape. More... | |
Shapefile | Shapefile.GetIntersection (bool selectedOnlyOfThis, Shapefile sf, bool selectedOnly, ShpfileType fileType, ICallback cBack) |
Calculates intersection of 2 input shapefiles. More... | |
Shapefile | Shapefile.Merge (bool selectedOnlyThis, Shapefile sf, bool selectedOnly) |
Creates a new instance of shapefile class which holds shapes from 2 input shapefiles. More... | |
Shapefile | Shapefile.Reproject (GeoProjection newProjection, ref int reprojectedCount) |
Creates a new shapefile by re-projecting the current one. More... | |
bool | Shapefile.ReprojectInPlace (GeoProjection newProjection, ref int reprojectedCount) |
Reprojects shapes of the current shapefile. More... | |
Shapefile | Shapefile.Segmentize (double metersTolerance=0.0) |
Splits polylines at intersection with any other polylines. Works for polyline shapefile only. More... | |
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. More... | |
Shapefile | Shapefile.SimplifyLines (double tolerance, bool selectedOnly) |
Creates a new shapefile by removing excessive vertices from the current shapefile More... | |
Shapefile | Shapefile.Sort (int fieldIndex, bool @ascending) |
Sorts shapes in the shapefile based on the specified attribute. More... | |
Shapefile | Shapefile.SymmDifference (bool selectedOnlySubject, Shapefile sfOverlay, bool selectedOnlyOverlay) |
Calculates symmetrical difference of the 2 shapefiles. More... | |
Shapefile | Shapefile.Union (bool selectedOnlySubject, Shapefile sfOverlay, bool selectedOnlyOverlay) |
Calculates union of 2 shapefiles. More... | |
Properties | |
tkGeometryEngine | Shapefile.GeometryEngine [get, set] |
Gets or sets the engine (library) to use for geoprocessing operations. More... | |
Here is a list of methods to perform geoprocessing tasks using shapefile data. This module is a part of the documentation of Shapefile class.
Use GlobalSettings.MinAreaToPerimeterRatio and GlobalSettings.MinPolygonArea to tweak which polygon needs to be included in the output file.
Shapefile Shapefile.AggregateShapes | ( | bool | selectedOnly, |
int | fieldIndex | ||
) |
Creates a new shapefile by creating multi-part shapes from shapes with the same value of specified attribute.
selectedOnly | A boolean value which indicates whether all or only selected shapes will be processed. |
fieldIndex | The index of field to group shapes by. |
Shapefile 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.
See sample code in description of Shapefile.DissolveWithStats.
selectedOnly | A value which indicates whether all or only selected shapes will be processed. |
fieldIndex | The index of field to group shapes by. |
statOperations | Statistic group operations to be calculated for fields of input shapefile and written to attribute table of output shapefile. |
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.
distance | The distance to build buffer at. |
nSegments | Number of segments to approximate a circular buffer. |
selectedOnly | A value which indicates whether all only selected shapes of the shapefile will be processed. |
mergeResults | A value which indicates whether overlapping buffered shapes will be merged into a single shapes. |
void Shapefile.ClearCachedGeometries | ( | ) |
Clears GEOS geometries cached during certain geoprocessing tasks.
Shapefile.GetRelatedShapes currently is the only method that uses such caching to improve performance if search is performed multiple times for different shapes.
Shapefile Shapefile.Clip | ( | bool | selectedOnlySubject, |
Shapefile | sfOverlay, | ||
bool | selectedOnlyOverlay | ||
) |
Clips current shapefile by the definition shapefile.
selectedOnlySubject | A value which indicates whether all or only selected shape of this shapefile will be treated as input. |
sfOverlay | The definition shapefile. |
selectedOnlyOverlay | A value which indicates whether all or only selected shape of the definition shapefile will be treated as input. |
Shapefile Shapefile.Difference | ( | bool | selectedOnlySubject, |
Shapefile | sfOverlay, | ||
bool | selectedOnlyOverlay | ||
) |
Calculates difference of 2 shapefiles.
selectedOnlySubject | A value which indicates whether all or only selected shape of this shapefile will be treated as input. |
sfOverlay | The overlay shapefile. |
selectedOnlyOverlay | A value which indicates whether all or only selected shape of the overlay shapefile will be treated as input. |
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 multi-part shape will be created.
fieldIndex | An index of field from attribute table of the shapefile to dissolve by. |
selectedOnly | A boolean value which indicates whether all or only selected shapes will be processed. |
Shapefile Shapefile.DissolveWithStats | ( | int | fieldIndex, |
bool | selectedOnly, | ||
FieldStatOperations | statOperations = null |
||
) |
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 multi-part shape will be created.
fieldIndex | An index of field from attribute table of the shapefile to dissolve by. |
selectedOnly | A boolean value which indicates whether all or only selected shapes will be processed. |
statOperations | Statistic group operations to be calculated for fields of input shapefile and written to attribute table of output shapefile. |
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.
selectedOnly | A value which indicates whether the operation will be applied to the selected shapes only. |
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.
retval | The output shapefile. |
bool Shapefile.GetClosestSnapPosition | ( | double | x, |
double | y, | ||
double | maxDistance, | ||
int | shapeIndex, | ||
ref double | foundX, | ||
ref double | foundY, | ||
ref double | foundDistance | ||
) |
Calculates the closest snap point (taking the snap mode in account) on (the boundary of) a shape.
x | input x coordinate |
y | input y coordinate |
maxDistance | maximum distance beyond which no more snapping is performed |
shapeIndex | the shape index to get a snap point for |
foundX | the X coordinate of the snap point |
foundY | the Y coordinate of the snap point |
foundDistance | the distance of the snap point to the input coordinates |
Shapefile Shapefile.GetIntersection | ( | bool | selectedOnlyOfThis, |
Shapefile | sf, | ||
bool | selectedOnly, | ||
ShpfileType | fileType, | ||
ICallback | cBack | ||
) |
Calculates intersection of 2 input shapefiles.
Intersection 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 parameter the most obvious type will be used: for example SHP_POLYGON for 2 polygon shapefiles.
selectedOnlyOfThis | A value which indicates whether operation will be applied to the selected shapes of the current shapefile only. |
sf | The second shapefile to perfrom intersection. |
selectedOnly | A value which indicates whether operation will be applied to the selected shapes of the second shapefile only. |
fileType | The type of output shapefiles. SHP_NULLSHAPE value should be passed for automatic choosing of type. |
cBack | An instance of class implementing ICallback interface. |
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 resulting one.
selectedOnlyThis | The value which indicates whether the operation will be applied only to the selected shapes of the first shapefile. |
sf | The second shapefile to take shapes from. |
selectedOnly | A value which Indicates whether the operation will be applied only to the selected shapes of the second shapefile |
Shapefile Shapefile.Reproject | ( | GeoProjection | newProjection, |
ref int | reprojectedCount | ||
) |
Creates a new shapefile by re-projecting the current one.
newProjection | The projection of the output shapefile. |
reprojectedCount | The output value with the number of shapes successfully reprojected. |
bool Shapefile.ReprojectInPlace | ( | GeoProjection | newProjection, |
ref int | reprojectedCount | ||
) |
Reprojects shapes of the current shapefile.
newProjection | The new projection. |
reprojectedCount | The number of shapes successfully reprojected. |
Shapefile Shapefile.Segmentize | ( | double | metersTolerance = 0.0 | ) |
Splits polylines at intersection with any other polylines. Works for polyline shapefile only.
metersTolerance | Polyline endpoints within this tolerance will be 'snapped' to adjacent polylines. |
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.
sf | The definition shapefile. |
relation | The target relation between shapes of the 2 shapefiles. |
selectedOnly | The value which indicates whether only selected shapes of the definition shapefile will be used. |
result | The resulting array of long data type with shape indices. |
cBack | A callback object for passing to the client the information about the progress and errors. |
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.
tolerance | The minimal distance between 2 succeeding points. A succeeding point lying closer than this value, will be removed. |
selectedOnly | A value which indicates whether all or only selected shapes will be processed. |
Shapefile Shapefile.Sort | ( | int | fieldIndex, |
bool @ | ascending | ||
) |
Sorts shapes in the shapefile based on the specified attribute.
fieldIndex | The index of field to set the sorting order. |
ascending | A value which defines the sorting order. |
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.
selectedOnlySubject | A value which indicates that only selected shapes of the first shapefile will be processed. |
sfOverlay | The second shapefile. |
selectedOnlyOverlay | A value which indicates that only selected shapes of the second shapefile will be processed. |
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.
selectedOnlySubject | The value which indicates that only selected shapes of the first shapefile will be processed. |
sfOverlay | The second shapefile. |
selectedOnlyOverlay | The value which indicates that only selected shapes of the second shapefile will be processed. |
|
getset |
Gets or sets the engine (library) to use for geoprocessing operations.
The following methods are affected by this property.