|
32 | 32 | import org.locationtech.jts.noding.SegmentStringUtil; |
33 | 33 | import org.locationtech.jts.noding.snap.SnappingNoder; |
34 | 34 | import org.locationtech.jts.operation.polygonize.Polygonizer; |
35 | | -import org.locationtech.jts.operation.relateng.RelateNG; |
36 | | -import org.locationtech.jts.operation.relateng.RelatePredicate; |
37 | 35 | import org.locationtech.jts.util.IntArrayList; |
38 | | -import org.locationtech.jts.util.Stopwatch; |
39 | 36 |
|
40 | 37 | /** |
41 | | - * Cleans the linework of a set of polygonal geometries to form a valid polygonal coverage. |
| 38 | + * Cleans the linework of a set of valid polygonal geometries to form a valid polygonal coverage. |
42 | 39 | * The input is an array of valid {@link Polygon} or {@link MultiPolygon} geometries |
43 | 40 | * which may contain topological errors such as overlaps and gaps. |
44 | 41 | * Empty or non-polygonal inputs are removed. |
45 | 42 | * Linework is snapped together to eliminate small discrepancies. |
46 | | - * Overlaps are merged with an adjacent polygon, according to a given merge strategy. |
| 43 | + * Overlaps are merged with a parent polygon, according to a given merge strategy. |
47 | 44 | * Gaps narrower than a given width are filled and merged with an adjacent polygon. |
48 | 45 | * The output is an array of polygonal geometries forming a valid polygonal coverage. |
49 | 46 | * |
50 | 47 | * <h3>Snapping</h3> |
51 | 48 | * |
52 | 49 | * Snapping to nearby vertices and line segment snapping is used to improve noding robustness |
53 | 50 | * and eliminate small errors in an efficient way, |
54 | | - * By default this uses a very small snapping distance based on the extent of the input data. |
| 51 | + * By default this uses a small snapping distance based on the extent of the input data. |
55 | 52 | * The snapping distance may be specified explicitly. |
56 | 53 | * This can reduce the number of overlaps and gaps that need to be merged, |
57 | | - * and reduce the risk of spikes formed by merging gaps. |
| 54 | + * and reduce the risk of spikes formed by merged gaps. |
58 | 55 | * However, a large snapping distance may introduce undesirable data alteration. |
| 56 | + * Snapping is disabled if a zero snapping distance is specified. |
| 57 | + * (Note that disabling snapping may prevent collinear linework from being noded correctly.) |
59 | 58 | * |
60 | 59 | * <h3>Overlap Merging</h3> |
61 | 60 | * |
62 | | - * Overlaps are merged with an adjacent polygon chosen according to a specified merge strategy. |
| 61 | + * Overlaps are merged into a parent polygon chosen according to a specified merge strategy. |
63 | 62 | * The supported strategies are: |
64 | 63 | * <ul> |
65 | 64 | * <li><b>Longest Border</b>: (default) merge with the polygon with longest shared border |
|
69 | 68 | * <li><b>Minimum Index</b>: merge with the polygon with the lowest index in the input array |
70 | 69 | * ({@link #MERGE_MIN_INDEX}.) |
71 | 70 | * This allows sorting the input according to some criteria to provide a priority |
72 | | - * for merging gaps. |
| 71 | + * for merging overlaps. |
73 | 72 | * </ul> |
74 | 73 | * |
75 | 74 | * <h3>Gap Merging</h3> |
|
0 commit comments