private static Geometry smooth(
final Geometry geom,
final double fit,
final GeometryFactory factory,
GeometrySmoother smoother) {
switch (Geometries.get(geom)) {
case POINT:
case MULTIPOINT:
return geom;
case LINESTRING:
return smoothLineString(factory, smoother, geom, fit);
case MULTILINESTRING:
return smoothMultiLineString(factory, smoother, geom, fit);
case POLYGON:
return smoother.smooth((Polygon) geom, fit);
case MULTIPOLYGON:
return smoothMultiPolygon(factory, smoother, geom, fit);
case GEOMETRYCOLLECTION:
return smoothGeometryCollection(factory, smoother, geom, fit);
default:
throw new UnsupportedOperationException(
"No smoothing method available for " + geom.getGeometryType());
}
}