kopia lustrzana https://github.com/onthegomap/planetiler
Shortcut through simplification step if distanceTolerance is negative (#1093)
rodzic
9dccfb4b7d
commit
1981abc623
|
@ -38,7 +38,7 @@ public class DouglasPeuckerSimplifier {
|
|||
* @return the simplified geometry
|
||||
*/
|
||||
public static Geometry simplify(Geometry geom, double distanceTolerance) {
|
||||
if (geom.isEmpty()) {
|
||||
if (geom.isEmpty() || (distanceTolerance < 0.0)) {
|
||||
return geom.copy();
|
||||
}
|
||||
|
||||
|
|
|
@ -165,6 +165,21 @@ class FeatureMergeTest {
|
|||
true
|
||||
)
|
||||
);
|
||||
// but doesn't resimplify if the tolerance is negative even when resimplify=true
|
||||
assertEquals(
|
||||
List.of(
|
||||
feature(1, newLineString(10, 10, 20, 20, 30, 30), Map.of("a", 1))
|
||||
),
|
||||
FeatureMerge.mergeLineStrings(
|
||||
List.of(
|
||||
feature(1, newLineString(10, 10, 20, 20, 30, 30), Map.of("a", 1))
|
||||
),
|
||||
0,
|
||||
-1,
|
||||
0,
|
||||
true
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Ładowanie…
Reference in New Issue