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)
57 name, strerror(errno));
65 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)
320 cell_fd = creat(
path, 0666);
329 cell_fd = creat(
path, 0666);
356 write_support_files(fd);
367 static int close_new(
int fd,
int ok)
373 const char *CELL_DIR;
376 return close_new_gdal(fd, ok);
398 lseek(fcb->
null_fd, 0L, SEEK_CUR);
424 G_warning(
_(
"Unable to rename null file '%s' to '%s': %s"),
496 G_warning(
_(
"Unable to rename cell file '%s' to '%s': %s"),
511 write_support_files(fd);
554 G_warning(
_(
"Unable to rename null file '%s' to '%s': %s"),
569 static void write_fp_format(
int fd)
576 G_warning(
_(
"unable to write f_format file for CELL maps"));
#define OPEN_NEW_COMPRESSED
#define OPEN_NEW_UNCOMPRESSED
char * G_file_name_misc(char *, const char *, const char *, const char *, const char *)
Builds full path names to GIS misc data files.
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 void void void G_fatal_error(const char *,...) __attribute__((format(printf
void G_warning(const char *,...) __attribute__((format(printf
char * G_file_name(char *, const char *, const char *, const char *)
Builds full path names to GIS data files.
int G_make_mapset_object_group(const char *)
Create directory for group of elements of a given type.
void G_free_key_value(struct Key_Value *)
Free allocated Key_Value structure.
const char * G_mapset(void)
Get current mapset name.
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.
struct Key_Value * G_create_key_value(void)
Allocate and initialize Key_Value structure.
int G_debug(int, const char *,...) __attribute__((format(printf
void Rast_put_cellhd(const char *, struct Cell_head *)
Writes the raster file header.
void Rast_free_cats(struct Categories *)
Free category structure memory.
void Rast_construct_default_range(struct Range *)
Construct default range.
void Rast_write_histogram_cs(const char *, struct Cell_stats *)
Writes the histogram based on cell statistics to file.
void Rast_quant_round(struct Quant *)
Sets the quant rules to perform simple rounding on floats.
void Rast_close_gdal_link(struct GDAL_link *)
Close existing GDAL link.
void Rast_quant_free(struct Quant *)
Resets and frees allocated memory.
void Rast_write_cats(const char *, struct Categories *)
Write raster category file.
void Rast_free_reclass(struct Reclass *)
Free Reclass structure.
void Rast_free_cell_stats(struct Cell_stats *)
Free cell stats structure.
int Rast__write_row_ptrs(int)
void Rast_remove_histogram(const char *)
Removes the histogram.
void Rast_write_history(const char *, struct History *)
Write raster history file.
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.
int Rast__write_null_row_ptrs(int, int)
void Rast_write_range(const char *, const struct Range *)
Write raster range file.
void Rast__remove_fp_range(const char *)
Remove floating-point range.
void Rast_get_range_min_max(const struct Range *, CELL *, CELL *)
Get range min and max.
void Rast_close_vrt(struct R_vrt *)
void Rast_put_row(int, const void *, RASTER_MAP_TYPE)
Writes the next row for cell/fcell/dcell file.
void Rast_short_history(const char *, const char *, struct History *)
Initialize history structure.
#define Rast_is_c_null_value(cellVal)
int Rast_remove_colors(const char *, const char *)
Remove color table of raster map.
void Rast_write_quant(const char *, const char *, const struct Quant *)
Writes the quant rule table for the raster map.
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)
void Rast__close_null(int fd)
void Rast_close(int fd)
Close a raster map.
void Rast__unopen_all(void)
Unopen all raster maps.
void Rast_unopen(int fd)
Unopen a raster map.
int compressed
Compression mode (raster header only)
int format
Max number of bytes per raster data value minus 1 (raster header only)
int rows
Number of rows for 2D data.
Raster history info (metadata)
struct fileinfo * fileinfo
unsigned char * null_bits