* @param cs
* @return
*/
public static CurvedGeometryFactory getCurvedGeometryFactory(ArcParameters arcParameters,
GeometryFactory gFactory, CoordinateSequence cs) {
CurvedGeometryFactory factory;
if (arcParameters != null && arcParameters.getLinearizationTolerance() != null) {
double tolerance = Double.MAX_VALUE;
if (cs != null) {
CircularArc arc = CurvedGeometries.getArc(cs, 0);
Circle c = new Circle(arc.getCenter(), arc.getRadius());
tolerance = arcParameters.getLinearizationTolerance().getTolerance(c);
}
factory = new CurvedGeometryFactory(gFactory, tolerance);
} else if (gFactory instanceof CurvedGeometryFactory) {
factory = (CurvedGeometryFactory) gFactory;
} else {
factory = new CurvedGeometryFactory(gFactory, Double.MAX_VALUE);
}
return factory;
}