Resampling linear objects refers to resampling the boundary of a line or region, removing some vertices from the geometry according to certain rules while preserving the shape of the geometry as much as possible.
The resampling methods currently available for linear objects in vector datasets include Blend and Douglas-Peucker.
1. Resampling Using Blend
- The following uses the polyline with 6 vertices shown in the figure below as an example to illustrate the calculation process of the bend method:

- As shown in the figure below (left), draw a perpendicular line to line segment 12 at vertex 2. On the perpendicular line, select points A and B at a distance of "resampling distance m" from vertex 2. Connect vertex 1 to points A and B respectively and extend them to form a resampling area (the pink area in the left figure). Determine whether vertex 3 is within this area. If it is, delete vertex 2; otherwise, keep it. Since vertex 3 is within the resampling area, vertex 2 is deleted, and the polyline becomes the shape shown in the figure below (right).

- Then, determine vertex 3 using the method in step 1. As shown in the figure below, vertex 4 is not within the resampling area (green area), so vertex 3 is retained.

- Continue to judge the remaining vertices, and finally obtain the resample result as shown in the figure below.

2. Resampling Using Douglas-Peucker
The following still uses the polyline with 6 vertices used in the bend method as an example to illustrate the calculation process of Douglas-Peucker: As shown in the figure below, connect the first and last vertices of the polyline to obtain a line segment. The maximum distance from other vertices to this line is d. If d > m (resampling tolerance), the vertex corresponding to d is retained, and the original line object is divided into two parts at this vertex. Continue to use this method for resampling on each part until no further resampling can be performed on any divided line (i.e., it contains only two vertices); otherwise, all middle points are deleted.
- In the figure below, obviously d > m, so vertex 2 is retained, and the original line object is divided into two parts, containing vertices 1, 2 and 2, 3, 4, 5, 6 respectively.

- As shown in the figure below (left), the line formed by vertices 1 and 2 cannot be simplified further. Repeat the previous step for the line formed by vertices 2, 3, 4, 5, 6. Since d < m, the vertices between 2 and 6 are all deleted, leaving only vertices 2 and 6, so it cannot be simplified further. Thus, the final resampling result is obtained as shown in the figure below (right).
