if ( fs.getStorageCRS() != null ) { LOG.debug( "Transforming incoming feature collection to '" + fs.getStorageCRS() + "'" ); try { fc = transformGeometries( fc );
private FeatureCollection transformGeometries( FeatureCollection fc ) throws IllegalArgumentException, UnknownCRSException, TransformationException { FeatureCollection transformedFc = new GenericFeatureCollection(); GeometryTransformer transformer = new GeometryTransformer( fs.getStorageCRS() ); for ( Feature feature : fc ) { transformedFc.add( transformGeometries( feature, transformer ) ); } return transformedFc; }