/** * Duplicates a geometry to one that uses a different PrecisionModel, * without changing any coordinate values. * * @param geom the geometry to duplicate * @param newPM the precision model to use * @return the geometry value with a new precision model */ private Geometry changePM(Geometry geom, PrecisionModel newPM) { GeometryEditor geomEditor = createEditor(geom.getFactory(), newPM); // this operation changes the PM for the entire geometry tree return geomEditor.edit(geom, new GeometryEditor.NoOpGeometryOperation()); }