[GRASS-dev] How to read a raster cell value?

Colin Nielsen colin.nielsen at gmail.com
Thu Jun 26 11:25:53 EDT 2008


As far as I can tell I have set the dir_fd file up to be full of double values:

    	dir_buf = G_allocate_d_raster_buf();
        dir_id = G_open_cell_old(dir_name, dir_mapset);
	    tempfile3 = G_tempfile();
		dir_fd = open(tempfile3, O_RDWR | O_CREAT);

	    //cn: transfer dir input map to a temp file
	    for (i = 0; i < nrows; i++) {
	    	G_get_d_raster_row(dir_id, dir_buf, i);
	    	//get_row(dir_id, dir_buf, i);
	    	write(dir_fd, dir_buf, sizeof(DCELL));
	    }
    	G_close_cell(dir_id);


More information about the grass-dev mailing list