33#define FORMAT_FILE "f_format"
34#define QUANT_FILE "f_quant"
35#define NULL_FILE "null"
37#define NULLC_FILE "nullcmpr"
39static int close_old(
int);
40static int close_new(
int,
int);
42static void sync_and_close(
int fd,
char *
element,
char *
name)
69static void write_fp_format(
int fd);
169static int close_old(
int fd)
187 if (
fcb->null_row_ptr)
189 if (
fcb->null_fd >= 0)
193 if (
fcb->cellhd.compressed)
199 if (
fcb->reclass_flag)
206 if (
fcb->data_fd >= 0)
212static void write_support_files(
int fd)
241 fcb->cellhd.format = -1;
243 fcb->cellhd.format =
fcb->nbytes - 1;
289static int close_new_gdal(
int fd,
int ok)
300 if (
fcb->cur_row <
fcb->cellhd.rows) {
304 for (row =
fcb->cur_row; row <
fcb->cellhd.rows; row++)
356 write_support_files(fd);
367static int close_new(
int fd,
int ok)
376 return close_new_gdal(fd,
ok);
379 switch (
fcb->open_mode) {
388 if (
fcb->cur_row <
fcb->cellhd.rows) {
390 for (row =
fcb->cur_row; row <
fcb->cellhd.rows; row++)
396 if (
fcb->null_row_ptr) {
397 fcb->null_row_ptr[
fcb->cellhd.rows] =
399 if (
fcb->null_row_ptr[
fcb->cellhd.rows] == -1) {
407 if (
fcb->null_fd >= 0) {
408 sync_and_close(
fcb->null_fd,
425 if (
fcb->null_cur_row > 0) {
429 G_warning(
_(
"Unable to rename null file '%s' to '%s': %s"),
445 if (
fcb->row_ptr[
fcb->cellhd.rows] == -1) {
478 sync_and_close(
fcb->data_fd,
482 if (
fcb->null_fd >= 0) {
483 sync_and_close(
fcb->null_fd,
491 if (
fcb->null_temp_name !=
NULL) {
506 G_warning(
_(
"Unable to rename cell file '%s' to '%s': %s"),
521 write_support_files(fd);
528 if (
fcb->null_row_ptr)
542 if (
fcb->null_row_ptr) {
544 if (
fcb->null_row_ptr[
fcb->cellhd.rows] == -1) {
553 if (
fcb->null_fd >= 0)
569 G_warning(
_(
"Unable to rename null file '%s' to '%s': %s"),
584static void write_fp_format(
int fd)
591 G_warning(
_(
"unable to write f_format file for CELL maps"));
#define OPEN_NEW_COMPRESSED
#define OPEN_NEW_UNCOMPRESSED
AMI_err name(char **stream_name)
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_misc(char *, const char *, const char *, const char *, const char *)
Builds full path names to GIS misc data files.
int G_make_mapset_object_group(const char *)
Create directory for group of elements of a given type.
char * G_file_name(char *, const char *, const char *, const char *)
Builds full path names to GIS data files.
void G_free_key_value(struct Key_Value *)
Free allocated Key_Value structure.
void G_set_key_value(const char *, const char *, struct Key_Value *)
Set value for given key.
struct Key_Value * G_create_key_value(void)
Allocate and initialize Key_Value structure.
void G_write_key_value_file(const char *, const struct Key_Value *)
Write key/value pairs to file.
int G_debug(int, const char *,...) __attribute__((format(printf
const char * G_mapset(void)
Get current mapset name.
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)
Header file for msvc/fcntl.c.
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.
Raster history info (metadata)
struct fileinfo * fileinfo
SYMBOL * err(FILE *fp, SYMBOL *s, char *msg)