~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to lib/raster3d/test/test_put_get_value.c

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/*****************************************************************************
 
3
*
 
4
* MODULE:       Grass raster3d Library
 
5
* AUTHOR(S):    Soeren Gebbert, Braunschweig (GER) Jun 2011
 
6
*                       soerengebbert <at> googlemail <dot> com
 
7
*
 
8
* PURPOSE:      Unit and Integration tests
 
9
*
 
10
* COPYRIGHT:    (C) 2000 by the GRASS Development Team
 
11
*
 
12
*               This program is free software under the GNU General Public
 
13
*               License (>=v2). Read the file COPYING that comes with GRASS
 
14
*               for details.
 
15
*
 
16
*****************************************************************************/
 
17
#include <stdlib.h>
 
18
#include <string.h>
 
19
#include "test_raster3d_lib.h"
 
20
#include "grass/interpf.h"
 
21
 
 
22
static int test_put_get_value_dcell(void);
 
23
static int test_put_get_value_fcell(void);
 
24
static int test_put_get_value_resampling(void);
 
25
static int test_get_value_region(RASTER3D_Map *map, int cols, int rows, int depths);
 
26
static int test_resampling_dcell(RASTER3D_Map *map, double north, double east, double
 
27
                                 top, int col, int row, int depth, int fact);
 
28
static int test_resampling_fcell(RASTER3D_Map *map, double north, double east, double
 
29
                                 top, int col, int row, int depth, int fact);
 
30
 
 
31
/* *************************************************************** */
 
32
/* Perform the put-get value tests ******************************* */
 
33
/* *************************************************************** */
 
34
int unit_test_put_get_value()
 
35
{
 
36
    int sum = 0;
 
37
 
 
38
    G_message("\n++ Running raster3d put/get value unit tests ++");
 
39
 
 
40
    sum += test_put_get_value_dcell();
 
41
    sum += test_put_get_value_fcell();
 
42
    sum += test_put_get_value_resampling();
 
43
 
 
44
 
 
45
    if (sum > 0)
 
46
    G_warning("\n-- raster3d put/get value unit tests failure --");
 
47
    else
 
48
    G_message("\n-- raster3d put/get value unit tests finished successfully --");
 
49
 
 
50
    return sum;
 
51
}
 
52
 
 
53
/* *************************************************************** */
 
54
 
 
55
int test_put_get_value_dcell(void)
 
56
{
 
57
    int sum = 0;
 
58
    int x, y, z;
 
59
    DCELL value;
 
60
    DCELL value_ref;
 
61
 
 
62
    G_message("Testing DCELL put get value functions");
 
63
 
 
64
    double north, east, top;
 
65
    int col, row, depth;
 
66
 
 
67
    RASTER3D_Region region;
 
68
    RASTER3D_Map *map = NULL;
 
69
 
 
70
    /* We need to set up a specific region for the new raster3d map.
 
71
     * First we safe the default region. */
 
72
    Rast3d_get_window(&region);
 
73
 
 
74
    region.bottom = 0.0;
 
75
    region.top = 1000;
 
76
    region.south = 1000;
 
77
    region.north = 8500;
 
78
    region.west = 5000;
 
79
    region.east = 10000;
 
80
    region.rows = 15;
 
81
    region.cols = 10;
 
82
    region.depths = 5;
 
83
 
 
84
    Rast3d_adjust_region(&region);
 
85
 
 
86
    map = Rast3d_open_new_opt_tile_size("test_put_get_value_dcell", RASTER3D_USE_CACHE_XY, &region, DCELL_TYPE, 32);
 
87
 
 
88
    /* The window is the same as the map region ... of course */
 
89
    Rast3d_set_window_map(map, &region);
 
90
    /*
 
91
     ROWS
 
92
  1000 1500 2000 2500 3000 3500 4000 4500 5000 5500 6000 6500 7000 7500 8000 8500 north
 
93
    |....|....|....|....|....|....|....|....|....|....|....|....|....|....|....|
 
94
   15   14   13   12   11   10    9    8    7    6    5    4    3    2    1    0 region
 
95
 
 
96
    COLS
 
97
  5000 5500 6000 6500 7000 7500 8000 8500 9000 9500 10000 east
 
98
    |....|....|....|....|....|....|....|....|....|....|
 
99
    0    1    2    3    4    5    6    7    8    9   10 region
 
100
 
 
101
    DEPTHS
 
102
    0   200  400  600  800  1000  top
 
103
    |....|....|....|....|....|
 
104
    0    1    2    3    4    5 region
 
105
    */
 
106
 
 
107
    for(z = 0; z < region.depths; z++) {
 
108
        for(y = 0; y < region.rows; y++) { /* From the north to the south */
 
109
            for(x = 0; x < region.cols; x++) {
 
110
                value = -1;
 
111
                Rast3d_put_value(map, x, y, z, &value, DCELL_TYPE);
 
112
            }
 
113
        }
 
114
    }
 
115
 
 
116
    for(z = 0; z < region.depths; z++) {
 
117
        for(y = 0; y < region.rows; y++) { /* From the north to the south */
 
118
            for(x = 0; x < region.cols; x++) {
 
119
                /* Add cols, rows and depths and put this in the map */
 
120
                value = x + y + z;
 
121
                Rast3d_put_value(map, x, y, z, &value, DCELL_TYPE);
 
122
            }
 
123
        }
 
124
    }
 
125
 
 
126
 
 
127
    /* Reread the new open map and compare the expected results */
 
128
 
 
129
    G_message("Get the value of the upper left corner -> 0");
 
130
 
 
131
 
 
132
    col = row = depth = 0;
 
133
    north = region.north - region.ns_res * row;
 
134
    east = region.west + region.ew_res * col;
 
135
    top = region.bottom + region.tb_res * depth;
 
136
 
 
137
    sum += test_resampling_dcell(map, north, east, top, col, row, depth, 1);
 
138
 
 
139
 
 
140
    G_message("Get the value of x == y == z == 1 -> x + y + z == 3");
 
141
 
 
142
    col = row = depth = 1;
 
143
    north = region.north - region.ns_res * row;
 
144
    east = region.west + region.ew_res * col;
 
145
    top = region.bottom + region.tb_res * depth;
 
146
 
 
147
    sum += test_resampling_dcell(map, north, east, top, col, row, depth, 1);
 
148
 
 
149
    G_message("Get the value of x == 4 y == 3 z == 2 -> x + y + z = 9");
 
150
 
 
151
    col = 4;
 
152
    row = 3;
 
153
    depth = 2;
 
154
    north = region.north - region.ns_res * row;
 
155
    east = region.west + region.ew_res * col;
 
156
    top = region.bottom + region.tb_res * depth;
 
157
 
 
158
    sum += test_resampling_dcell(map, north, east, top, col, row, depth, 1);
 
159
 
 
160
 
 
161
    /* Write everything to the disk and reopen the map */
 
162
    Rast3d_flush_all_tiles(map);
 
163
    Rast3d_close(map);
 
164
    map = Rast3d_open_cell_old("test_put_get_value_dcell", G_mapset(), &region, DCELL_TYPE, RASTER3D_USE_CACHE_XY);
 
165
 
 
166
 
 
167
    G_message("Get the value of x == 9 y == 14 z == 4 -> x + y + z = 27");
 
168
 
 
169
    col = 9;
 
170
    row = 14;
 
171
    depth = 4;
 
172
    north = region.north - region.ns_res * row;
 
173
    east = region.west + region.ew_res * col;
 
174
    top = region.bottom + region.tb_res * depth;
 
175
 
 
176
    sum += test_resampling_dcell(map, north, east, top, col, row, depth, 1);
 
177
 
 
178
    G_message("Get the value of x == 10 y == 15 z == 5 -> x + y + z = NAN");
 
179
 
 
180
    col = 10;
 
181
    row = 15;
 
182
    depth = 5;
 
183
    north = region.north - region.ns_res * row;
 
184
    east = region.west + region.ew_res * col;
 
185
    top = region.bottom + region.tb_res * depth;
 
186
 
 
187
    Rast3d_get_region_value(map, north, east, top, &value, DCELL_TYPE);
 
188
    Rast3d_get_value(map, col, row, depth, &value_ref, DCELL_TYPE);
 
189
    /* Rast3d_get_value_region does not work with coordinates outside the region */
 
190
    printf("Value %g == %g\n", value, value_ref);
 
191
 
 
192
    if(value == 0 || value < 0 || value > 0) {
 
193
        G_message("Error in Rast3d_get_region_value");
 
194
        sum++;
 
195
    }
 
196
    if(value_ref == 0 || value_ref < 0 || value_ref > 0) {
 
197
        G_message("Error in Rast3d_get_value");
 
198
        sum++;
 
199
    }
 
200
 
 
201
    Rast3d_close(map);
 
202
 
 
203
    G_remove("grid3", "test_put_get_value_dcell");
 
204
 
 
205
    return sum;
 
206
}
 
207
 
 
208
/* *************************************************************** */
 
209
 
 
210
int test_put_get_value_fcell(void)
 
211
{
 
212
     int sum = 0;
 
213
    int x, y, z;
 
214
    FCELL value;
 
215
    FCELL value_ref;
 
216
 
 
217
    G_message("Testing FCELL put get value functions");
 
218
 
 
219
    double north, east, top;
 
220
    int col, row, depth;
 
221
 
 
222
    RASTER3D_Region region;
 
223
    RASTER3D_Map *map = NULL;
 
224
 
 
225
    /* We need to set up a specific region for the new raster3d map.
 
226
     * First we safe the default region. */
 
227
    Rast3d_get_window(&region);
 
228
 
 
229
    region.bottom = 0.0;
 
230
    region.top = 1000;
 
231
    region.south = 1000;
 
232
    region.north = 8500;
 
233
    region.west = 5000;
 
234
    region.east = 10000;
 
235
    region.rows = 15;
 
236
    region.cols = 10;
 
237
    region.depths = 5;
 
238
 
 
239
    Rast3d_adjust_region(&region);
 
240
 
 
241
    map = Rast3d_open_new_opt_tile_size("test_put_get_value_fcell", RASTER3D_USE_CACHE_XY, &region, FCELL_TYPE, 32);
 
242
 
 
243
    /* The window is the same as the map region ... of course */
 
244
    Rast3d_set_window_map(map, &region);
 
245
 
 
246
    for(z = 0; z < region.depths; z++) {
 
247
        for(y = 0; y < region.rows; y++) {
 
248
            for(x = 0; x < region.cols; x++) {
 
249
                /* Add cols, rows and depths and put this in the map */
 
250
                value = x + y + z;
 
251
                Rast3d_put_value(map, x, y, z, &value, FCELL_TYPE);
 
252
            }
 
253
        }
 
254
    }
 
255
 
 
256
    /* Write everything to the disk */
 
257
    Rast3d_flush_all_tiles(map);
 
258
    Rast3d_close(map);
 
259
 
 
260
    map = Rast3d_open_cell_old("test_put_get_value_fcell", G_mapset(), &region, DCELL_TYPE, RASTER3D_USE_CACHE_XY);
 
261
 
 
262
       /* Reread the map and compare the expected results */
 
263
 
 
264
    G_message("Get the value of the lower left corner -> 0");
 
265
 
 
266
    col = row = depth = 0;
 
267
    north = region.north - region.ns_res * row;
 
268
    east = region.west + region.ew_res * col;
 
269
    top = region.bottom + region.tb_res * depth;
 
270
 
 
271
    sum += test_resampling_fcell(map, north, east, top, col, row, depth, 1);
 
272
 
 
273
    G_message("Get the value of x == y == z == 1 -> x + y + z == 3");
 
274
 
 
275
    col = row = depth = 1;
 
276
    north = region.north - region.ns_res * row;
 
277
    east = region.west + region.ew_res * col;
 
278
    top = region.bottom + region.tb_res * depth;
 
279
 
 
280
    sum += test_resampling_fcell(map, north, east, top, col, row, depth, 1);
 
281
 
 
282
    G_message("Get the value of x == 4 y == 3 z == 2 -> x + y + z = 9");
 
283
 
 
284
    col = 4;
 
285
    row = 3;
 
286
    depth = 2;
 
287
    north = region.north - region.ns_res * row;
 
288
    east = region.west + region.ew_res * col;
 
289
    top = region.bottom + region.tb_res * depth;
 
290
 
 
291
    sum += test_resampling_fcell(map, north, east, top, col, row, depth, 1);
 
292
 
 
293
    G_message("Get the value of x == 9 y == 14 z == 4 -> x + y + z = 27");
 
294
 
 
295
    col = 9;
 
296
    row = 14;
 
297
    depth = 4;
 
298
    north = region.north - region.ns_res * row;
 
299
    east = region.west + region.ew_res * col;
 
300
    top = region.bottom + region.tb_res * depth;
 
301
 
 
302
    sum += test_resampling_fcell(map, north, east, top, col, row, depth, 1);
 
303
 
 
304
    G_message("Get the value of x == 10 y == 15 z == 5 -> x + y + z = NAN");
 
305
 
 
306
    col = 10;
 
307
    row = 15;
 
308
    depth = 5;
 
309
    north = region.north - region.ns_res * row;
 
310
    east = region.west + region.ew_res * col;
 
311
    top = region.bottom + region.tb_res * depth;
 
312
 
 
313
    Rast3d_get_region_value(map, north, east, top, &value, FCELL_TYPE);
 
314
    Rast3d_get_value(map, 10, 15, 5, &value_ref, FCELL_TYPE);
 
315
    /* Rast3d_get_value_region does not work with coordinates outside the region */
 
316
    printf("Value %g == %g\n", value, value_ref);
 
317
 
 
318
    if(value == 0 || value < 0 || value > 0) {
 
319
        G_message("Error in Rast3d_get_region_value");
 
320
        sum++;
 
321
    }
 
322
    if(value_ref == 0 || value_ref < 0 || value_ref > 0) {
 
323
        G_message("Error in Rast3d_get_value");
 
324
        sum++;
 
325
    }
 
326
 
 
327
    Rast3d_close(map);
 
328
 
 
329
    G_remove("grid3", "test_put_get_value_fcell");
 
330
 
 
331
    return sum;
 
332
}
 
333
 
 
334
/* *************************************************************** */
 
335
 
 
336
int test_put_get_value_resampling(void)
 
337
{
 
338
    int sum = 0;
 
339
    int x, y, z;
 
340
    DCELL value;
 
341
 
 
342
    G_message("Testing put get resample value functions");
 
343
 
 
344
    double north, east, top;
 
345
    int col, row, depth;
 
346
 
 
347
    RASTER3D_Region region;
 
348
    RASTER3D_Region window;
 
349
    RASTER3D_Map *map = NULL;
 
350
 
 
351
    /* We need to set up a specific region for the new raster3d map.
 
352
     * First we safe the default region. */
 
353
    Rast3d_get_window(&region);
 
354
 
 
355
    region.bottom = 0.0;
 
356
    region.top = 1000;
 
357
    region.south = 1000;
 
358
    region.north = 8500;
 
359
    region.west = 5000;
 
360
    region.east = 10000;
 
361
    region.rows = 15;
 
362
    region.cols = 10;
 
363
    region.depths = 5;
 
364
 
 
365
    Rast3d_adjust_region(&region);
 
366
 
 
367
    map = Rast3d_open_new_opt_tile_size("test_put_get_value_resample", RASTER3D_USE_CACHE_XY, &region, DCELL_TYPE, 32);
 
368
    /*
 
369
     ROWS
 
370
  1000 1500 2000 2500 3000 3500 4000 4500 5000 5500 6000 6500 7000 7500 8000 8500 north
 
371
    |....|....|....|....|....|....|....|....|....|....|....|....|....|....|....|
 
372
   15   14   13   12   11   10    9    8    7    6    5    4    3    2    1    0 region
 
373
    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |
 
374
   30   28   26   24   22   20   18   16   14   12   10    8    6    4    2    0 window
 
375
 
 
376
    COLS
 
377
  5000 5500 6000 6500 7000 7500 8000 8500 9000 9500 10000 east
 
378
    |....|....|....|....|....|....|....|....|....|....|
 
379
    0    1    2    3    4    5    6    7    8    9   10 region
 
380
    |    |    |    |    |    |    |    |    |    |    |
 
381
    0    2    4    6    8   10   12   14   16   18   20 window
 
382
    DEPTHS
 
383
    0   200  400  600  800  1000 top
 
384
    |....|....|....|....|....|
 
385
    0    1    2    3    4    5 region
 
386
    |    |    |    |    |    |
 
387
    0    2    4    6    8   10 window
 
388
    */
 
389
 
 
390
    for(z = 0; z < region.depths; z++) {
 
391
        for(y = 0; y < region.rows; y++) {  /* North to south */
 
392
            for(x = 0; x < region.cols; x++) {
 
393
                /* Add cols, rows and depths and put this in the map */
 
394
                value = x + y + z;
 
395
                Rast3d_put_double(map, x, y, z, value);
 
396
            }
 
397
        }
 
398
    }
 
399
 
 
400
    /* Write everything to the disk */
 
401
    Rast3d_flush_all_tiles(map);
 
402
    Rast3d_close(map);
 
403
 
 
404
    /* We modify the window for resampling tests */
 
405
    Rast3d_region_copy(&window, &region);
 
406
 
 
407
    /* Double the cols, rows and depths -> 8x resolution window */
 
408
    window.rows = 30;
 
409
    window.cols = 20;
 
410
    window.depths = 10;
 
411
 
 
412
    Rast3d_adjust_region(&window);
 
413
 
 
414
    map = Rast3d_open_cell_old("test_put_get_value_resample", G_mapset(), &region, DCELL_TYPE, RASTER3D_USE_CACHE_XY);
 
415
 
 
416
    /* The window has the 8x resolution as the map region */
 
417
    Rast3d_set_window_map(map, &window);
 
418
 
 
419
    /* Reread the map and compare the expected results */
 
420
 
 
421
    G_message("Get the value of the upper left corner -> 0");
 
422
 
 
423
    col = row = depth = 0;
 
424
    north = region.north - region.ns_res * row;
 
425
    east = region.west + region.ew_res * col;
 
426
    top = region.bottom + region.tb_res * depth;
 
427
 
 
428
    sum += test_resampling_dcell(map, north, east, top, col, row, depth, 2);
 
429
 
 
430
    G_message("Get the value of x == y == z == 1 -> x + y + z == 3");
 
431
 
 
432
 
 
433
    col = row = depth = 1;
 
434
    north = region.north - region.ns_res * row;
 
435
    east = region.west + region.ew_res * col;
 
436
    top = region.bottom + region.tb_res * depth;
 
437
 
 
438
    sum += test_resampling_dcell(map, north, east, top, col, row, depth, 2);
 
439
 
 
440
    G_message("Get the value of x == 7 y == 9 z == 3 -> x + y + z == 19");
 
441
 
 
442
    col = 7;
 
443
    row = 9;
 
444
    depth = 3;
 
445
    north = region.north - region.ns_res * row;
 
446
    east = region.west + region.ew_res * col;
 
447
    top = region.bottom + region.tb_res * depth;
 
448
 
 
449
    sum += test_resampling_dcell(map, north, east, top, col, row, depth, 2);
 
450
 
 
451
    G_message("Get the value of x == 9 y == 14 z == 4 -> x + y + z == 27");
 
452
 
 
453
    col = 9;
 
454
    row = 14;
 
455
    depth = 4;
 
456
    north = region.north - region.ns_res * row;
 
457
    east = region.west + region.ew_res * col;
 
458
    top = region.bottom + region.tb_res * depth;
 
459
 
 
460
    sum += test_resampling_dcell(map, north, east, top, col, row, depth, 2);
 
461
 
 
462
    sum += test_get_value_region(map, region.cols, region.rows, region.depths);
 
463
 
 
464
    Rast3d_close(map);
 
465
 
 
466
    G_remove("grid3", "test_put_get_value_resample");
 
467
 
 
468
    return sum;
 
469
}
 
470
 
 
471
/* *************************************************************** */
 
472
 
 
473
int test_resampling_dcell(RASTER3D_Map *map, double north, double east, double top, int col, int row, int depth, int fact)
 
474
{
 
475
    int sum = 0;
 
476
    DCELL value;
 
477
    DCELL value_ref;
 
478
    DCELL value_reg;
 
479
    DCELL value_win;
 
480
 
 
481
    Rast3d_get_region_value(map, north, east, top, &value, DCELL_TYPE);
 
482
    Rast3d_get_window_value(map, north, east, top, &value_win, DCELL_TYPE);
 
483
    Rast3d_get_value(map, col * fact, row * fact, depth * fact, &value_ref, DCELL_TYPE);
 
484
    Rast3d_get_value_region(map, col, row, depth, &value_reg, DCELL_TYPE);
 
485
    printf("Value %g == %g == %g == %g\n", value, value_win, value_ref, value_reg);
 
486
 
 
487
    if(value != col + row + depth) {
 
488
        G_message("Error in Rast3d_get_region_value");
 
489
        sum++;
 
490
    }
 
491
    if(value_win != col + row + depth) {
 
492
        G_message("Error in Rast3d_get_window_value");
 
493
        sum++;
 
494
    }
 
495
    if(value_ref != col + row + depth) {
 
496
        G_message("Error in Rast3d_get_value");
 
497
        sum++;
 
498
    }
 
499
    if(value_reg != col + row + depth) {
 
500
        G_message("Error in Rast3d_get_value_region");
 
501
        sum++;
 
502
    }
 
503
 
 
504
    return sum;
 
505
}
 
506
 
 
507
/* *************************************************************** */
 
508
 
 
509
int test_resampling_fcell(RASTER3D_Map *map, double north, double east, double top, int col, int row, int depth, int fact)
 
510
{
 
511
    int sum = 0;
 
512
    FCELL value;
 
513
    FCELL value_ref;
 
514
    FCELL value_reg;
 
515
    FCELL value_win;
 
516
 
 
517
    Rast3d_get_region_value(map, north, east, top, &value, FCELL_TYPE);
 
518
    Rast3d_get_window_value(map, north, east, top, &value_win, FCELL_TYPE);
 
519
    Rast3d_get_value(map, col * fact, row * fact, depth * fact, &value_ref, FCELL_TYPE);
 
520
    Rast3d_get_value_region(map, col, row, depth, &value_reg, FCELL_TYPE);
 
521
    printf("Value %g == %g == %g == %g\n", value, value_win, value_ref, value_reg);
 
522
 
 
523
    if(value != col + row + depth) {
 
524
        G_message("Error in Rast3d_get_region_value");
 
525
        sum++;
 
526
    }
 
527
    if(value_win != col + row + depth) {
 
528
        G_message("Error in Rast3d_get_window_value");
 
529
        sum++;
 
530
    }
 
531
    if(value_ref != col + row + depth) {
 
532
        G_message("Error in Rast3d_get_value");
 
533
        sum++;
 
534
    }
 
535
    if(value_reg != col + row + depth) {
 
536
        G_message("Error in Rast3d_get_value_region");
 
537
        sum++;
 
538
    }
 
539
 
 
540
    return sum;
 
541
}
 
542
 
 
543
/* *************************************************************** */
 
544
 
 
545
int test_get_value_region(RASTER3D_Map *map, int cols, int rows, int depths)
 
546
{
 
547
    int sum = 0;
 
548
    FCELL fvalue1 = 0.0;
 
549
    FCELL fvalue2 = 0.0;
 
550
    DCELL dvalue1 = 0.0;
 
551
    DCELL dvalue2 = 0.0;
 
552
 
 
553
    /* Test for correct Null value */
 
554
    Rast3d_get_value_region(map, -1, -1, -1, &fvalue1, FCELL_TYPE);
 
555
    Rast3d_get_value_region(map, cols, rows, depths, &fvalue2, FCELL_TYPE);
 
556
    Rast3d_get_value_region(map, -1, -1, -1, &dvalue1, DCELL_TYPE);
 
557
    Rast3d_get_value_region(map, cols, rows, depths, &dvalue2, DCELL_TYPE);
 
558
    printf("Value %g == %g == %g == %g\n", fvalue1, fvalue2, dvalue1, dvalue2);
 
559
 
 
560
    if(!Rast_is_f_null_value(&fvalue1)) {
 
561
        G_message("Error in Rast3d_get_value_region");
 
562
        sum++;
 
563
    }
 
564
    if(!Rast_is_f_null_value(&fvalue2)) {
 
565
        G_message("Error in Rast3d_get_value_region");
 
566
        sum++;
 
567
    }
 
568
    if(!Rast_is_d_null_value(&dvalue1)) {
 
569
        G_message("Error in Rast3d_get_value_region");
 
570
        sum++;
 
571
    }
 
572
    if(!Rast_is_d_null_value(&dvalue2)) {
 
573
        G_message("Error in Rast3d_get_value_region");
 
574
        sum++;
 
575
    }
 
576
 
 
577
    return sum;
 
578
}