@ SuppressWarnings ( "nls" ) public static void writeProjectionFile ( String filePath , String extention , CoordinateReferenceSystem crs ) throws IOException { /* * fill a prj file */ String prjPath = null ; if ( extention != null && filePath . toLowerCase ( ) . endsWith ( "." + extention ) ) { int dotLoc = filePath . lastIndexOf ( "." ) ; prjPath = filePath . substring ( 0 , dotLoc ) ; prjPath = prjPath + ".prj" ; } else { if ( ! filePath . endsWith ( ".prj" ) ) { prjPath = filePath + ".prj" ; } else { prjPath = filePath ; } } try ( BufferedWriter bufferedWriter = new BufferedWriter ( new FileWriter ( prjPath ) ) ) { bufferedWriter . write ( crs . toWKT ( ) ) ; } }
Fill the prj file with the actual map projection .