public static String toSingleLineWKT ( CoordinateReferenceSystem crs ) { String wkt = null ; try { // this is a lenient transformation, works with polar stereographics too Formattable formattable = ( Formattable ) crs ; wkt = formattable . toWKT ( 0 , false ) ; } catch ( ClassCastException e ) { wkt = crs . toWKT ( ) ; } wkt = wkt . replaceAll ( "\n" , "" ) . replaceAll ( " " , "" ) ; return wkt ; }
Turns the CRS into a single line WKT