/** * Returns a curved geometry factory given the linearization constraints, the original factory, * and a coordinate sequence representing the control points of a curved geometry * * @param arcParameters * @param gFactory * @param cs * @return */ public static CurvedGeometryFactory getCurvedGeometryFactory( ArcParameters arcParameters, GeometryFactory gFactory, CoordinateSequence cs) { CurvedGeometryFactory factory; if (gFactory instanceof CurvedGeometryFactory) { factory = (CurvedGeometryFactory) gFactory; } else 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 { factory = new CurvedGeometryFactory(gFactory, Double.MAX_VALUE); } return factory; } }