33 #define FORMAT_FILE "f_format" 34 #define QUANT_FILE "f_quant" 35 #define NULL_FILE "null" 37 #define NULLC_FILE "nullcmpr" 39 static int close_old(
int);
40 static int close_new(
int,
int);
42 static void sync_and_close(
int fd,
char *
element,
char *
name)
56 G_warning(
_(
"Unable to flush file %s for raster map %s: %s"),
57 element, name, strerror(errno));
64 G_warning(
_(
"Unable to close file %s for raster map %s: %s"),
65 element, name, strerror(errno));
69 static void write_fp_format(
int fd);
169 static int close_old(
int fd)
212 static void write_support_files(
int fd)
217 CELL cell_min, cell_max;
289 static int close_new_gdal(
int fd,
int ok)
322 cell_fd = creat(path, 0666);
331 cell_fd = creat(path, 0666);
358 write_support_files(fd);
369 static int close_new(
int fd,
int ok)
375 const char *CELL_DIR;
378 return close_new_gdal(fd, ok);
424 G_warning(
_(
"Unable to rename null file '%s' to '%s': %s"),
499 G_warning(
_(
"Unable to rename cell file '%s' to '%s': %s"),
514 write_support_files(fd);
557 G_warning(
_(
"Unable to rename null file '%s' to '%s': %s"),
572 static void write_fp_format(
int fd)
579 G_warning(
_(
"unable to write f_format file for CELL maps"));
#define OPEN_NEW_COMPRESSED
void Rast_close_gdal_link(struct GDAL_link *)
Close existing GDAL link.
char * G_file_name_misc(char *, const char *, const char *, const char *, const char *)
Builds full path names to GIS misc data files.
char * G_file_name(char *, const char *, const char *, const char *)
Builds full path names to GIS data files.
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void Rast_write_history(const char *, struct History *)
Write raster history file.
void Rast_put_row(int, const void *, RASTER_MAP_TYPE)
Writes the next row for cell/fcell/dcell file.
void Rast__remove_fp_range(const char *)
Remove floating-point range.
void Rast_free_reclass(struct Reclass *)
Free Reclass structure.
void Rast_close(int fd)
Close a raster map.
void Rast_construct_default_range(struct Range *)
Construct default range.
void Rast_free_cell_stats(struct Cell_stats *)
Free cell stats structure.
int Rast_remove_colors(const char *, const char *)
Remove color table of raster map.
void G_free(void *)
Free allocated memory.
int G__make_mapset_element_misc(const char *, const char *)
Create misc element in the current mapset.
void Rast_close_vrt(struct R_vrt *)
unsigned char * null_bits
int format
Max number of bytes per raster data value minus 1 (raster header only)
#define OPEN_NEW_UNCOMPRESSED
void Rast_quant_free(struct Quant *)
Resets and frees allocated memory.
int compressed
Compression mode (raster header only)
void Rast__unopen_all(void)
Unopen all raster maps.
void Rast_zero_output_buf(void *, RASTER_MAP_TYPE)
void Rast_write_fp_range(const char *, const struct FPRange *)
Write raster range file (floating-point)
Raster history info (metadata)
void G_set_key_value(const char *, const char *, struct Key_Value *)
Set value for given key.
void G_write_key_value_file(const char *, const struct Key_Value *)
Write key/value pairs to file.
void Rast_put_cellhd(const char *, struct Cell_head *)
Writes the raster file header.
void Rast_init_cats(const char *, struct Categories *)
Initialize category structure.
int Rast_close_gdal_write_link(struct GDAL_link *)
Close existing GDAL link and write out data.
struct fileinfo * fileinfo
int Rast__write_row_ptrs(int)
void Rast_short_history(const char *, const char *, struct History *)
Initialize history structure.
void Rast_unopen(int fd)
Unopen a raster map.
const char * G_mapset(void)
Get current mapset name.
void G_warning(const char *,...) __attribute__((format(printf
void Rast_free_cats(struct Categories *)
Free category structure memory.
void Rast_write_cats(const char *, struct Categories *)
Write raster category file.
void Rast_remove_histogram(const char *)
Removes the histogram.
void Rast_quant_round(struct Quant *)
Sets the quant rules to perform simple rounding on floats.
int G_make_mapset_element(const char *)
Create element in the current mapset.
void Rast_write_range(const char *, const struct Range *)
Write raster range file.
struct Key_Value * G_create_key_value(void)
Allocate and initialize Key_Value structure.
int Rast__write_null_row_ptrs(int, int)
void Rast_write_histogram_cs(const char *, struct Cell_stats *)
Writes the histogram based on cell statistics to file.
int rows
Number of rows for 2D data.
#define Rast_is_c_null_value(cellVal)
void Rast__close_null(int fd)
int G_debug(int, const char *,...) __attribute__((format(printf
void G_free_key_value(struct Key_Value *)
Free allocated Key_Value structure.
void Rast_get_range_min_max(const struct Range *, CELL *, CELL *)
Get range min and max.
void Rast_write_quant(const char *, const char *, const struct Quant *)
Writes the quant rule table for the raster map.