| Environments | PYTHON :: EASI :: MODELER |
| Quick links | Description :: Parameters :: Parameter descriptions :: Details :: Example :: Algorithm |
| Back to top |
| Back to top |
| Name | Type | Caption | Length | Value range |
|---|---|---|---|---|
| FILI * | String | Input file name | 1 - 192 | |
| FILO | String | Output file name | 0 - 192 | |
| DBSL * | Integer | Input vector segment(s) | 1 - | |
| THINTOL * | Float | Thinning tolerance value | 1 - 1 | 0.0 - Default: 1.0 |
| DBSN | String | Output segment name | 0 - 8 | Default: Thin |
| DBSD | String | Output segment description | 0 - 64 | |
| REPORT | String | Report mode | 0 - 192 | Quick links |
| MONITOR | String | Monitor mode | 0 - 3 | ON, OFF Default: ON |
| Back to top |
FILI
Specifies the name of the PCIDSK image file containing the input vector layer(s) to be thinned.
FILO
Specifies the name of the PCIDSK file to receive the output thinned vector layer(s).
If FILO is not specified, FILI is used for the output. If FILO is specified but does not exist, a new file is created.
DBSL
Specifies the list of vector layers to be thinned.
Ranges of channels or segments can be specified with negative values. For example, {1,-4,10} is internally expanded to {1,2,3,4,10}. When you are not specifying a range in this way, only 48 numbers can be specified explicitly.
THINTOL
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.
DBSN
Specifies a name (up to 8 characters) for the new vector segment.
DBSD
Describes (in up to 64 characters) the contents or origins of the new vector data.
If this parameter is not specified, the description is taken from the input vector list.
REPORT
Specifies where to direct the generated report.
Available options are:
MONITOR
The program progress can be monitored by printing the percentage of processing completed. A system parameter, MONITOR, controls this activity.
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 |
Read vector layer 25 from irvine.pix and store the thinned vector in a new file named "oirvine.pix". Use a thinning tolerance of 10.
EASI>FILI = "irvine.pix" EASI>FILO = "oirvine.pix" ! new file to store thinning vector EASI>DBSL = 25 ! read vector layer 25 for thinning EASI>THINTOL = 10 ! thinning tolerance 10 EASI>DBSN = ! defaults to Thin EASI>DBSD = ! defaults to the input vector description EASI>REPORT = "DISK" ! send report to DISK EASI>MONITOR = "ON" ! turn progress counter ON EASI>run VECTHIN
| 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.