private void createCellhd( int chproj, int chzone, double chn, double chs, double che, double chw, int chcols, int chrows,
            double chnsres, double chewres, int chformat, int chcompressed ) throws Exception {
        StringBuffer data = new StringBuffer(512);
        data.append("proj:   " + chproj + "\n").append("zone:   " + chzone + "\n").append("north:   " + chn + "\n")
                .append("south:   " + chs + "\n").append("east:   " + che + "\n").append("west:   " + chw + "\n")
                .append("cols:   " + chcols + "\n").append("rows:   " + chrows + "\n").append("n-s resol:   " + chnsres + "\n")
                .append("e-w resol:   " + chewres + "\n").append("format:   " + chformat + "\n")
                .append("compressed:   " + chcompressed);
        File ds = new File(mapsetPath + File.separator + GrassLegacyConstans.CELLHD + File.separator + name);
        OutputStreamWriter windFile = new OutputStreamWriter(new FileOutputStream(ds));
        windFile.write(data.toString());
        windFile.close();
    }
private void createCellhd ( int chproj , int chzone , double chn , double chs , double che , double chw , int chcols , int chrows , double chnsres , double chewres , int chformat , int chcompressed ) throws Exception { StringBuffer data = new StringBuffer ( 512 ) ; data . append ( "proj:   " + chproj + "\n" ) . append ( "zone:   " + chzone + "\n" ) . append ( "north:   " + chn + "\n" ) . append ( "south:   " + chs + "\n" ) . append ( "east:   " + che + "\n" ) . append ( "west:   " + chw + "\n" ) . append ( "cols:   " + chcols + "\n" ) . append ( "rows:   " + chrows + "\n" ) . append ( "n-s resol:   " + chnsres + "\n" ) . append ( "e-w resol:   " + chewres + "\n" ) . append ( "format:   " + chformat + "\n" ) . append ( "compressed:   " + chcompressed ) ; File ds = new File ( mapsetPath + File . separator + GrassLegacyConstans . CELLHD + File . separator + name ) ; OutputStreamWriter windFile = new OutputStreamWriter ( new FileOutputStream ( ds ) ) ; windFile . write ( data . toString ( ) ) ; windFile . close ( ) ; }
changes the cellhd file inserting the new values obtained from the environment