ProjectionHelper implements PointTransformer { public Point reproject(final Point point, final String sourceSRS, final String targetSRS) { return transformPoint(point, sourceSRS, targetSRS); }  static Point transformPoint(final double lon, final double lat, final String sourceSRS, final String targetSRS); Point reproject(final Point point, final String sourceSRS, final String targetSRS); static Point transformPoint(final Point point, final String sourceSRS, final String targetSRS); static Point transformPoint(final String lon, final String lat, final String sourceSRS, final String targetSRS); static Point transformPoint(final double lon, final double lat, final CoordinateReferenceSystem sourceCrs, final String targetSRS); static Point transformPoint(final double lon, final double lat, final CoordinateReferenceSystem sourceCrs, final CoordinateReferenceSystem targetCrs); static Point transformPoint(final Point point, final CoordinateReferenceSystem sourceCrs, final CoordinateReferenceSystem targetCrs); static boolean isFirstAxisNorth(CoordinateReferenceSystem crs); static String shortSyntaxEpsg(String crs); static String longSyntaxEpsg(String crs); static CoordinateReferenceSystem longSyntaxCrs(String crs); static JSONObject transformGeometry(JSONObject geometry, final String sourceSRS, final String targetSRS, boolean sourceLon1st, boolean targetLon1st); static void flipFeatureYX(Geometry fnG); static void swapGeometryXY(FeatureCollection<SimpleFeatureType, SimpleFeature> featureCollection);  }
@Test public void testReprojectPointCRSs() throws Exception { double lat = 6760528; double lon = 428128; Point p1 = new Point(lon, lat); Point p2 = service.reproject(p1, EPSG_3067, EPSG_4258); Point p3 = service.reproject(p2, EPSG_4258, EPSG_3878); Point p4 = service.reproject(p3, EPSG_3878, EPSG_4258); assertEquals("lon 3878to4258", p2.getLon(), p4.getLon(), 0.000001); assertEquals("lat 3878to4258", p2.getLat(), p4.getLat(), 0.000001); Point p5 = service.reproject(p4, EPSG_4258, EPSG_3067); assertEquals("lon 3067to3067", lon, p5.getLon(), 0.01); assertEquals("lat 3067to3067", lat, p5.getLat(), 0.01); Point p7 = service.reproject(p5, EPSG_3067, EPSG_3878); assertEquals("lon 3067to3878", p3.getLon(), p7.getLon(), 0.01); assertEquals("lat 3067to3878", p3.getLat(), p7.getLat(), 0.01); Point p8 = service.reproject(p7, EPSG_3878, EPSG_3067); assertEquals("lon 3878to3067", p1.getLon(), p8.getLon(), 0.01); assertEquals("lat 3878to3067", p1.getLat(), p8.getLat(), 0.01); }