Class ResampleType
- java.lang.Object
-
- com.supermap.data.Enum
-
- com.supermap.data.ResampleType
-
public class ResampleType extends Enum
This class defines the vector data resampling type constant.
-
-
Field Summary
Fields Modifier and Type Field and Description static ResampleType
RTBEND
Resampling with the diaphragm algorithm.static ResampleType
RTGENERAL
Resampling with the douglas algorithm.
-
-
-
Field Detail
-
RTBEND
public static final ResampleType RTBEND
Resampling with the diaphragm algorithm.The figure below illustrates the calculation process with the polyline which has 6 nodes:
1. As shown in the figure on the left, draw a line perpendicular to the line segment 12 through the point 12, select two points A and B on the line with the distance to the point 2 as m (the resampling tolerance), connect point 1 and A, B, extend to form the resampling extent (the pink region), determines whether point 3 is in the region, delete point 2 if point 8 is in the region.
Since point 3 is in the resampling region, the point 2 is deleted, the polyline is changed to the polyline on the right.
2. Perform the same computing for point 3. As shown below, since point 4 is not in the resampling region (the green region), the point 3 is retained.
3. Continue the operation for the remaining nodes, the result is as the following.
-
RTGENERAL
public static final ResampleType RTGENERAL
Resampling with the douglas algorithm.The following steps shows the process of the Douglas Peucker algorithm.
1. As shown below, connect the start node and the end node of the polyline with a line, the maximum distance from other nodes to this line is d, if d > m, the corresponding point of d will be retained, the original line object will be divided in to two parts and the point, then contine use this method to resampe, until all the divided line can not be resampled (only contains two nodes); otherwise all the nodes in between will be deleted.
In the figure below, d > m, node 2 is retained, the original line object is divided to two parts, one contains node 1 and 2, the other contains node 2, 3, 4, 5 and 6.
2. As shown below, the line composed by node 1 and 2 can't be simplified, repeat step 1 for the line composed by node 2, 3, 4, 5 and 6, since d < m, the nodes between 2 and 6 will be deleted, the final result is shown in the figure on the right.
-
-