| Environments | PYTHON :: EASI :: MODELER |
| Batch Mode | Yes |
| Quick links | Description :: Parameters :: Parameter descriptions :: Details :: Algorithm |
| Back to top |
| Back to top |
| Name | Type | Length | Value range |
|---|---|---|---|
| InputA: Input vector segment(s) * | Vector port | 1 - 1024 | |
| OutputA: Output vector segment * | Vector port | 1 - 1 | |
| Thinning Tolerance | Float | 1 - 1 | 0.0 - Default: 1.0 |
| Report | String | 0 - 192 | See parameter description |
| Back to top |
InputA: Input vector segment(s)
Specifies the list of vector layers to be thinned.
OutputA: Output vector segment
Specifies the output vector layer to receive the thinned vectors.
Thinning Tolerance
Specifies the thinning tolerance value. The thinning tolerance must be greater than 0.0.
The units used for thinning tolerance are the same as those used for the vertex coordinates. The default is 1.0. If the thinning tolerance is equal to 0.0, the input is copied to the output.
Report
Specifies where to direct the generated report.
Available options are:
| Back to top |
VECTHIN "thins" a vector layer using the Douglas-Poiker algorithm.
Shapes with less than three vertices are not modified.
For more details on the Douglas-Poiker algorithm, see the Algorithm section.
| Back to top |
Weeding: Douglas-Poiker algorithm
In a general sense, a weeding (filtering) algorithm is used to reduce the number of points (nodes) on a vector element without overtly affecting its general aspect.
The Douglas-Poiker algorithm works on a non-topological layer. The algorithm is dependent on the physical layout of the line. Lines with a great deal of variation between points will require more time to simplify than lines with the same number of points but less variation.
How it works
The Douglas-Poiker algorithm comprises several phases. First, an anchor point and a floater must be defined. In the example below, at stage B, the anchor is p1 and the floater is p16. Notice how the anchor point remains stable through stages B to E. while the floater moves. This does not mean that the anchor remains completely stable, only that it moves at a slower rate than the floater point.
p4
A * * * * *
* * *p16
*p1 * *p8 *
*
*
*
*p12
p4
B * * * * *
___________*_______________________
* * p16
*p1 * *p8 * ______
_______________*______|____________ ______t
* | d
* |
* p12
Phase 1
The line in the figure above requires 14+10+2+1 = 27 calculations of the value d (the perpendicular distance from a point to a corridor) before a single point is eliminated.
Stage 1b
At the start, the anchor is one end of the line and the floater is the other end of the line. For a closed polygon, the anchor is still the first point, while the floater starts at the next-to-last point. The floater and anchor points establish the corridor direction, while the tolerance (t) establishes the corridor width. Once the initial corridor is established, the point farthest away from the center of the corridor is determined. For stage B of the diagram above, the point p12 is farthest away from the corridor.
When the maximal point is determined (p12), it is placed on the stack. This maximal point is called the 'maximum perpendicular bisector'.
Determining the maximal point requires n-2 calculations of d (and the same number of comparisons). There is one comparison to determine if the maximal point falls within the corridor; if it does, every point between the anchor and the floater is eliminated.
At this stage, the maximal distance is not in the corridor, so proceed to stage 1c.
Stage 1c
The anchor is still the same as in stage 1b, but the floater has now become p12, the previous maximal point. Now, the maximal point between p1 and p12 is evaluated. The result here is p5. Determining that p5 is the maximal point requires 12 - 2=10 steps.
Because p5 is still larger than the tolerance, p5 is placed on the stack.
Stage 1d
The floater point is p5 while the maximal distance is at p3. Again, the maximal point is not within the tolerance, so p3 is placed on the stack. The number of steps needed to determine that p3 is the maximal point is 2.
Stage 1e
Finally, for last stage of Phase 1, we have a maximal point, p2, that falls within the tolerance; p2 is therefore eliminated from the line. If there were more points between the floater and the anchor at this stage, all of those points would be eliminated as well.
Phase 2
Each phase is determined by the movement of the anchor to a new position.
Now that p2 has been eliminated, the anchor can be moved. The anchor is moved to the last position of the float, p3, and the float is moved to the point on the top of the stack, which should be p5.
This is the maximal point, and it falls within the specified tolerance value. All points between p3 and p5, therefore, must be eliminated. Point p4 is deleted and p3 is connected to p5.
Phase 3
Because point p4 has been deleted, you must now move the anchor to p5. Point p11 is topped off the stack and the floater is moved to it. The maximal point is found, but because it does not fall within the tolerance, you must store it on the stack and move the float to it.
The float must move to the maximal point found in 1c. Now, a new maximal point must be found. Because the new one falls within the tolerance corridor, every point between the anchor and the float must be deleted. Figure E is the result.
Because the anchor has moved to a new position, a new phase begins. The maximal point here is outside of the tolerance corridor, so it is pushed onto the stack.
This is a degenerate case: the anchor and the float are directly linked, with no intervening points. In this case, the anchor is moved to the float, and the float is moved to the next point on the stack.
© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.