[GRASS-SVN] r62858 - in grass/branches/releasebranch_7_0: include/defs lib/raster3d lib/raster3d/test lib/raster3d/testsuite raster3d/r3.neighbors/test_suite

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Nov 22 13:54:43 PST 2014


Author: huhabla
Date: 2014-11-22 13:54:43 -0800 (Sat, 22 Nov 2014)
New Revision: 62858

Added:
   grass/branches/releasebranch_7_0/lib/raster3d/testsuite/
   grass/branches/releasebranch_7_0/lib/raster3d/testsuite/raster3d_lib_test.py
Removed:
   grass/branches/releasebranch_7_0/lib/raster3d/testsuite/raster3d_lib_test.py
Modified:
   grass/branches/releasebranch_7_0/include/defs/raster3d.h
   grass/branches/releasebranch_7_0/lib/raster3d/raster3d_intern.h
   grass/branches/releasebranch_7_0/lib/raster3d/raster3dlib.dox
   grass/branches/releasebranch_7_0/lib/raster3d/region.c
   grass/branches/releasebranch_7_0/lib/raster3d/test/test.raster3d.lib.html
   grass/branches/releasebranch_7_0/lib/raster3d/test/test_coordinate_transform.c
   grass/branches/releasebranch_7_0/lib/raster3d/test/test_main.c
   grass/branches/releasebranch_7_0/lib/raster3d/test/test_put_get_value.c
   grass/branches/releasebranch_7_0/lib/raster3d/test/test_put_get_value_large_file.c
   grass/branches/releasebranch_7_0/lib/raster3d/test/test_raster3d_lib.h
   grass/branches/releasebranch_7_0/lib/raster3d/test/test_tools.c
   grass/branches/releasebranch_7_0/lib/raster3d/window.c
   grass/branches/releasebranch_7_0/raster3d/r3.neighbors/test_suite/test.r3.neighbors.sh
Log:
raster3d library: backport of r61282, r61285 and r61287 to fix wrong northern coordinate to row conversion

Modified: grass/branches/releasebranch_7_0/include/defs/raster3d.h
===================================================================
--- grass/branches/releasebranch_7_0/include/defs/raster3d.h	2014-11-22 12:12:00 UTC (rev 62857)
+++ grass/branches/releasebranch_7_0/include/defs/raster3d.h	2014-11-22 21:54:43 UTC (rev 62858)
@@ -125,12 +125,12 @@
 int Rast3d_key_get_double(struct Key_Value *, const char *, double *);
 int Rast3d_key_get_string(struct Key_Value *, const char *, char **);
 int Rast3d_key_get_value(struct Key_Value *, const char *, char *, char *, int,
-		    int, int *);
+            int, int *);
 int Rast3d_key_set_int(struct Key_Value *, const char *, const int *);
 int Rast3d_key_set_double(struct Key_Value *, const char *, const double *);
 int Rast3d_key_set_string(struct Key_Value *, const char *, char *const *);
 int Rast3d_key_set_value(struct Key_Value *, const char *, const char *,
-		    const char *, int, int, const int *);
+            const char *, int, int, const int *);
 /* long.c */
 int Rast3d_long_encode(long *, unsigned char *, int);
 void Rast3d_long_decode(unsigned char *, long *, int, int);
@@ -183,13 +183,13 @@
 /* param.c */
 void Rast3d_set_standard3d_input_params(void);
 int Rast3d_get_standard3d_params(int *, int *, int *, int *, int *,
-			    int *, int *, int *, int *, int *);
+                int *, int *, int *, int *, int *);
 void Rast3d_set_window_params(void);
 char *Rast3d_get_window_params(void);
 
 /* range.c */
 void Rast3d_range_update_from_tile(RASTER3D_Map *, const void *, int, int, int, int,
-			      int, int, int, int);
+                  int, int, int, int);
 int Rast3d_read_range(const char *, const char *, struct FPRange *);
 int Rast3d_range_load(RASTER3D_Map *);
 void Rast3d_range_min_max(RASTER3D_Map *, double *, double *);
@@ -208,6 +208,7 @@
 int Rast3d_read_region_map(const char *, const char *, RASTER3D_Region *);
 int Rast3d_is_valid_location(RASTER3D_Region *, double, double, double);
 void Rast3d_location2coord(RASTER3D_Region *, double, double, double, int *, int *, int *);
+void Rast3d_location2coord_double(RASTER3D_Region *, double, double, double, double *, double *, double *);
 void Rast3d_location2coord2(RASTER3D_Region *, double, double, double, int *, int *, int *);
 void Rast3d_coord2location(RASTER3D_Region *, double, double, double, double *, double *, double *);
 /* resample.c */
@@ -219,12 +220,12 @@
 /* volume.c */
 void Rast3d_get_volume_a(void *, double[2][2][2][3], int, int, int, void *, int);
 void Rast3d_get_volume(void *, double, double, double, double, double, double,
-		   double, double, double, double, double, double, int, int,
-		   int, void *, int);
+           double, double, double, double, double, double, int, int,
+           int, void *, int);
 void Rast3d_get_aligned_volume(void *, double, double, double, double, double,
-			  double, int, int, int, void *, int);
+              double, int, int, int, void *, int);
 void Rast3d_make_aligned_volume_file(void *, const char *, double, double, double,
-			       double, double, double, int, int, int);
+                   double, double, double, int, int, int);
 /* window.c */
 void Rast3d_get_value(RASTER3D_Map *, int, int, int, void *, int);
 float Rast3d_get_float(RASTER3D_Map *, int, int, int);
@@ -244,33 +245,33 @@
 /* int Rast3d_writeWindow (RASTER3D_Region *, char *); */
 /* getblock.c */
 void Rast3d_get_block_nocache(RASTER3D_Map *, int, int, int, int, int, int, void *,
-			 int);
+             int);
 void Rast3d_get_block(RASTER3D_Map *, int, int, int, int, int, int, void *, int);
 
 /* header.c */
 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 *);
+           double *, double *, double *, int *, int *, int *,
+           double *, double *, double *, int *, int *, int *, int *,
+           int *, int *, int *, int *, int *, int *, int *, char **, int *, int *);
 int Rast3d_write_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);
+            double, double, int, int, int, double, double, double,
+            int, int, int, int, int, int, int, int, int, int, int,
+            char *, int, int);
 int Rast3d_rewrite_header(RASTER3D_Map * map);
 int Rast3d_cache_size_encode(int, int);
 int Rast3d__compute_cache_size(RASTER3D_Map *, int);
 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);
+           int, int, int, int, int, int, int, double, double, double,
+           double, double, double, int, int, int, double, double,
+           double, char *, int, int);
 /* headerinfo.c */
 void Rast3d_get_coords_map(RASTER3D_Map *, int *, int *, int *);
 void Rast3d_get_coords_map_window(RASTER3D_Map *, int *, int *, int *);
 void Rast3d_get_nof_tiles_map(RASTER3D_Map *, int *, int *, int *);
 void Rast3d_get_region_map(RASTER3D_Map *, double *, double *, double *, double *,
-		      double *, double *);
+              double *, double *);
 void Rast3d_get_window_map(RASTER3D_Map *, double *, double *, double *, double *,
-		      double *, double *);
+              double *, double *);
 void Rast3d_get_tile_dimensions_map(RASTER3D_Map *, int *, int *, int *);
 int Rast3d_tile_type_map(RASTER3D_Map *);
 int Rast3d_file_type_map(RASTER3D_Map *);
@@ -317,13 +318,13 @@
 void Rast3d_tile_coord_origin(RASTER3D_Map *, int, int, int, int *, int *, int *);
 void Rast3d_tile_index_origin(RASTER3D_Map *, int, int *, int *, int *);
 void Rast3d_coord2tile_coord(RASTER3D_Map *, int, int, int, int *, int *, int *, int *,
-			 int *, int *);
+             int *, int *);
 void Rast3d_coord2tile_index(RASTER3D_Map *, int, int, int, int *, int *);
 int Rast3d_coord_in_range(RASTER3D_Map *, int, int, int);
 int Rast3d_tile_index_in_range(RASTER3D_Map *, int);
 int Rast3d_tile_in_range(RASTER3D_Map *, int, int, int);
 int Rast3d_compute_clipped_tile_dimensions(RASTER3D_Map *, int, int *, int *, int *,
-				     int *, int *, int *);
+                     int *, int *, int *);
 
 /* tilenull.c */
 void Rast3d_set_null_tile_type(RASTER3D_Map *, void *, int);

Modified: grass/branches/releasebranch_7_0/lib/raster3d/raster3d_intern.h
===================================================================
--- grass/branches/releasebranch_7_0/lib/raster3d/raster3d_intern.h	2014-11-22 12:12:00 UTC (rev 62857)
+++ grass/branches/releasebranch_7_0/lib/raster3d/raster3d_intern.h	2014-11-22 21:54:43 UTC (rev 62858)
@@ -1,3 +1,6 @@
+#ifndef RASTER3D_INTERN_H
+#define RASTER3D_INTERN_H
+
 #include <grass/raster3d.h>
 #include <grass/gis.h>
 
@@ -77,3 +80,43 @@
 #define RASTER3D_REGION_EWRES "e-w resol"
 #define RASTER3D_REGION_NSRES "n-s resol"
 #define RASTER3D_REGION_TBRES "t-b resol"
+
+/* Coordinates to index conversion will return double.
+ * Use floor() and integer casting to receive col,row and depth
+ *
+ * double cold = EASTERN_TO_COL(east, region)
+ * int col = (int)floor(cold)
+ *
+ */
+#define EASTERN_TO_COL(east, region) (east - region->west) / (region->ew_res);
+#define NORTHERN_TO_ROW(north, region) (region->north - north) / (region->ns_res);
+#define TOP_TO_DEPTH(top, region) (top - region->bottom) / (region->tb_res);
+/* Location coordinates to index coordinates
+ * region is a pointer to the RASTER3D_Region structure
+ * north, east and top are double values
+ * x, y, and z are pointer to double values
+ */
+#define LOCATION_TO_COORD(region, north, east, top, x, y, z) \
+    { \
+        *x = EASTERN_TO_COL(east, region) \
+        *y = NORTHERN_TO_ROW(north, region) \
+        *z = TOP_TO_DEPTH(top, region) \
+    }
+
+/* Row to north, col to east and depth to top macros
+ * region is a pointer to the RASTER3D_Region structure
+ * north, east and top are pointer to double values,
+ * x, y and z are double values
+ */
+#define COL_TO_EASTERN(region, x)  region->west + x * region->ew_res;
+#define ROW_TO_NORTHERN(region, y) region->north - y * region->ns_res;
+#define DEPTH_TO_TOP(region, z)    region->bottom + z * region->tb_res;
+#define COORD_TO_LOCATION(region, x, y, z, north, east, top) \
+    { \
+        *east  = COL_TO_EASTERN(region, x) \
+        *north = ROW_TO_NORTHERN(region, y) \
+        *top   = DEPTH_TO_TOP(region, z) \
+    }
+
+
+#endif

Modified: grass/branches/releasebranch_7_0/lib/raster3d/raster3dlib.dox
===================================================================
--- grass/branches/releasebranch_7_0/lib/raster3d/raster3dlib.dox	2014-11-22 12:12:00 UTC (rev 62857)
+++ grass/branches/releasebranch_7_0/lib/raster3d/raster3dlib.dox	2014-11-22 21:54:43 UTC (rev 62858)
@@ -3,7 +3,7 @@
      by M. Neteler 5/2004, 8/2005
   -->
 
-<i>TODO: Update for this page for GRASS 7.</i>
+<i>TODO: Update for this page for GRASS 7, most of the function names have been changed from camel case to gnu underscore style.</i>
 
 \tableofcontents
 
@@ -11,9 +11,16 @@
 
 The 3D Raster Volume Library is used for the <tt>r3.*</tt> and vector
 volume tools. The library uses a tile cache based approach to store
-floating point values in abritrary order in a volume. The coordinate
+floating point values in arbitrary order in a volume. The coordinate
 system of a volume is column and row compatible to the raster library
 and counts from the bottom to the top of the cube.
+<P>
+Random reading and writing is supported until are tiles are flushed to the disk.
+In case the tiles are written to the disk, random reading is still supported.
+<P>
+The size of the tile cache in memory can be set in bytes using the environmental variable  RASTER3D_MAX_CACHE_SIZE.
+Default size is 16777216 bytes.The number of tiles hold in memory can be specified with the environmental variable
+RASTER3D_DEFAULT_CACHE_SIZE. Default is 1000.
 
 \image html "r3_volume_layout.png" "The volume coordinate system and tile layout of the 3D Raster Library"
 
@@ -29,7 +36,7 @@
         color file (color)
         categories file (cats)
         range file (range)
-        timestamp file /* not yet implemented */
+        timestamp file
         cell file (cell)
         header file (cellhd)
         a directory containing display files (dsp)
@@ -41,7 +48,7 @@
 
 <P>
 Note: color, categories, and the range can be used in the same way as in <EM>2d</EM> 
-GRASS with the exception of reading and writng. <EM>3d</EM> read and write
+GRASS with the exception of reading and writing. <EM>3d</EM> read and write
 functions have to be used for this purpose.
 
 
@@ -100,6 +107,11 @@
 
 \section Tile_Data_Compression Tile Data Compression
 
+NOTE: RLE compression was removed because of error-prone implementation.
+De-compression is still available for backward compatibility.
+
+Default compression is now zip.
+
 <P>
 There are three methods of compression provided. The compression
 methods can either be those defined by default, set by environment
@@ -107,7 +119,7 @@
 
 \verbatim 
         Precision
-        RLE
+        zlib
 \endverbatim
 
 <P>
@@ -117,15 +129,9 @@
 effective way to achieve good compression.
 
 <P>
-RLE takes advantage of possible repetitions of the
-exponents and the NULL-bit structure. Using RLE does not significantly
-increase the running time. If for some tile the non-RLEed version is
-smaller in size, RLE is not used for this tile.
+The default and suggested setting is to use precision and zlib.
 
 <P>
-The default and suggested setting is to use precision and RLE. 
-
-<P>
 Additional compression is achieved by storing the extra NULL-bit in a
 separate bit-array. Using this scheme NULL-values need not actually be
 represented in the array of cell values. This array is stored together
@@ -159,13 +165,13 @@
 coordinates. The corresponding functions are
 
 <P>
-int Rast3d_getValue() 
+int Rast3d_get_value()
 
 <P>
 and
 
 <P>
-int Rast3d_putValue() 
+int Rast3d_put_value()
 
 <P>
 and their corresponding typed versions.
@@ -177,7 +183,7 @@
 explicitly requested.
 <BR>
 <P>
-If the map is new <TT>Rast3d_getValue()</TT> can be used even if the tile which
+If the map is new <TT>Rast3d_get_value()</TT> can be used even if the tile which
 contains the cell has already been flushed to the data file. In this case the
 tile is simply read back into the memory-cache from the data file.
 <BR>
@@ -196,7 +202,7 @@
 <P>
 As an example consider the case where the data is stored in the file with double
 precision and the tiles are stored in memory in single precision.  Then using
-<TT>Rast3d_getValue()</TT> will actually return a double precision number whose precision
+<TT>Rast3d_get_value()</TT> will actually return a double precision number whose precision
 is only 23 bits.  It is therefore a good idea to use the types in the memory
 consistently.
 <BR>
@@ -302,12 +308,12 @@
     double east, west;
     double top, bottom;
   
-    int rows, cols, depths;/* data dimensions in cells */
+    int rows, cols, depths; // data dimensions in cells
 
     double ns_res, ew_res, tb_res;
 
-    int proj;  /* Projection (see gis.h) */
-    int zone;  /* Projection zone (see gis.h) */
+    int proj;  // Projection (see gis.h)
+    int zone;  // Projection zone (see gis.h)
 
 } RASTER3D_Region;
 \endverbatim
@@ -389,7 +395,7 @@
 \section Include_File Include File
 
 <P>
-Exported RASTER3D constants and structures can be found in <EM>G3d.h</EM>.
+Exported RASTER3D constants and structures can be found in <EM>raster3d.h</EM>.
 
 <P>
 
@@ -478,7 +484,10 @@
 <P>
 
 \subsection Toggling_RLE_compression Toggling RLE compression
+NOTE: RLE compression is not used any longer, the RLE code is still present to assure backward compatibility.
+G_zlib_write() and G_zlib_read() are used for compression now.
 
+
 <P>
 This value specifies whether RLE compression should be used (in addition to
 precision).
@@ -612,15 +621,15 @@
 <P>
 \verbatim
 void Rast3d_set_unit (map, unit)
-        RASTER3d_Map; /* the map */
-        char *unit; /* The data unit description */ 
+        RASTER3d_Map; // the map
+        char *unit; // The data unit description
 
 void Rast3d_set_vertical_unit (map, unit)
-        RASTER3d_Map; /* the map */
-        char *unit;  /* Use the standard from units.c in lib/gis */
+        RASTER3d_Map; // the map
+        char *unit;  // Use the standard from units.c in lib/gis
 void Rast3d_set_vertical_unit2 (map, unit)
-        RASTER3d_Map; /* the map */
-        int unit; /* defined in gis.h */
+        RASTER3d_Map; // the map
+        int unit; // defined in gis.h
 \endverbatim
 
 \section Error_Handling Error Handling: Setting the error function
@@ -740,7 +749,25 @@
 Returns 1 ... if successful, 0 ...  otherwise.
 
 <P>
+void *Rast3d_open_new_opt_tile_size(const char *name, int cache, RASTER3D_Region * region, int type, int maxSize)
 
+Opens new g3d-file with <em>name</em> in the current mapset. This method tries to compute
+optimal tile size based on the number of rows, cols and depths and the maximum allowed tile size in KB.
+Tiles are stored in memory using RASTER3D_TILE_SAME_AS_FILE method. <em>cache</em> specifies the
+cache-mode used and must be either RASTER3D_NO_CACHE, RASTER3D_USE_CACHE_DEFAULT,
+RASTER3D_USE_CACHE_X, RASTER3D_USE_CACHE_Y, RASTER3D_USE_CACHE_Z,
+RASTER3D_USE_CACHE_XY, RASTER3D_USE_CACHE_XZ, RASTER3D_USE_CACHE_YZ,
+RASTER3D_USE_CACHE_XYZ, the result of <tt>Rast3d_cache_size_encode ()</tt>
+(cf.{g3d:G3d.cacheSizeEncode}), or any positive integer which
+specifies the number of tiles buffered in the cache.  <em>region</em> specifies
+the 3d region.
+The map is created using the <em>type</em> which must be of FCELL_TYPE or DCELL_TYPE.
+<P>
+Returns a pointer to the cell structure ... if successful,
+NULL ... otherwise.
+
+<P>
+
 \subsection Reading_and_Writing_Tiles Reading and Writing Tiles
 
 <P>
@@ -960,7 +987,7 @@
 
 <P>
 If this tile has already been written before the write request is ignored.
-  If the tile was never referred to before the invokation of Rast3d_flushTile, a
+  If the tile was never referred to before the invocation of Rast3d_flushTile, a
   tile filled with NULL-values is written.
 
 <P>

Modified: grass/branches/releasebranch_7_0/lib/raster3d/region.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/raster3d/region.c	2014-11-22 12:12:00 UTC (rev 62857)
+++ grass/branches/releasebranch_7_0/lib/raster3d/region.c	2014-11-22 21:54:43 UTC (rev 62858)
@@ -1,16 +1,15 @@
 #include <stdio.h>
+#include <math.h>
 
-#include <grass/gis.h>
 #include <grass/raster.h>
-#include <grass/raster3d.h>
-
 #include "raster3d_intern.h"
 
+
 /*---------------------------------------------------------------------------*/
 
 
 /*!
- * \brief 
+ * \brief
  *
  *  Returns in <em>region2d</em> the <em>2d</em> portion of <em>region3d</em>.
  *
@@ -37,7 +36,7 @@
 }
 
 /*!
- * \brief 
+ * \brief
  *
  *  Returns in <em>region2d</em> the <em>2d</em> portion of <em>region3d</em>.
  *
@@ -75,7 +74,7 @@
 
 
 /*!
- * \brief 
+ * \brief
  *
  * Replaces the <em>2d</em> portion of <em>region3d</em> with the
  * values stored in <em>region2d</em>.
@@ -104,7 +103,7 @@
 }
 
 /*!
- * \brief 
+ * \brief
  *
  * Replaces the <em>2d</em> portion of <em>region3d</em> with the
  * values stored in <em>region2d</em>.
@@ -140,7 +139,7 @@
 
 
 /*!
- * \brief 
+ * \brief
  *
  * Computes an adjusts the resolutions in the region structure from the region
  * boundaries and number of cells per dimension.
@@ -158,7 +157,7 @@
     Rast3d_region_from_to_cell_head(&region2d, region);
 
     if (region->depths <= 0)
-	Rast3d_fatal_error("Rast3d_adjust_region: depths <= 0");
+    Rast3d_fatal_error("Rast3d_adjust_region: depths <= 0");
     region->tb_res = (region->top - region->bottom) / region->depths;
 }
 
@@ -166,7 +165,7 @@
 
 
 /*!
- * \brief 
+ * \brief
  *
  * Computes an adjusts the number of cells per dimension in the region
  * structure from the region boundaries and resolutions.
@@ -184,19 +183,19 @@
     Rast3d_region_from_to_cell_head(&region2d, region);
 
     if (region->tb_res <= 0)
-	Rast3d_fatal_error("Rast3d_adjust_region_res: tb_res <= 0");
+    Rast3d_fatal_error("Rast3d_adjust_region_res: tb_res <= 0");
 
     region->depths = (region->top - region->bottom + region->tb_res / 2.0) /
-	region->tb_res;
+    region->tb_res;
     if (region->depths == 0)
-	region->depths = 1;
+    region->depths = 1;
 }
 
 /*---------------------------------------------------------------------------*/
 
 
 /*!
- * \brief 
+ * \brief
  *
  * Copies the values of <em>regionSrc</em> into <em>regionDst</em>.
  *
@@ -207,23 +206,23 @@
 
 void Rast3d_region_copy(RASTER3D_Region * regionDest, RASTER3D_Region * regionSrc)
 {
-	regionDest->proj = regionSrc->proj;
-	regionDest->zone = regionSrc->zone;
+    regionDest->proj = regionSrc->proj;
+    regionDest->zone = regionSrc->zone;
 
-	regionDest->north = regionSrc->north;
-	regionDest->south = regionSrc->south;
-	regionDest->east = regionSrc->east;
-	regionDest->west = regionSrc->west;
-	regionDest->top = regionSrc->top;
-	regionDest->bottom = regionSrc->bottom;
+    regionDest->north = regionSrc->north;
+    regionDest->south = regionSrc->south;
+    regionDest->east = regionSrc->east;
+    regionDest->west = regionSrc->west;
+    regionDest->top = regionSrc->top;
+    regionDest->bottom = regionSrc->bottom;
 
-	regionDest->rows = regionSrc->rows;
-	regionDest->cols = regionSrc->cols;
-	regionDest->depths = regionSrc->depths;
+    regionDest->rows = regionSrc->rows;
+    regionDest->cols = regionSrc->cols;
+    regionDest->depths = regionSrc->depths;
 
-	regionDest->ns_res = regionSrc->ns_res;
-	regionDest->ew_res = regionSrc->ew_res;
-	regionDest->tb_res = regionSrc->tb_res;
+    regionDest->ns_res = regionSrc->ns_res;
+    regionDest->ew_res = regionSrc->ew_res;
+    regionDest->tb_res = regionSrc->tb_res;
 }
 
 
@@ -236,11 +235,11 @@
     char xname[GNAME_MAX], xmapset[GMAPSET_MAX];
 
     if (G_name_is_fully_qualified(name, xname, xmapset))
-	Rast3d_filename(fullName, RASTER3D_HEADER_ELEMENT, xname, xmapset);
+    Rast3d_filename(fullName, RASTER3D_HEADER_ELEMENT, xname, xmapset);
     else {
-	if (!mapset || !*mapset)
-	    mapset = G_find_raster3d(name, "");
-	Rast3d_filename(fullName, RASTER3D_HEADER_ELEMENT, name, mapset);
+    if (!mapset || !*mapset)
+        mapset = G_find_raster3d(name, "");
+    Rast3d_filename(fullName, RASTER3D_HEADER_ELEMENT, name, mapset);
     }
     return Rast3d_read_window(region, fullName);
 }
@@ -249,12 +248,12 @@
 
 
 /*!
- * \brief 
+ * \brief
  *
- *  Returns 1 if region-coordinates <em>(north, west, bottom)</em> are
+ *  Returns 1 if region-coordinates <em>(north, east, top)</em> are
  * inside the region of <em>map</em>. Returns 0 otherwise.
  *
- *  \param REgion
+ *  \param region
  *  \param north
  *  \param east
  *  \param top
@@ -264,20 +263,20 @@
 int Rast3d_is_valid_location(RASTER3D_Region *region, double north, double east, double top)
 {
     return ((north >= region->south) && (north <= region->north) &&
-	    (east >= region->west) && (east <= region->east) &&
-	    (((top >= region->bottom) && (top <= region->top)) ||
-	     ((top <= region->bottom) && (top >= region->top))));
+        (east >= region->west) && (east <= region->east) &&
+        (((top >= region->bottom) && (top <= region->top)) ||
+         ((top <= region->bottom) && (top >= region->top))));
 }
 
 /*---------------------------------------------------------------------------*/
 
 /*!
- * \brief 
+ * \brief
  *
  *  Converts region-coordinates <em>(north, east,
  *  top)</em> into cell-coordinates <em>(x, y, z)</em>.
  *
- *  \param map
+ *  \param region
  *  \param north
  *  \param east
  *  \param top
@@ -289,34 +288,52 @@
 
 void
 Rast3d_location2coord(RASTER3D_Region *region, double north, double east, double top,
-		   int *x, int *y, int *z)
+           int *x, int *y, int *z)
 {
     double col, row, depth;
-    
-    col = (east - region->west) / (region->east -
-				      region->west) * (double)(region->cols);
-    row = (north - region->south) / (region->north -
-					region->south) * (double)(region->rows);
-    depth = (top - region->bottom) / (region->top -
-				       region->bottom) * (double)(region->depths);
-    
-    *x = (int)col;
-    /* Adjust row to start at the northern edge*/
-    *y = region->rows - (int)row - 1;
-    *z = (int)depth;
-        
-    G_debug(4, "Rast3d_location2coord x %i y %i z %i\n", *x, *y, *z);
+    LOCATION_TO_COORD(region, north, east, top, &col, &row, &depth);
+
+    *x = (int)floor(col);
+    *y = (int)floor(row);
+    *z = (int)floor(depth);
 }
 
+/*!
+ * \brief
+ *
+ *  Converts region-coordinates <em>(north, east,
+ *  top)</em> into cell-coordinates <em>(x, y, z)</em>.
+ *
+ * <b>Note:</b> The results are <i>double</i> numbers. Casting them to
+ * <i>int</i> will give the column, row and depth number.
+ *
+ *  \param region
+ *  \param north
+ *  \param east
+ *  \param top
+ *  \param x
+ *  \param y
+ *  \param z
+ *  \return void
+ */
 
+void
+Rast3d_location2coord_double(RASTER3D_Region *region, double north, double east, double top,
+           double *x, double *y, double *z)
+{
+    LOCATION_TO_COORD(region, north, east, top, x, y, z);
+
+    G_debug(4, "Rast3d_location2coord_double x %f y %f z %f\n", *x, *y, *z);
+}
+
 /*!
- * \brief 
+ * \brief
  *
  *  Converts region-coordinates <em>(north, east,
  *  top)</em> into cell-coordinates <em>(x, y, z)</em>.
  *  This function calls Rast3d_fatal_error in case location is not in window.
  *
- *  \param map
+ *  \param region
  *  \param north
  *  \param east
  *  \param top
@@ -328,38 +345,40 @@
 
 void
 Rast3d_location2coord2(RASTER3D_Region *region, double north, double east, double top,
-		   int *x, int *y, int *z)
+           int *x, int *y, int *z)
 {
     if (!Rast3d_is_valid_location(region, north, east, top))
-	Rast3d_fatal_error("Rast3d_location2coord2: location not in region");
+    Rast3d_fatal_error("Rast3d_location2coord2: location not in region");
 
-    Rast3d_location2coord(region, north, east, top, x, y, z);
+    double col, row, depth;
+    LOCATION_TO_COORD(region, north, east, top, &col, &row, &depth);
+
+    *x = (int)floor(col);
+    *y = (int)floor(row);
+    *z = (int)floor(depth);
 }
 
 /*!
- * \brief 
+ * \brief
  *
- *  Converts cell-coordinates <em>(x, y, z)</em> into region-coordinates 
- * <em>(north, east, top)</em>. 
+ *  Converts cell-coordinates <em>(x, y, z)</em> into region-coordinates
+ * <em>(north, east, top)</em>.
  *
  *  * <b>Note:</b> x, y and z is a double:
  *  - x+0.0 will return the easting for the western edge of the column.
  *  - x+0.5 will return the easting for the center of the column.
  *  - x+1.0 will return the easting for the eastern edge of the column.
- * 
+ *
  *  - y+0.0 will return the northing for the northern edge of the row.
  *  - y+0.5 will return the northing for the center of the row.
  *  - y+1.0 will return the northing for the southern edge of the row.
- * 
+ *
  *  - z+0.0 will return the top for the lower edge of the depth.
  *  - z+0.5 will return the top for the center of the depth.
  *  - z+1.0 will return the top for the upper edge of the column.
  *
- * <b>Note:</b> The result is a <i>double</i>. Casting it to an
- * <i>int</i> will give the column, row and depth number.
- * 
- * 
- *  \param map
+*
+ *  \param region
  *  \param x
  *  \param y
  *  \param z
@@ -372,9 +391,7 @@
 void
 Rast3d_coord2location(RASTER3D_Region * region, double x, double y, double z, double *north, double *east, double *top)
 {
-    *north = region->north - y * region->ns_res;
-    *east = region->west + x * region->ew_res;
-    *top = region->bottom + z * region->tb_res; 
-        
+    COORD_TO_LOCATION(region, x, y, z, north, east, top);
+
     G_debug(4, "Rast3d_coord2location north %g east %g top %g\n", *north, *east, *top);
 }

Modified: grass/branches/releasebranch_7_0/lib/raster3d/test/test.raster3d.lib.html
===================================================================
--- grass/branches/releasebranch_7_0/lib/raster3d/test/test.raster3d.lib.html	2014-11-22 12:12:00 UTC (rev 62857)
+++ grass/branches/releasebranch_7_0/lib/raster3d/test/test.raster3d.lib.html	2014-11-22 21:54:43 UTC (rev 62858)
@@ -0,0 +1,11 @@
+<h2>DESCRIPTION</h2>
+
+<em>test.raster3d.lib</em> 
+is a module dedicated for testing the raster 3d library functionality and to perform benchmark runs.
+This module is used by the testing framework to perform library tests.
+
+<h2>AUTHOR</h2>
+
+Sören Gebbert
+
+

Modified: grass/branches/releasebranch_7_0/lib/raster3d/test/test_coordinate_transform.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/raster3d/test/test_coordinate_transform.c	2014-11-22 12:12:00 UTC (rev 62857)
+++ grass/branches/releasebranch_7_0/lib/raster3d/test/test_coordinate_transform.c	2014-11-22 21:54:43 UTC (rev 62858)
@@ -20,9 +20,9 @@
     sum += test_region();
 
     if (sum > 0)
-	G_warning("\n-- raster3d coordinate transform unit tests failure --");
+    G_warning("\n-- raster3d coordinate transform unit tests failure --");
     else
-	G_message("\n-- raster3d coordinate transform unit tests finished successfully --");
+    G_message("\n-- raster3d coordinate transform unit tests finished successfully --");
 
     return sum;
 }
@@ -31,19 +31,19 @@
 
 int test_coordinate_transform(void)
 {
-    int sum = 0; 
-    
+    int sum = 0;
+
     double north, east, top;
     int col = 0, row = 0, depth = 0;
-    
+
     RASTER3D_Region region, default_region;
     RASTER3D_Map *map = NULL;
-    
+
     /* We need to set up a specific region for the new raster3d map.
      * First we safe the default region. */
     Rast3d_get_window(&default_region);
     Rast3d_region_copy(&region, &default_region);
-    
+
     region.bottom = 0.0;
     region.top = 1000;
     region.south = 1000;
@@ -53,100 +53,100 @@
     region.rows = 15;
     region.cols = 10;
     region.depths = 5;
-        
+
     Rast3d_adjust_region(&region);
-    
+
     map = Rast3d_open_new_opt_tile_size("test_coordinate_transform", RASTER3D_USE_CACHE_XYZ, &region, FCELL_TYPE, 32);
-        
+
     /* The window is the same as the map region ... of course */
     Rast3d_set_window_map(map, &region);
-    
+
     G_message("Test the upper right corner, coordinates must be col = 9, row = 0, depth = 4");
-    
+
     /*
      ROWS
-  1000 1500 2000 2500 3000 3500 4000 4500 5000 5500 6500 7000 7500 8000 8500 9000
-    |....|....|....|....|....|....|....|....|....|....|....|....|....|....|....|                         
+  1000 1500 2000 2500 3000 3500 4000 4500 5000 5500 6000 6500 7000 7500 8000 8500
+    |....|....|....|....|....|....|....|....|....|....|....|....|....|....|....|
    15   14   13   12   11   10    9    8    7    6    5    4    3    2    1    0
-          
+
     COLS
   5000 5500 6000 6500 7000 7500 8000 8500 9000 9500 10000
-    |....|....|....|....|....|....|....|....|....|....|                         
+    |....|....|....|....|....|....|....|....|....|....|
     0    1    2    3    4    5    6    7    8    9   10
-      
+
     DEPTHS
     0   200  400  600  800  1000
-    |....|....|....|....|....|                         
-    0    1    2    3    4    5                          
+    |....|....|....|....|....|
+    0    1    2    3    4    5
     */
     north = 8499.9;
     east=  9999.9;
     top =  999.9;
-        
-    Rast3d_location2coord(&(map->region), north, east, top, &col, &row, &depth);    
+
+    Rast3d_location2coord(&(map->region), north, east, top, &col, &row, &depth);
     printf("Rast3d_location2coord col %i row %i depth %i\n", col, row, depth);
     if(region.cols - 1 != col || 0 != row || region.depths - 1 != depth) {
         G_message("Error in Rast3d_location2coord");
         sum++;
     }
-    
-    G_message("Test the lower left corner, coordinates must be col = 0 row = 14 depth = 0");
-    
+
+    G_message("Test the lower left corner, coordinates must be col = 0 row = 15 depth = 0");
+
     north = 1000.0;
     east= 5000.0;
     top = 0.0;
-        
-    Rast3d_location2coord(&(map->region), north, east, top, &col, &row, &depth);    
+
+    Rast3d_location2coord(&(map->region), north, east, top, &col, &row, &depth);
     printf("Rast3d_location2coord col %i row %i depth %i\n", col, row, depth);
-    if(0 != col || 14 != row || 0 != depth) {
+    if(0 != col || 15 != row || 0 != depth) {
         G_message("Error in Rast3d_location2coord");
         sum++;
     }
-    
+
     G_message("Test the center, coordinates must be col = 4 row = 7 depth = 2");
-    
-    
+
+
     north = 4750.0;
     east= 7499.9;
     top = 500.0;
-        
-    Rast3d_location2coord(&(map->region), north, east, top, &col, &row, &depth);    
+
+    Rast3d_location2coord(&(map->region), north, east, top, &col, &row, &depth);
     printf("Rast3d_location2coord col %i row %i depth %i\n", col, row, depth);
     if((region.cols - 1)/2 != col || (region.rows - 1)/2 != row || (region.depths - 1)/2 != depth) {
         G_message("Error in Rast3d_location2coord");
         sum++;
     }
-    
+
     G_message("Test the n=3000.1, e=7000.1 and t=800.1, coordinates must be col = 4 row = 10 depth = 4");
-    
+
     north = 3000.1;
     east= 7000.1;
     top = 800.1;
-        
-    Rast3d_location2coord(&(map->region), north, east, top, &col, &row, &depth);    
+
+    Rast3d_location2coord(&(map->region), north, east, top, &col, &row, &depth);
     printf("Rast3d_location2coord col %i row %i depth %i\n", col, row, depth);
     if(4 != col || map->region.rows - 5 != row || 4 != depth) {
         G_message("Error in Rast3d_location2coord");
         sum++;
     }
-    
+
     G_message("Test the n=2999.9, e=6999.9 and t=799.9, coordinates must be col = 3 row = 11 depth = 3");
-    
+
     north = 2999.9;
     east= 6999.9;
     top = 799.9;
-        
-    Rast3d_location2coord(&(map->region), north, east, top, &col, &row, &depth);    
+
+    Rast3d_location2coord(&(map->region), north, east, top, &col, &row, &depth);
     printf("Rast3d_location2coord col %i row %i depth %i\n", col, row, depth);
     if(3 != col || map->region.rows - 4 != row || 3 != depth) {
         G_message("Error in Rast3d_location2coord");
         sum++;
     }
-    
+
     Rast3d_close(map);
-    
+
     G_remove("grid3", "test_coordinate_transform");
-    
+
     return sum;
 }
 
@@ -156,7 +156,7 @@
 {
     int sum = 0;
     RASTER3D_Region region, new_region;
-    
+
     Rast3d_get_window(&region);
     region.bottom = 0.0;
     region.top = 1000;
@@ -170,97 +170,97 @@
     region.ew_res = 0;
     region.ns_res = 0;
     region.tb_res = 0;
-        
+
     /* Test region adjustment */
     Rast3d_adjust_region(&region);
-    
+
     if(region.ew_res != 500) {
         G_message("Error in Rast3d_adjust_region: region.ew_res != 500");
         sum++;
     }
-    
+
     if(region.ns_res != 500) {
         G_message("Error in Rast3d_adjust_region: region.ew_res != 500");
         sum++;
     }
-    
+
     if(region.tb_res != 200) {
         G_message("Error in Rast3d_adjust_region: region.ew_res != 500");
         sum++;
     }
-    
+
     /* Test the region copy */
     Rast3d_region_copy(&new_region, &region);
-        
+
     if(region.bottom != new_region.bottom) {
         G_message("Error in Rast3d_region_copy: region.bottom != new_region.bottom");
         sum++;
     }
-    
+
     if(region.cols != new_region.cols) {
         G_message("Error in Rast3d_region_copy: region.cols != new_region.cols");
         sum++;
     }
-    
+
     if(region.depths != new_region.depths) {
         G_message("Error in Rast3d_region_copy: region.depths != new_region.depths");
         sum++;
     }
-    
+
     if(region.east != new_region.east) {
         G_message("Error in Rast3d_region_copy: region.east != new_region.east");
         sum++;
     }
-    
+
     if(region.ew_res != new_region.ew_res) {
         G_message("Error in Rast3d_region_copy: region.ew_res != new_region.ew_res");
         sum++;
     }
-    
+
     if(region.north != new_region.north) {
         G_message("Error in Rast3d_region_copy: region.north != new_region.north");
         sum++;
     }
-    
+
     if(region.ns_res != new_region.ns_res) {
         G_message("Error in Rast3d_region_copy: region.ns_res != new_region.ns_res");
         sum++;
     }
-    
+
     if(region.proj != new_region.proj) {
         G_message("Error in Rast3d_region_copy: region.proj != new_region.proj");
         sum++;
     }
-    
+
     if(region.rows != new_region.rows) {
         G_message("Error in Rast3d_region_copy: region.rows != new_region.rows");
         sum++;
     }
-    
+
     if(region.south != new_region.south) {
         G_message("Error in Rast3d_region_copy: region.south != new_region.south");
         sum++;
     }
-    
+
     if(region.tb_res != new_region.tb_res) {
         G_message("Error in Rast3d_region_copy: region.tb_res != new_region.tb_res");
         sum++;
     }
-    
+
     if(region.top != new_region.top) {
         G_message("Error in Rast3d_region_copy: region.top != new_region.top");
         sum++;
     }
-    
+
     if(region.west != new_region.west) {
         G_message("Error in Rast3d_region_copy: region.west != new_region.west");
         sum++;
     }
-    
+
     if(region.zone != new_region.zone) {
         G_message("Error in Rast3d_region_copy: region.zone != new_region.zone");
         sum++;
-    }    
-    
+    }
+
     return sum;
 }

Modified: grass/branches/releasebranch_7_0/lib/raster3d/test/test_main.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/raster3d/test/test_main.c	2014-11-22 12:12:00 UTC (rev 62857)
+++ grass/branches/releasebranch_7_0/lib/raster3d/test/test_main.c	2014-11-22 21:54:43 UTC (rev 62858)
@@ -42,13 +42,6 @@
     param.unit->options = "coord,putget,large";
     param.unit->description = "Choose the unit tests to run";
 
-    param.integration = G_define_option();
-    param.integration->key = "integration";
-    param.integration->type = TYPE_STRING;
-    param.integration->required = NO;
-    param.integration->options = "";
-    param.integration->description = "Choose the integration tests to run";
-
     param.depths = G_define_option();
     param.depths->key = "depths";
     param.depths->type = TYPE_INTEGER;
@@ -81,14 +74,6 @@
     param.testunit->key = 'u';
     param.testunit->description = "Run all unit tests";
 
-    param.testint = G_define_flag();
-    param.testint->key = 'i';
-    param.testint->description = "Run all integration tests";
-
-    param.full = G_define_flag();
-    param.full->key = 'a';
-    param.full->description = "Run all unit and integration tests";
-
     param.compression = G_define_flag();
     param.compression->key = 'l';
     param.compression->description = "Switch zip compression on";
@@ -110,7 +95,10 @@
     module = G_define_module();
     module->description
             = "Performs unit and integration tests for the raster3d library";
+    G_add_keyword(_("raster3d"));
+    G_add_keyword(_("test"));
 
+
     /* Get parameters from user */
     set_params();
 
@@ -135,43 +123,26 @@
     Rast3d_init_defaults();
 
     /*Run the unit tests */
-    if (param.testunit->answer || param.full->answer) {
+    if (param.testunit->answer) {
         returnstat += unit_test_coordinate_transform();
         returnstat += unit_test_put_get_value();
         returnstat += unit_test_put_get_value_large_file(depths, rows, cols, tile_size);
     }
 
-    /*Run the integration tests */
-    if (param.testint->answer || param.full->answer) {
-        ;
-    }
-
     /*Run single tests */
-    if (!param.full->answer) {
-        /*unit tests */
-        if (!param.testunit->answer) {
-            i = 0;
-            if (param.unit->answers)
-                while (param.unit->answers[i]) {
-                    if (strcmp(param.unit->answers[i], "coord") == 0)
-                        returnstat += unit_test_coordinate_transform();
-                    if (strcmp(param.unit->answers[i], "putget") == 0)
-                        returnstat += unit_test_put_get_value();
-                    if (strcmp(param.unit->answers[i], "large") == 0)
-                        returnstat += unit_test_put_get_value_large_file(depths, rows, cols, tile_size);
-                    
-                    i++;
-                }
-        }
-        /*integration tests */
-        if (!param.testint->answer) {
-            i = 0;
-            if (param.integration->answers)
-                while (param.integration->answers[i]) {
-                    ;
-                }
-
-        }
+    if (!param.testunit->answer) {
+        i = 0;
+        if (param.unit->answers)
+            while (param.unit->answers[i]) {
+                if (strcmp(param.unit->answers[i], "coord") == 0)
+                    returnstat += unit_test_coordinate_transform();
+                if (strcmp(param.unit->answers[i], "putget") == 0)
+                    returnstat += unit_test_put_get_value();
+                if (strcmp(param.unit->answers[i], "large") == 0)
+                    returnstat += unit_test_put_get_value_large_file(depths, rows, cols, tile_size);
+                
+                i++;
+            }
     }
     
     if (returnstat != 0)

Modified: grass/branches/releasebranch_7_0/lib/raster3d/test/test_put_get_value.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/raster3d/test/test_put_get_value.c	2014-11-22 12:12:00 UTC (rev 62857)
+++ grass/branches/releasebranch_7_0/lib/raster3d/test/test_put_get_value.c	2014-11-22 21:54:43 UTC (rev 62858)
@@ -4,7 +4,7 @@
 * MODULE:       Grass raster3d Library
 * AUTHOR(S):    Soeren Gebbert, Braunschweig (GER) Jun 2011
 * 		        soerengebbert <at> googlemail <dot> com
-*               
+*
 * PURPOSE:	Unit and Integration tests
 *
 * COPYRIGHT:    (C) 2000 by the GRASS Development Team
@@ -23,13 +23,13 @@
 static int test_put_get_value_fcell(void);
 static int test_put_get_value_resampling(void);
 static int test_get_value_region(RASTER3D_Map *map, int cols, int rows, int depths);
-static int test_resampling_dcell(RASTER3D_Map *map, double north, double east, double 
+static int test_resampling_dcell(RASTER3D_Map *map, double north, double east, double
                                  top, int col, int row, int depth, int fact);
-static int test_resampling_fcell(RASTER3D_Map *map, double north, double east, double 
+static int test_resampling_fcell(RASTER3D_Map *map, double north, double east, double
                                  top, int col, int row, int depth, int fact);
 
 /* *************************************************************** */
-/* Perform the coordinate transformation tests ******************* */
+/* Perform the put-get value tests ******************************* */
 /* *************************************************************** */
 int unit_test_put_get_value()
 {
@@ -37,15 +37,15 @@
 
     G_message("\n++ Running raster3d put/get value unit tests ++");
 
-    //sum += test_put_get_value_dcell();
-    //sum += test_put_get_value_fcell();
+    sum += test_put_get_value_dcell();
+    sum += test_put_get_value_fcell();
     sum += test_put_get_value_resampling();
 
 
     if (sum > 0)
-	G_warning("\n-- raster3d put/get value unit tests failure --");
+    G_warning("\n-- raster3d put/get value unit tests failure --");
     else
-	G_message("\n-- raster3d put/get value unit tests finished successfully --");
+    G_message("\n-- raster3d put/get value unit tests finished successfully --");
 
     return sum;
 }
@@ -54,23 +54,23 @@
 
 int test_put_get_value_dcell(void)
 {
-    int sum = 0; 
+    int sum = 0;
     int x, y, z;
     DCELL value;
     DCELL value_ref;
-    
+
     G_message("Testing DCELL put get value functions");
-    
+
     double north, east, top;
     int col, row, depth;
-    
+
     RASTER3D_Region region;
     RASTER3D_Map *map = NULL;
-    
+
     /* We need to set up a specific region for the new raster3d map.
      * First we safe the default region. */
     Rast3d_get_window(&region);
-    
+
     region.bottom = 0.0;
     region.top = 1000;
     region.south = 1000;
@@ -80,33 +80,42 @@
     region.rows = 15;
     region.cols = 10;
     region.depths = 5;
-        
+
     Rast3d_adjust_region(&region);
-        
+
     map = Rast3d_open_new_opt_tile_size("test_put_get_value_dcell", RASTER3D_USE_CACHE_XY, &region, DCELL_TYPE, 32);
-    
+
     /* The window is the same as the map region ... of course */
     Rast3d_set_window_map(map, &region);
     /*
      ROWS
-  1000 1500 2000 2500 3000 3500 4000 4500 5000 5500 6500 7000 7500 8000 8500 9000 north
-    |....|....|....|....|....|....|....|....|....|....|....|....|....|....|....|                         
+  1000 1500 2000 2500 3000 3500 4000 4500 5000 5500 6000 6500 7000 7500 8000 8500 north
+    |....|....|....|....|....|....|....|....|....|....|....|....|....|....|....|
    15   14   13   12   11   10    9    8    7    6    5    4    3    2    1    0 region
-          
+
     COLS
   5000 5500 6000 6500 7000 7500 8000 8500 9000 9500 10000 east
-    |....|....|....|....|....|....|....|....|....|....|                         
+    |....|....|....|....|....|....|....|....|....|....|
     0    1    2    3    4    5    6    7    8    9   10 region
-      
+
     DEPTHS
     0   200  400  600  800  1000  top
-    |....|....|....|....|....|                         
-    0    1    2    3    4    5 region                   
+    |....|....|....|....|....|
+    0    1    2    3    4    5 region
     */
-    
+
     for(z = 0; z < region.depths; z++) {
         for(y = 0; y < region.rows; y++) { /* From the north to the south */
             for(x = 0; x < region.cols; x++) {
+                value = -1;
+                Rast3d_put_value(map, x, y, z, &value, DCELL_TYPE);
+            }
+        }
+    }
+
+    for(z = 0; z < region.depths; z++) {
+        for(y = 0; y < region.rows; y++) { /* From the north to the south */
+            for(x = 0; x < region.cols; x++) {
                 /* Add cols, rows and depths and put this in the map */
                 value = x + y + z;
                 Rast3d_put_value(map, x, y, z, &value, DCELL_TYPE);
@@ -114,70 +123,72 @@
         }
     }
 
-    /* Write everything to the disk */
-    Rast3d_flush_all_tiles(map);
-    Rast3d_close(map);
 
-    map = Rast3d_open_cell_old("test_put_get_value_dcell", G_mapset(), &region, DCELL_TYPE, RASTER3D_USE_CACHE_XY);
-    
-    /* Reread the map and compare the expected results */
-    
+    /* Reread the new open map and compare the expected results */
+
     G_message("Get the value of the upper left corner -> 0");
-    
-    
+
+
     col = row = depth = 0;
-    north = region.north - 0.1; /* north would be out of bounds therefor -0.1 */
+    north = region.north - region.ns_res * row;
     east = region.west + region.ew_res * col;
     top = region.bottom + region.tb_res * depth;
-    
+
     sum += test_resampling_dcell(map, north, east, top, col, row, depth, 1);
-    
-    
+
+
     G_message("Get the value of x == y == z == 1 -> x + y + z == 3");
-    
+
     col = row = depth = 1;
-    north = region.north - region.ns_res * (row + 1);
+    north = region.north - region.ns_res * row;
     east = region.west + region.ew_res * col;
     top = region.bottom + region.tb_res * depth;
-    
+
     sum += test_resampling_dcell(map, north, east, top, col, row, depth, 1);
-    
+
     G_message("Get the value of x == 4 y == 3 z == 2 -> x + y + z = 9");
-    
+
     col = 4;
     row = 3;
     depth = 2;
-    north = region.north - region.ns_res * (row + 1);
+    north = region.north - region.ns_res * row;
     east = region.west + region.ew_res * col;
     top = region.bottom + region.tb_res * depth;
-    
+
     sum += test_resampling_dcell(map, north, east, top, col, row, depth, 1);
-    
+
+
+    /* Write everything to the disk and reopen the map */
+    Rast3d_flush_all_tiles(map);
+    Rast3d_close(map);
+    map = Rast3d_open_cell_old("test_put_get_value_dcell", G_mapset(), &region, DCELL_TYPE, RASTER3D_USE_CACHE_XY);
+
+
     G_message("Get the value of x == 9 y == 14 z == 4 -> x + y + z = 27");
-    
+
     col = 9;
     row = 14;
     depth = 4;
-    north = region.north - region.ns_res * (row + 1);
+    north = region.north - region.ns_res * row;
     east = region.west + region.ew_res * col;
     top = region.bottom + region.tb_res * depth;
-    
+
     sum += test_resampling_dcell(map, north, east, top, col, row, depth, 1);
-        
+
     G_message("Get the value of x == 10 y == 15 z == 5 -> x + y + z = NAN");
-        
+
     col = 10;
     row = 15;
     depth = 5;
-    north = region.north - region.ns_res * (row + 1);
+    north = region.north - region.ns_res * row;
     east = region.west + region.ew_res * col;
     top = region.bottom + region.tb_res * depth;
-    
+
     Rast3d_get_region_value(map, north, east, top, &value, DCELL_TYPE);
     Rast3d_get_value(map, col, row, depth, &value_ref, DCELL_TYPE);
     /* Rast3d_get_value_region does not work with coordinates outside the region */
     printf("Value %g == %g\n", value, value_ref);
-    
+
     if(value == 0 || value < 0 || value > 0) {
         G_message("Error in Rast3d_get_region_value");
         sum++;
@@ -186,11 +197,11 @@
         G_message("Error in Rast3d_get_value");
         sum++;
     }
-    
+
     Rast3d_close(map);
-    
+
     G_remove("grid3", "test_put_get_value_dcell");
-    
+
     return sum;
 }
 
@@ -198,23 +209,23 @@
 
 int test_put_get_value_fcell(void)
 {
-     int sum = 0; 
+     int sum = 0;
     int x, y, z;
     FCELL value;
     FCELL value_ref;
-    
+
     G_message("Testing FCELL put get value functions");
-    
+
     double north, east, top;
     int col, row, depth;
-    
+
     RASTER3D_Region region;
     RASTER3D_Map *map = NULL;
-    
+
     /* We need to set up a specific region for the new raster3d map.
      * First we safe the default region. */
     Rast3d_get_window(&region);
-    
+
     region.bottom = 0.0;
     region.top = 1000;
     region.south = 1000;
@@ -224,14 +235,14 @@
     region.rows = 15;
     region.cols = 10;
     region.depths = 5;
-        
+
     Rast3d_adjust_region(&region);
-        
+
     map = Rast3d_open_new_opt_tile_size("test_put_get_value_fcell", RASTER3D_USE_CACHE_XY, &region, FCELL_TYPE, 32);
-    
+
     /* The window is the same as the map region ... of course */
     Rast3d_set_window_map(map, &region);
-    
+
     for(z = 0; z < region.depths; z++) {
         for(y = 0; y < region.rows; y++) {
             for(x = 0; x < region.cols; x++) {
@@ -247,63 +258,63 @@
     Rast3d_close(map);
 
     map = Rast3d_open_cell_old("test_put_get_value_fcell", G_mapset(), &region, DCELL_TYPE, RASTER3D_USE_CACHE_XY);
-    
+
        /* Reread the map and compare the expected results */
-    
+
     G_message("Get the value of the lower left corner -> 0");
-    
+
     col = row = depth = 0;
-    north = region.north - region.ns_res * (row + 1);
+    north = region.north - region.ns_res * row;
     east = region.west + region.ew_res * col;
     top = region.bottom + region.tb_res * depth;
-    
+
     sum += test_resampling_fcell(map, north, east, top, col, row, depth, 1);
-    
+
     G_message("Get the value of x == y == z == 1 -> x + y + z == 3");
-    
+
     col = row = depth = 1;
-    north = region.north - region.ns_res * (row + 1);
+    north = region.north - region.ns_res * row;
     east = region.west + region.ew_res * col;
     top = region.bottom + region.tb_res * depth;
-    
+
     sum += test_resampling_fcell(map, north, east, top, col, row, depth, 1);
-    
+
     G_message("Get the value of x == 4 y == 3 z == 2 -> x + y + z = 9");
-    
+
     col = 4;
     row = 3;
     depth = 2;
-    north = region.north - region.ns_res * (row + 1);
+    north = region.north - region.ns_res * row;
     east = region.west + region.ew_res * col;
     top = region.bottom + region.tb_res * depth;
-    
+
     sum += test_resampling_fcell(map, north, east, top, col, row, depth, 1);
-    
+
     G_message("Get the value of x == 9 y == 14 z == 4 -> x + y + z = 27");
-    
+
     col = 9;
     row = 14;
     depth = 4;
-    north = region.north - region.ns_res * (row + 1);
+    north = region.north - region.ns_res * row;
     east = region.west + region.ew_res * col;
     top = region.bottom + region.tb_res * depth;
-    
+
     sum += test_resampling_fcell(map, north, east, top, col, row, depth, 1);
-        
+
     G_message("Get the value of x == 10 y == 15 z == 5 -> x + y + z = NAN");
-    
+
     col = 10;
     row = 15;
     depth = 5;
-    north = region.north - region.ns_res * (row + 1);
+    north = region.north - region.ns_res * row;
     east = region.west + region.ew_res * col;
     top = region.bottom + region.tb_res * depth;
-    
+
     Rast3d_get_region_value(map, north, east, top, &value, FCELL_TYPE);
     Rast3d_get_value(map, 10, 15, 5, &value_ref, FCELL_TYPE);
     /* Rast3d_get_value_region does not work with coordinates outside the region */
     printf("Value %g == %g\n", value, value_ref);
-    
+
     if(value == 0 || value < 0 || value > 0) {
         G_message("Error in Rast3d_get_region_value");
         sum++;
@@ -312,11 +323,11 @@
         G_message("Error in Rast3d_get_value");
         sum++;
     }
-    
+
     Rast3d_close(map);
-    
+
     G_remove("grid3", "test_put_get_value_fcell");
-    
+
     return sum;
 }
 
@@ -324,23 +335,23 @@
 
 int test_put_get_value_resampling(void)
 {
-    int sum = 0; 
+    int sum = 0;
     int x, y, z;
     DCELL value;
-    
+
     G_message("Testing put get resample value functions");
-    
+
     double north, east, top;
     int col, row, depth;
-    
+
     RASTER3D_Region region;
     RASTER3D_Region window;
     RASTER3D_Map *map = NULL;
-    
+
     /* We need to set up a specific region for the new raster3d map.
      * First we safe the default region. */
     Rast3d_get_window(&region);
-    
+
     region.bottom = 0.0;
     region.top = 1000;
     region.south = 1000;
@@ -350,32 +361,32 @@
     region.rows = 15;
     region.cols = 10;
     region.depths = 5;
-        
+
     Rast3d_adjust_region(&region);
-    
+
     map = Rast3d_open_new_opt_tile_size("test_put_get_value_resample", RASTER3D_USE_CACHE_XY, &region, DCELL_TYPE, 32);
     /*
      ROWS
-  1000 1500 2000 2500 3000 3500 4000 4500 5000 5500 6500 7000 7500 8000 8500 9000 north
-    |....|....|....|....|....|....|....|....|....|....|....|....|....|....|....|                         
+  1000 1500 2000 2500 3000 3500 4000 4500 5000 5500 6000 6500 7000 7500 8000 8500 north
+    |....|....|....|....|....|....|....|....|....|....|....|....|....|....|....|
    15   14   13   12   11   10    9    8    7    6    5    4    3    2    1    0 region
     |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |
    30   28   26   24   22   20   18   16   14   12   10    8    6    4    2    0 window
-          
+
     COLS
   5000 5500 6000 6500 7000 7500 8000 8500 9000 9500 10000 east
-    |....|....|....|....|....|....|....|....|....|....|                         
+    |....|....|....|....|....|....|....|....|....|....|
     0    1    2    3    4    5    6    7    8    9   10 region
     |    |    |    |    |    |    |    |    |    |    |
     0    2    4    6    8   10   12   14   16   18   20 window
     DEPTHS
     0   200  400  600  800  1000 top
-    |....|....|....|....|....|                         
-    0    1    2    3    4    5 region  
+    |....|....|....|....|....|
+    0    1    2    3    4    5 region
     |    |    |    |    |    |
-    0    2    4    6    8   10 window                   
+    0    2    4    6    8   10 window
     */
-    
+
     for(z = 0; z < region.depths; z++) {
         for(y = 0; y < region.rows; y++) {  /* North to south */
             for(x = 0; x < region.cols; x++) {
@@ -404,56 +415,56 @@
 
     /* The window has the 8x resolution as the map region */
     Rast3d_set_window_map(map, &window);
-    
+
     /* Reread the map and compare the expected results */
-    
+
     G_message("Get the value of the upper left corner -> 0");
-    
+
     col = row = depth = 0;
-    north = region.north - region.ns_res * (row + 1);
+    north = region.north - region.ns_res * row;
     east = region.west + region.ew_res * col;
     top = region.bottom + region.tb_res * depth;
-    
+
     sum += test_resampling_dcell(map, north, east, top, col, row, depth, 2);
-    
+
     G_message("Get the value of x == y == z == 1 -> x + y + z == 3");
-    
-    
+
+
     col = row = depth = 1;
-    north = region.north - region.ns_res * (row + 1);
+    north = region.north - region.ns_res * row;
     east = region.west + region.ew_res * col;
     top = region.bottom + region.tb_res * depth;
-    
+
     sum += test_resampling_dcell(map, north, east, top, col, row, depth, 2);
-    
+
     G_message("Get the value of x == 7 y == 9 z == 3 -> x + y + z == 19");
-        
+
     col = 7;
     row = 9;
     depth = 3;
-    north = region.north - region.ns_res * (row + 1);
+    north = region.north - region.ns_res * row;
     east = region.west + region.ew_res * col;
     top = region.bottom + region.tb_res * depth;
-    
+
     sum += test_resampling_dcell(map, north, east, top, col, row, depth, 2);
-    
+
     G_message("Get the value of x == 9 y == 14 z == 4 -> x + y + z == 27");
-        
+
     col = 9;
     row = 14;
     depth = 4;
-    north = region.north - region.ns_res * (row + 1);
+    north = region.north - region.ns_res * row;
     east = region.west + region.ew_res * col;
     top = region.bottom + region.tb_res * depth;
-    
+
     sum += test_resampling_dcell(map, north, east, top, col, row, depth, 2);
-    
+
     sum += test_get_value_region(map, region.cols, region.rows, region.depths);
-    
+
     Rast3d_close(map);
-    
+
     G_remove("grid3", "test_put_get_value_resample");
-    
+
     return sum;
 }
 
@@ -466,13 +477,13 @@
     DCELL value_ref;
     DCELL value_reg;
     DCELL value_win;
-    
+
     Rast3d_get_region_value(map, north, east, top, &value, DCELL_TYPE);
     Rast3d_get_window_value(map, north, east, top, &value_win, DCELL_TYPE);
     Rast3d_get_value(map, col * fact, row * fact, depth * fact, &value_ref, DCELL_TYPE);
     Rast3d_get_value_region(map, col, row, depth, &value_reg, DCELL_TYPE);
     printf("Value %g == %g == %g == %g\n", value, value_win, value_ref, value_reg);
-    
+
     if(value != col + row + depth) {
         G_message("Error in Rast3d_get_region_value");
         sum++;
@@ -489,7 +500,7 @@
         G_message("Error in Rast3d_get_value_region");
         sum++;
     }
-    
+
     return sum;
 }
 
@@ -502,13 +513,13 @@
     FCELL value_ref;
     FCELL value_reg;
     FCELL value_win;
-    
+
     Rast3d_get_region_value(map, north, east, top, &value, FCELL_TYPE);
     Rast3d_get_window_value(map, north, east, top, &value_win, FCELL_TYPE);
     Rast3d_get_value(map, col * fact, row * fact, depth * fact, &value_ref, FCELL_TYPE);
     Rast3d_get_value_region(map, col, row, depth, &value_reg, FCELL_TYPE);
     printf("Value %g == %g == %g == %g\n", value, value_win, value_ref, value_reg);
-    
+
     if(value != col + row + depth) {
         G_message("Error in Rast3d_get_region_value");
         sum++;
@@ -525,7 +536,7 @@
         G_message("Error in Rast3d_get_value_region");
         sum++;
     }
-    
+
     return sum;
 }
 
@@ -538,14 +549,14 @@
     FCELL fvalue2 = 0.0;
     DCELL dvalue1 = 0.0;
     DCELL dvalue2 = 0.0;
-    
+
     /* Test for correct Null value */
     Rast3d_get_value_region(map, -1, -1, -1, &fvalue1, FCELL_TYPE);
     Rast3d_get_value_region(map, cols, rows, depths, &fvalue2, FCELL_TYPE);
     Rast3d_get_value_region(map, -1, -1, -1, &dvalue1, DCELL_TYPE);
     Rast3d_get_value_region(map, cols, rows, depths, &dvalue2, DCELL_TYPE);
     printf("Value %g == %g == %g == %g\n", fvalue1, fvalue2, dvalue1, dvalue2);
-    
+
     if(!Rast_is_f_null_value(&fvalue1)) {
         G_message("Error in Rast3d_get_value_region");
         sum++;
@@ -562,6 +573,6 @@
         G_message("Error in Rast3d_get_value_region");
         sum++;
     }
-    
+
     return sum;
 }

Modified: grass/branches/releasebranch_7_0/lib/raster3d/test/test_put_get_value_large_file.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/raster3d/test/test_put_get_value_large_file.c	2014-11-22 12:12:00 UTC (rev 62857)
+++ grass/branches/releasebranch_7_0/lib/raster3d/test/test_put_get_value_large_file.c	2014-11-22 21:54:43 UTC (rev 62858)
@@ -36,12 +36,12 @@
 
     G_message("\n++ Running raster3d put/get value large file unit tests ++");
 
+    sum += test_large_file(depths, rows, cols, tile_size);
     sum += test_large_file_random(depths, rows, cols, tile_size);
     sum += test_large_file_sparse_random(depths, rows, cols, tile_size);
     sum += test_large_file(depths, rows, cols, tile_size);
+    sum += test_large_file_zeros(depths, rows, cols, tile_size);
     sum += test_large_file(depths, rows, cols, tile_size);
-    sum += test_large_file(depths, rows, cols, tile_size);
-    sum += test_large_file_zeros(depths, rows, cols, tile_size);
 
 
     if (sum > 0)
@@ -57,7 +57,7 @@
 int test_large_file(int depths, int rows, int cols, int tile_size)
 {
     int sum = 0; 
-    int x, y, z;
+    int x, y, z, count;
     DCELL value;
     
     G_message("Testing DCELL put function for large files");
@@ -89,12 +89,28 @@
     /* The window is the same as the map region ... of course */
     Rast3d_set_window_map(map, &region);
     
-    int count = 1;
+    /*Write -1 first to see if the tile handling works correctly */
     for(z = 0; z < region.depths; z++) {
 	G_percent(z, region.depths, 1);
         for(y = 0; y < region.rows; y++) {
             for(x = 0; x < region.cols; x++) {
               /* Put the counter as cell value */
+                value = -1;
+                Rast3d_put_value(map, x, y, z, &value, DCELL_TYPE);
+            }
+        }
+    }
+
+    G_percent(1, 1, 1);
+    G_message("Rewriting the values");
+
+    /* Now write the values to be evaluated */
+    count = 1;
+    for(z = 0; z < region.depths; z++) {
+        G_percent(z, region.depths, 1);
+        for(y = 0; y < region.rows; y++) {
+            for(x = 0; x < region.cols; x++) {
+              /* Put the counter as cell value */
                 value = count;
                 Rast3d_put_value(map, x, y, z, &value, DCELL_TYPE);
                 count++;
@@ -103,15 +119,9 @@
     }
 
     G_percent(1, 1, 1);
-    /* Write everything to the disk */
-    Rast3d_flush_all_tiles(map);
-    Rast3d_close(map);
          
     G_message("Verifying 3D raster map");
 
-    map = Rast3d_open_cell_old("test_put_get_value_dcell_large",
-    		G_mapset(), &region, DCELL_TYPE, RASTER3D_USE_CACHE_XYZ);
-    
     count = 1;
     for(z = 0; z < region.depths; z++) {
 	G_percent(z, region.depths, 1);

Modified: grass/branches/releasebranch_7_0/lib/raster3d/test/test_raster3d_lib.h
===================================================================
--- grass/branches/releasebranch_7_0/lib/raster3d/test/test_raster3d_lib.h	2014-11-22 12:12:00 UTC (rev 62857)
+++ grass/branches/releasebranch_7_0/lib/raster3d/test/test_raster3d_lib.h	2014-11-22 21:54:43 UTC (rev 62858)
@@ -21,10 +21,11 @@
 #include <grass/raster3d.h>
 #include <grass/gis.h>
 #include <grass/glocale.h>
+#include <sys/time.h>
 
-double compute_time_difference(struct timeval start, struct timeval end);
+double compute_time_difference(struct timeval, struct timeval);
 int unit_test_coordinate_transform(void);
 int unit_test_put_get_value(void);
-int unit_test_put_get_value_large_file(int depths, int rows, int cols, int tile_size);
+int unit_test_put_get_value_large_file(int, int, int, int);
 
 #endif

Modified: grass/branches/releasebranch_7_0/lib/raster3d/test/test_tools.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/raster3d/test/test_tools.c	2014-11-22 12:12:00 UTC (rev 62857)
+++ grass/branches/releasebranch_7_0/lib/raster3d/test/test_tools.c	2014-11-22 21:54:43 UTC (rev 62858)
@@ -20,7 +20,6 @@
 #include <string.h>
 #include <math.h>
 #include "test_raster3d_lib.h"
-#include <sys/time.h>
 
 /* *************************************************************** */
 /* Compute the difference between two time steps ***************** */

Deleted: grass/branches/releasebranch_7_0/lib/raster3d/testsuite/raster3d_lib_test.py
===================================================================
--- grass/trunk/lib/raster3d/testsuite/raster3d_lib_test.py	2014-07-12 11:33:11 UTC (rev 61242)
+++ grass/branches/releasebranch_7_0/lib/raster3d/testsuite/raster3d_lib_test.py	2014-11-22 21:54:43 UTC (rev 62858)
@@ -1,39 +0,0 @@
-"""Test of raster3d library
-
- at author Soeren Gebbert
-"""
-from grass.gunittest.case import TestCase
-
-class Raster3dLibraryTest(TestCase):
-
-    @classmethod
-    def setUpClass(cls):
-        cls.runModule("g.gisenv", set="OVERWRITE=1")
-        
-    def test_coordinates(self):
-        self.assertModule("test.raster3d.lib",  flags="l",  unit="coord")
-        self.assertModule("test.raster3d.lib",  unit="coord")
-
-    def test_putget(self):
-        self.assertModule("test.raster3d.lib",  unit="putget")
-        self.assertModule("test.raster3d.lib",  flags="l",  unit="putget")
-
-    def test_large_tilesizes(self):
-        """Test for different tile sizes"""
-        self.assertModule("test.raster3d.lib",  unit="large",  depths=91,  rows=89,  cols=87)
-        self.assertModule("test.raster3d.lib",  unit="large",  depths=91,  rows=89,  cols=87,  tile_size=8)
-        self.assertModule("test.raster3d.lib",  unit="large",  depths=91,  rows=89,  cols=87,  tile_size=512)
-        self.assertModule("test.raster3d.lib",  unit="large",  depths=91,  rows=89,  cols=87,  tile_size=1024)
-        self.assertModule("test.raster3d.lib",  unit="large",  depths=91,  rows=89,  cols=87,  tile_size=32768)
-
-        self.assertModule("test.raster3d.lib",  flags="l",  unit="large",  depths=91,  rows=89,  cols=87)
-        self.assertModule("test.raster3d.lib",  flags="l",  unit="large",  depths=91,  rows=89,  cols=87,  tile_size=8)
-        self.assertModule("test.raster3d.lib",  flags="l",  unit="large",  depths=91,  rows=89,  cols=87,  tile_size=512)
-        self.assertModule("test.raster3d.lib",  flags="l",  unit="large",  depths=91,  rows=89,  cols=87,  tile_size=1024)
-        self.assertModule("test.raster3d.lib",  flags="l",  unit="large",  depths=91,  rows=89,  cols=87,  tile_size=32768)
-
-if __name__ == '__main__':
-    from grass.gunittest.main import test
-    test()
-
-

Copied: grass/branches/releasebranch_7_0/lib/raster3d/testsuite/raster3d_lib_test.py (from rev 61242, grass/trunk/lib/raster3d/testsuite/raster3d_lib_test.py)
===================================================================
--- grass/branches/releasebranch_7_0/lib/raster3d/testsuite/raster3d_lib_test.py	                        (rev 0)
+++ grass/branches/releasebranch_7_0/lib/raster3d/testsuite/raster3d_lib_test.py	2014-11-22 21:54:43 UTC (rev 62858)
@@ -0,0 +1,40 @@
+"""Test of raster3d library
+
+ at author Soeren Gebbert
+"""
+from grass.gunittest.case import TestCase
+
+class Raster3dLibraryTest(TestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        cls.runModule("g.gisenv", set="OVERWRITE=1")
+        
+    def test_coordinates(self):
+        self.assertModule("test.raster3d.lib",  flags="l",  unit="coord")
+        self.assertModule("test.raster3d.lib",  unit="coord")
+
+    def test_putget(self):
+        self.assertModule("test.raster3d.lib",  unit="putget")
+        self.assertModule("test.raster3d.lib",  flags="l",  unit="putget")
+
+    def test_large_tilesizes(self):
+        """Test for different tile sizes"""
+        self.assertModule("test.raster3d.lib",  unit="large",  depths=91,  rows=89,  cols=87)
+        self.assertModule("test.raster3d.lib",  unit="large",  depths=91,  rows=89,  cols=87,  tile_size=8)
+        self.assertModule("test.raster3d.lib",  unit="large",  depths=91,  rows=89,  cols=87,  tile_size=512)
+        self.assertModule("test.raster3d.lib",  unit="large",  depths=91,  rows=89,  cols=87,  tile_size=1024)
+        self.assertModule("test.raster3d.lib",  unit="large",  depths=91,  rows=89,  cols=87,  tile_size=32768)
+
+        # Enable zlib compression
+        self.assertModule("test.raster3d.lib",  flags="l",  unit="large",  depths=91,  rows=89,  cols=87)
+        self.assertModule("test.raster3d.lib",  flags="l",  unit="large",  depths=91,  rows=89,  cols=87,  tile_size=8)
+        self.assertModule("test.raster3d.lib",  flags="l",  unit="large",  depths=91,  rows=89,  cols=87,  tile_size=512)
+        self.assertModule("test.raster3d.lib",  flags="l",  unit="large",  depths=91,  rows=89,  cols=87,  tile_size=1024)
+        self.assertModule("test.raster3d.lib",  flags="l",  unit="large",  depths=91,  rows=89,  cols=87,  tile_size=32768)
+
+if __name__ == '__main__':
+    from grass.gunittest.main import test
+    test()
+
+

Modified: grass/branches/releasebranch_7_0/lib/raster3d/window.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/raster3d/window.c	2014-11-22 12:12:00 UTC (rev 62857)
+++ grass/branches/releasebranch_7_0/lib/raster3d/window.c	2014-11-22 21:54:43 UTC (rev 62858)
@@ -77,7 +77,7 @@
 /*!
  * \brief 
  *
- *  Returns 1 if window-coordinates <em>(north, west, bottom)</em> are
+ *  Returns 1 if window-coordinates <em>(north, east and top)</em> are
  * inside the window of <em>map</em>. Returns 0 otherwise.
  *
  *  \param map

Modified: grass/branches/releasebranch_7_0/raster3d/r3.neighbors/test_suite/test.r3.neighbors.sh
===================================================================
--- grass/branches/releasebranch_7_0/raster3d/r3.neighbors/test_suite/test.r3.neighbors.sh	2014-11-22 12:12:00 UTC (rev 62857)
+++ grass/branches/releasebranch_7_0/raster3d/r3.neighbors/test_suite/test.r3.neighbors.sh	2014-11-22 21:54:43 UTC (rev 62858)
@@ -1,33 +1,35 @@
 #!/bin/sh
 
+export GRASS_OVERWRITE=1
+
 g.region w=0 e=30 s=0 n=30 b=0 t=30 res3=10
 
-r3.mapcalc --o expr="test_neighbor_float  = float(3)"
-r3.mapcalc --o expr="test_neighbor_double = double(3)"
-r3.mapcalc --o expr="test_neighbor_null = null()"
+r3.mapcalc  expr="test_neighbor_float  = float(3)"
+r3.mapcalc  expr="test_neighbor_double = double(3)"
+r3.mapcalc  expr="test_neighbor_null = null()"
 
 # First @test with float values with @precision=2
 r3.neighbors input=test_neighbor_float output=test_neighbor_float_average \
-    method=average window=3,3,3 --o
+    method=average window=3,3,3 
 r3.out.ascii dp=2 input=test_neighbor_float_average output=test_neighbor_float_average.txt
 
 r3.neighbors input=test_neighbor_float output=test_neighbor_float_sum \
-    method=sum window=3,3,3 --o
+    method=sum window=3,3,3 
 r3.out.ascii dp=2 input=test_neighbor_float_sum output=test_neighbor_float_sum.txt
 
 # Second @test with double values
 r3.neighbors input=test_neighbor_double output=test_neighbor_double_average \
-    method=average window=3,3,3 --o
+    method=average window=3,3,3 
 r3.out.ascii dp=2 input=test_neighbor_double_average output=test_neighbor_double_average.txt
 
 r3.neighbors input=test_neighbor_double output=test_neighbor_double_sum \
-    method=sum window=3,3,3 --o
+    method=sum window=3,3,3 
 r3.out.ascii dp=2 input=test_neighbor_double_sum output=test_neighbor_double_sum.txt
 
 # Third @test with null values
 
 r3.neighbors input=test_neighbor_null output=test_neighbor_null_sum \
-    method=sum window=3,3,3 --o
+    method=sum window=3,3,3 
 r3.out.ascii dp=2 input=test_neighbor_null_sum output=test_neighbor_null_sum.txt
 
 



More information about the grass-commit mailing list