20 Rast3d_error(
_(
"Rast3d_open_cell_old_no_header: error in Rast3d_mask_open_old"));
26 Rast3d_error(
_(
"Rast3d_open_cell_old_no_header: error in Rast3d_malloc"));
37 Rast3d_error(
_(
"Rast3d_open_cell_old_no_header: error in G_open_old"));
82 int compression, useRle, useLzw, type, tileX, tileY, tileZ;
83 int rows, cols, depths, precision;
84 double ew_res, ns_res, tb_res;
85 int nofHeaderBytes, dataOffset, useXdr, hasIndex;
90 double north, south, east, west, top, bottom;
94 Rast3d_error(
_(
"Rast3d_open_cell_old: error in Rast3d_open_cell_old_no_header"));
98 if (lseek(map->
data_fd, (
long)0, SEEK_SET) == -1) {
105 &north, &south, &east, &west, &top, &bottom,
106 &rows, &cols, &depths,
107 &ew_res, &ns_res, &tb_res,
108 &tileX, &tileY, &tileZ,
109 &type, &compression, &useRle, &useLzw,
110 &precision, &dataOffset, &useXdr, &hasIndex, &unit, &vertical_unit,
112 Rast3d_error(
_(
"Rast3d_open_cell_old: error in Rast3d_read_header"));
119 if (proj != window->
proj) {
120 Rast3d_error(
_(
"Rast3d_open_cell_old: projection does not match window projection"));
123 if (zone != window->
zone) {
124 Rast3d_error(
_(
"Rast3d_open_cell_old: zone does not match window zone"));
146 Rast3d_error(
_(
"Rast3d_open_cell_old: error in Rast3d_malloc"));
160 nofHeaderBytes = dataOffset;
166 type, precision, cache,
167 hasIndex, map->
useXdr, typeIntern,
168 nofHeaderBytes, tileX, tileY, tileZ,
170 north, south, east, west, top, bottom,
171 rows, cols, depths, ew_res, ns_res, tb_res, unit, vertical_unit,
173 Rast3d_error(
_(
"Rast3d_open_cell_old: error in Rast3d_fill_header"));
214 int nofHeaderBytes, dummy = 0,
compression, precision;
220 Rast3d_error(
_(
"Rast3d_open_cell_new: error in Rast3d_mask_open_old"));
229 Rast3d_error(
_(
"Rast3d_open_cell_new: error in Rast3d_malloc"));
234 G_warning(
_(
"map <%s> is not in the current mapset"), name);
244 Rast3d_error(
_(
"Rast3d_open_cell_new: could not open file"));
256 else if (precision < -1)
259 else if (precision > 52)
261 else if (precision < -1)
299 nofHeaderBytes = lseek(map->
data_fd, (
long)0, SEEK_CUR);
306 map->
useXdr, typeIntern, nofHeaderBytes,
315 Rast3d_error(
_(
"Rast3d_open_cell_new: error in Rast3d_fill_header"));
void Rast3d_init_defaults(void)
Initializes the default values described in RASTER3D Defaults. Applications have to use this function...
int Rast3d_fill_header(RASTER3D_Map *, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, double, double, double, double, double, double, int, int, int, double, double, double, char *, int, int)
unsigned short compression
void Rast3d_region_copy(RASTER3D_Region *, RASTER3D_Region *)
Copies the values of regionSrc into regionDst.
#define RASTER3D_MAX_PRECISION
#define RASTER3D_WRITE_DATA
void * Rast3d_malloc(int)
Same as malloc (nBytes), except that in case of error Rast3d_error() is invoked.
int G_unqualified_name(const char *, const char *, char *, char *)
Returns unqualified map name (without @ mapset)
#define RASTER3D_DEFAULT_WINDOW
int Rast3d_mask_open_old(void)
void Rast3d_make_mapset_map_directory(const char *)
void Rast3d_long_decode(unsigned char *, long *, int, int)
int Rast3d_read_header(RASTER3D_Map *, int *, int *, double *, double *, double *, double *, double *, double *, int *, int *, int *, double *, double *, double *, int *, int *, int *, int *, int *, int *, int *, int *, int *, int *, int *, char **, int *, int *)
void Rast3d_fatal_error(const char *,...) __attribute__((format(printf
void Rast3d_error(const char *,...) __attribute__((format(printf
int G_open_old_misc(const char *, const char *, const char *, const char *)
open a database file for reading
void * Rast3d_open_cell_old_no_header(const char *name, const char *mapset)
#define RASTER3D_CELL_ELEMENT
int Rast3d_range_init(RASTER3D_Map *)
int Rast3d_read_ints(int, int, int *, int)
char * G_tempfile(void)
Returns a temporary file name.
#define RASTER3D_HAS_INDEX
#define RASTER3D_MIN(a, b)
#define RASTER3D_NO_COMPRESSION
RASTER3D_Region * Rast3d_window_ptr(void)
#define RASTER3D_READ_DATA
void Rast3d_get_nearest_neighbor_fun_ptr(void(**)())
Returns in nnFunPtr a pointer to Rast3d_nearest_neighbor () (cf.{g3d:G3d.nearestNeighbor}).
#define RASTER3D_DIRECTORY
const char * G_mapset(void)
Get current mapset name.
int g3d_tile_dimension[3]
#define RASTER3D_TILE_SAME_AS_FILE
int Rast3d_write_ints(int, int, const int *, int)
void G_warning(const char *,...) __attribute__((format(printf
void Rast3d_adjust_region(RASTER3D_Region *)
Computes an adjusts the resolutions in the region structure from the region boundaries and number of ...
int g3d_vertical_unit_default
char * G_store(const char *)
Copy string to allocated memory.
void * Rast3d_open_cell_new(const char *name, int typeIntern, int cache, RASTER3D_Region *region)
Opens new g3d-file with name in the current mapset. Tiles are stored in memory with type which must b...
resample_fn * resampleFun
#define RASTER3D_MAP_VERSION
void * Rast3d_open_cell_old(const char *name, const char *mapset, RASTER3D_Region *window, int typeIntern, int cache)
Opens existing g3d-file name in mapset. Tiles are stored in memory with type which must be any of FCE...
void Rast3d_mask_off(RASTER3D_Map *)
Turns off the mask for map. This is the default. Do not invoke this function after the first tile has...
void Rast3d_free(void *)
Same as free (ptr).