Line Object Resampling Description

Linear object resampling refers to resampling the boundary line of Line or Region, removing some nodes on Geometry according to certain rules, and at the same time, trying to maintain the shape of Geometry.

Resampling Methods currently provided for line objects in the Vector Dataset are Slit Method and Douglas-Peucker.

1. Resampling using the diaphragm method

  1. The polyline with 6 nodes shown in the figure below is taken as an example to illustrate the calculation process of the diaphragm method:

  2. As shown in the following figure (left), draw the perpendicular of line segment 12 at node 2, select two points A and B with "resampling distance m" from node 2 on the perpendicular, connect node 1 with points A and B respectively and continue to extend to form a resampling area (pink area in the left figure), and judge whether node 3 is in the area. Delete Node2 if inside the zone; otherwise, keep. Since node 3 is in the resampling region, node 2 is removed and the polyline becomes the shape shown in the following figure (right).

  3. Then, node 3 is judged according to the method in step 1. As shown in the following figure, it is known that node 4 is not in the resampling region (green region), so node 3 is retained.

  4. Continue to judge the remaining nodes, and finally get the Resample Result as shown in the following figure.

II. Resampling with Douglas-Peucker

The calculation process of Douglas-Peucker still uses the broken line with 6 nodes used in the diaphragm method as an example to illustrate the calculation process of Douglas-Peucker: as shown in the figure below, the first and last nodes of the broken line are connected to obtain a connection line, and the maximum distance between the other nodes and the line is d, if d > m (resampling tolerance), Then the node corresponding to d is retained, and the original line object is divided into two parts by taking the node as the demarcation point, and the method is used for resampling respectively until all the divided lines cannot be resampled (that is, only two nodes are included); otherwise, all the Middle Points are deleted.

  1. In the following figure, it is obvious that d > m, so node 2 remains, and the original line object is divided into two parts, containing nodes 1, 2 and 2, 3, 4, 5, 6, respectively.

  2. As shown in the following figure (left), the line formed by nodes 1 and 2 can no longer be simplified. Repeat the previous step for the line consisting of nodes 2, 3, 4, 5, and 6. Since d < m, the nodes between nodes 2 and 6 are deleted, leaving nodes 2 and 6, which can no longer be simplified, resulting in the final resampling result shown in the following figure (right).