[GRASS-SVN] r59647 - in grass/branches/develbranch_6/raster/r.li: r.li.daemon r.li.shannon r.li.simpson

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Apr 8 12:47:26 PDT 2014


Author: mmetz
Date: 2014-04-08 12:47:26 -0700 (Tue, 08 Apr 2014)
New Revision: 59647

Modified:
   grass/branches/develbranch_6/raster/r.li/r.li.daemon/daemon.c
   grass/branches/develbranch_6/raster/r.li/r.li.daemon/worker.c
   grass/branches/develbranch_6/raster/r.li/r.li.shannon/shannon.c
   grass/branches/develbranch_6/raster/r.li/r.li.simpson/simpson.c
Log:
r.li: sync to relbr6

Modified: grass/branches/develbranch_6/raster/r.li/r.li.daemon/daemon.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.daemon/daemon.c	2014-04-08 19:42:18 UTC (rev 59646)
+++ grass/branches/develbranch_6/raster/r.li/r.li.daemon/daemon.c	2014-04-08 19:47:26 UTC (rev 59647)
@@ -226,9 +226,6 @@
     mapset = G_find_cell(raster, "");
 /*    raster_fqn = G_fully_qualified_name(raster, mapset); */
    
-    if (G_get_cellhd(raster, mapset, &cellhd) == -1)
-	G_fatal_error(_("Cannot read raster header file"));
-
     /* use current region ! */
     G_get_window(&cellhd);
 

Modified: grass/branches/develbranch_6/raster/r.li/r.li.daemon/worker.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.daemon/worker.c	2014-04-08 19:42:18 UTC (rev 59646)
+++ grass/branches/develbranch_6/raster/r.li/r.li.daemon/worker.c	2014-04-08 19:47:26 UTC (rev 59647)
@@ -66,7 +66,7 @@
     /* open raster map */
     mapset = G_find_cell(raster, "");
     fd = G_open_cell_old(raster, mapset);
-    if (G_get_cellhd(raster, mapset, &hd) == -1)
+    if (fd < 0)
 	    G_fatal_error(_("Cannot open raster map <%s>"), raster);
 
     /* get current window */
@@ -233,21 +233,11 @@
     G_debug(3, "daemon mask preproc: raster=[%s] mask=[%s]  rl=%d cl=%d",
 	    raster, mask, ad->rl, ad->cl);
 
-    /* mapset is used hold the mapset of input raster */
-    mapset = G_find_cell(raster, "");
-
-    /* open raster */
-    if (G_get_cellhd(raster, mapset, &cell) == -1)
-	return NULL;
-
-    mask_mapset = G_find_cell(mask, "");
-
-    /* open raster */
-    if (G_get_cellhd(mask, mask_mapset, &oldcell) == -1)
-	return NULL;
-
     tmp_file = G_tempfile();
     mask_fd = open(tmp_file, O_RDWR | O_CREAT, 0755);
+
+    /* mapset is used hold the mapset of input raster */
+    mask_mapset = G_find_cell(mask, "");
     old_fd = G_open_cell_old(mask, mask_mapset);
     old = G_allocate_cell_buf();
 
@@ -255,7 +245,7 @@
 
     for (i = 0; i < ad->rl; i++) {
 
-	G_get_map_row_nomask(old_fd, old, i + ad->y);
+	G_get_c_raster_row_nomask(old_fd, old, i + ad->y);
 	for (j = 0; j < ad->cl; j++) {
 
 	    /* NULL -> 0, else 1 */

Modified: grass/branches/develbranch_6/raster/r.li/r.li.shannon/shannon.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.shannon/shannon.c	2014-04-08 19:42:18 UTC (rev 59646)
+++ grass/branches/develbranch_6/raster/r.li/r.li.shannon/shannon.c	2014-04-08 19:47:26 UTC (rev 59647)
@@ -66,16 +66,9 @@
 
 int shannon(int fd, char **par, struct area_entry *ad, double *result)
 {
-    char *mapset;
     int ris = RLI_OK;
     double indice = 0;
-    struct Cell_head hd;
 
-    mapset = G_find_cell(ad->raster, "");
-    if (G_get_cellhd(ad->raster, mapset, &hd) == -1)
-	return RLI_ERRORE;
-
-
     switch (ad->data_type) {
     case CELL_TYPE:
 	{

Modified: grass/branches/develbranch_6/raster/r.li/r.li.simpson/simpson.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.simpson/simpson.c	2014-04-08 19:42:18 UTC (rev 59646)
+++ grass/branches/develbranch_6/raster/r.li/r.li.simpson/simpson.c	2014-04-08 19:47:26 UTC (rev 59647)
@@ -66,16 +66,9 @@
 
 int simpson(int fd, char **par, struct area_entry *ad, double *result)
 {
-    char *mapset;
     int ris = RLI_OK;
     double indice = 0;
-    struct Cell_head hd;
 
-    mapset = G_find_cell(ad->raster, "");
-    if (G_get_cellhd(ad->raster, mapset, &hd) == -1)
-	return RLI_ERRORE;
-
-
     switch (ad->data_type) {
     case CELL_TYPE:
 	{



More information about the grass-commit mailing list