private static IVector2 createPoint( final com.vividsolutions.jts.geom.Coordinate coordinate, final GProjection projection) { if (projection.isLatLong()) { return new GVector2D(Math.toRadians(coordinate.x), Math.toRadians(coordinate.y)); } return new GVector2D(coordinate.x, coordinate.y).reproject(projection, GProjection.EPSG_4326); }
private static List<IVector2> convert( final com.vividsolutions.jts.geom.Coordinate[] coordinates, final GProjection projection) { final List<IVector2> result = new ArrayList<IVector2>(coordinates.length); for (final com.vividsolutions.jts.geom.Coordinate coordinate : coordinates) { if (projection.isLatLong()) { result.add(new GVector2D(Math.toRadians(coordinate.x), Math.toRadians(coordinate.y))); } else { result.add( new GVector2D(coordinate.x, coordinate.y).reproject(projection, GProjection.EPSG_4326)); } } return result; }