CoordinateTransformer { public static CoordinateReferenceSystem decode(String s) throws FactoryException { if (CompoundCRSDecoder.isCompound(s)) { return CompoundCRSDecoder.decode(s); } if (WKTCRSDecoder.isWKT(s)) { return WKTCRSDecoder.decode(s); } return CRS.decode(s); } CoordinateTransformer(CoordinateReferenceSystem crs); double[] transform(double[] from, int dimension); static CoordinateReferenceSystem decode(String s);  }
@Test public void testEPSG() throws Exception { CoordinateReferenceSystem crs = CRS.decode("EPSG:31467"); CoordinateTransformer transformer = new CoordinateTransformer(crs); double[] source = {3477534.683, 5605739.857}; double[] destination = {8.681739535269804, 50.58691850210496}; testTransformation(transformer, source, destination); }
@Test public void testWKT() throws Exception { CoordinateReferenceSystem crs = CRS.decode("EPSG:31467"); CoordinateReferenceSystem wktCrs = CoordinateTransformer.decode(crs.toWKT()); CoordinateTransformer transformer = new CoordinateTransformer(wktCrs); double[] source = {3477534.683, 5605739.857}; double[] destination = {8.681739535269804, 50.58691850210496}; testTransformation(transformer, source, destination); }