[GRASS-SVN] r59074 - in grass/trunk/raster/r.li: r.li.edgedensity r.li.mpa r.li.mps r.li.renyi
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Feb 17 08:09:39 PST 2014
Author: mmetz
Date: 2014-02-17 08:09:38 -0800 (Mon, 17 Feb 2014)
New Revision: 59074
Modified:
grass/trunk/raster/r.li/r.li.edgedensity/edgedensity.c
grass/trunk/raster/r.li/r.li.mpa/mpa.c
grass/trunk/raster/r.li/r.li.mps/mps.c
grass/trunk/raster/r.li/r.li.renyi/renyi.c
Log:
r.li: bug fixes
Modified: grass/trunk/raster/r.li/r.li.edgedensity/edgedensity.c
===================================================================
--- grass/trunk/raster/r.li/r.li.edgedensity/edgedensity.c 2014-02-17 13:47:34 UTC (rev 59073)
+++ grass/trunk/raster/r.li/r.li.edgedensity/edgedensity.c 2014-02-17 16:09:38 UTC (rev 59074)
@@ -353,7 +353,7 @@
*result = somma * 10000 / area;
}
else
- Rast_set_d_null_value(result);
+ Rast_set_d_null_value(result, 1);
if (masked) {
close(mask_fd);
@@ -612,7 +612,7 @@
*result = somma * 10000 / area;
}
else
- Rast_set_d_null_value(result);
+ Rast_set_d_null_value(result, 1);
if (masked) {
close(mask_fd);
@@ -868,7 +868,7 @@
*result = somma * 10000 / area;
}
else
- Rast_set_d_null_value(result);
+ Rast_set_d_null_value(result, 1);
if (masked) {
close(mask_fd);
Modified: grass/trunk/raster/r.li/r.li.mpa/mpa.c
===================================================================
--- grass/trunk/raster/r.li/r.li.mpa/mpa.c 2014-02-17 13:47:34 UTC (rev 59073)
+++ grass/trunk/raster/r.li/r.li.mpa/mpa.c 2014-02-17 16:09:38 UTC (rev 59074)
@@ -146,7 +146,7 @@
if (area > 0)
*result = somma / area;
else
- Rast_set_d_null_value(result);
+ Rast_set_d_null_value(result, 1);
if (masked) {
close(mask_fd);
@@ -206,7 +206,7 @@
if (area > 0)
*result = somma / area;
else
- Rast_set_d_null_value(result);
+ Rast_set_d_null_value(result, 1);
if (masked) {
close(mask_fd);
@@ -265,7 +265,7 @@
if (area > 0)
*result = somma / area;
else
- Rast_set_d_null_value(result);
+ Rast_set_d_null_value(result, 1);
if (masked) {
close(mask_fd);
Modified: grass/trunk/raster/r.li/r.li.mps/mps.c
===================================================================
--- grass/trunk/raster/r.li/r.li.mps/mps.c 2014-02-17 13:47:34 UTC (rev 59073)
+++ grass/trunk/raster/r.li/r.li.mps/mps.c 2014-02-17 16:09:38 UTC (rev 59074)
@@ -310,7 +310,7 @@
area_units = (((EW_DIST1 + EW_DIST2) / 2) / hd.cols) *
(((NS_DIST1 + NS_DIST2) / 2) / hd.rows) * area;
- *result = (area_units / (npatch * 10000);
+ *result = area_units / (npatch * 10000);
}
else {
*result = 0;
@@ -533,7 +533,7 @@
area_units = (((EW_DIST1 + EW_DIST2) / 2) / hd.cols) *
(((NS_DIST1 + NS_DIST2) / 2) / hd.rows) * area;
- *result = (area_units / npatch) * 10000;
+ *result = area_units / (npatch * 10000);
}
else {
*result = 0;
@@ -756,7 +756,7 @@
area_units = (((EW_DIST1 + EW_DIST2) / 2) / hd.cols) *
(((NS_DIST1 + NS_DIST2) / 2) / hd.rows) * area;
- *result = (area_units / npatch) * 10000;
+ *result = area_units / (npatch * 10000);
}
else {
*result = 0;
Modified: grass/trunk/raster/r.li/r.li.renyi/renyi.c
===================================================================
--- grass/trunk/raster/r.li/r.li.renyi/renyi.c 2014-02-17 13:47:34 UTC (rev 59073)
+++ grass/trunk/raster/r.li/r.li.renyi/renyi.c 2014-02-17 16:09:38 UTC (rev 59074)
@@ -28,9 +28,9 @@
/* template is shannon */
-double calculate(struct area_entry *ad, int fd, char **par, double *result);
-double calculateD(struct area_entry *ad, int fd, char **par, double *result);
-double calculateF(struct area_entry *ad, int fd, char **par, double *result);
+int calculate(int fd, struct area_entry *ad, char **par, double *result);
+int calculateD(int fd, struct area_entry *ad, char **par, double *result);
+int calculateF(int fd, struct area_entry *ad, char **par, double *result);
int main(int argc, char *argv[])
{
@@ -95,17 +95,17 @@
switch (ad->data_type) {
case CELL_TYPE:
{
- ris = calculate(ad, fd, par, &indice);
+ ris = calculate(fd, ad, par, &indice);
break;
}
case DCELL_TYPE:
{
- ris = calculateD(ad, fd, par, &indice);
+ ris = calculateD(fd, ad, par, &indice);
break;
}
case FCELL_TYPE:
{
- ris = calculateF(ad, fd, par, &indice);
+ ris = calculateF(fd, ad, par, &indice);
break;
}
default:
@@ -125,7 +125,7 @@
}
-int calculate(int fd, struct area_entry *ad, double *result)
+int calculate(int fd, struct area_entry *ad, char **par, double *result)
{
CELL *buf;
CELL corrCell;
@@ -314,7 +314,7 @@
}
-int calculateD(int fd, struct area_entry *ad, double *result)
+int calculateD(int fd, struct area_entry *ad, char **par, double *result)
{
DCELL *buf;
DCELL corrCell;
@@ -503,7 +503,7 @@
}
-int calculateF(int fd, struct area_entry *ad, double *result)
+int calculateF(int fd, struct area_entry *ad, char **par, double *result)
{
FCELL *buf;
FCELL corrCell;
More information about the grass-commit
mailing list