LineThinning

The LineThinning method thins (or simplifies) a line or polygon by removing vertices.

Syntax

object.LineThinning( Method, KeepEvery, AverageEvery, DeviationDistance )

Parameter

Type

Default

Description

Method

SrfSimplificationMethod

required; method for removing vertices from line/polygon: keep every nth, vertex averaging, or deviation distance

KeepEvery

Integer

1

optional; the nth vertex to keep when using srfSimplificationKeepEveryN

AverageEvery

Integer

1

optional; the number of vertices to average when using srfSimplificaitonVertexAvg

DeviationDistance

Double

0

optional; the minimum distance by which vertices must be separated. Vertices within the deviation distance are removed. Used with srfSimplificationDeviationDist.

Remarks

Only the optional parameter required by the selected Method must be specified. If the parameter required by the Method is not specified, the default value will be used. The default values all result in no change to the selection.

  • For srfSimplificationKeepEveryN, use KeepEvery
  • For srfSimplificationVertexAvg, use AverageEvery
  • For srfSimplificationDeviationDist, use DeviationDistance

The DeviationDistance is in local units. Therefore the Selection collection should only contain objects with the same local units when performing thinning with the srfSimplificationDeviationDist method.

To select objects in a base layer, use the StartEditing method on the base layer Shapes collection.

Example 1

This example demonstrates how to simplify a selected polygon with keep every 4th vertex thinning.

Selection.LineThinning(Method:=srfSimplificationKeepEveryN, KeepEvery:=4)

Example 2

This example demonstrates how to simplify a selected polygon with average every 5 vertices thinning.

Selection.LineThinning(Method:=srfSimplificationVertexAvg, AverageEvery:=5)

Example 3

This example demonstrates how to simplify a selected polygon with deviation distance thinning with a deviation distance of 0.25".

Selection.LineThinning(Method:=srfSimplificationDeviationDist, DeviationDistance:=0.25)

Used by: Selection Collection