[GRASS-SVN] r67661 - grass-addons/grass7/imagery/i.wi
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Jan 25 03:16:53 PST 2016
Author: ychemin
Date: 2016-01-25 03:16:53 -0800 (Mon, 25 Jan 2016)
New Revision: 67661
Modified:
grass-addons/grass7/imagery/i.wi/awei.c
grass-addons/grass7/imagery/i.wi/main.c
grass-addons/grass7/imagery/i.wi/wi.c
Log:
fixed typos
Modified: grass-addons/grass7/imagery/i.wi/awei.c
===================================================================
--- grass-addons/grass7/imagery/i.wi/awei.c 2016-01-25 11:08:11 UTC (rev 67660)
+++ grass-addons/grass7/imagery/i.wi/awei.c 2016-01-25 11:16:53 UTC (rev 67661)
@@ -10,7 +10,7 @@
*/
double awei_noshadow(double greenchan, double nirchan, double chan5chan)
{
- double result= 4 * (greenchan - chan5chan ) - (0.25 * nirchan + 2.75 * chan5chan )
+ double result= 4 * (greenchan - chan5chan ) - (0.25 * nirchan + 2.75 * chan5chan );
return result;
}
@@ -20,8 +20,8 @@
Sensing of Environment, 140, 23–35. http://dx.doi.org/10.1016/j.rse.2013.08.029.
* Landsat TM/ETM+ : b1 + 2.5 × b2 - 1.5 × (b4 + b5 ) - 0.25 × b7
*/
-double awei_shadow(double bluechan, double greenchan, double nirchan, double chan5chan, double band7chan)
+double awei_shadow(double bluechan, double greenchan, double nirchan, double chan5chan, double chan7chan)
{
- double result= bluechan + 2.5 * greenchan - 1.5 * (nirchan + chan5chan) - 0.25 * band7chan
+ double result= bluechan + 2.5 * greenchan - 1.5 * (nirchan + chan5chan) - 0.25 * chan7chan;
return result;
}
Modified: grass-addons/grass7/imagery/i.wi/main.c
===================================================================
--- grass-addons/grass7/imagery/i.wi/main.c 2016-01-25 11:08:11 UTC (rev 67660)
+++ grass-addons/grass7/imagery/i.wi/main.c 2016-01-25 11:16:53 UTC (rev 67661)
@@ -21,7 +21,7 @@
#include <grass/glocale.h>
double awei_noshadow(double greenchan, double nirchan, double chan5chan);
double awei_shadow(double bluechan, double greenchan, double nirchan, double chan5chan, double band7chan);
-double ls_wi(double nirchan, double swirchan);
+double ls_wi(double nirchan, double chan7chan);
double ndwi_mcfeeters(double greenchan, double nirchan);
double ndwi_xu(double greenchan, double chan5chan);
double tcw(double bluechan, double greenchan, double redchan, double nirchan, double chan5chan, double band7chan);
@@ -33,9 +33,10 @@
int nrows, ncols;
int row, col;
char *wiflag; /*Switch for particular index */
+ char *desc;
struct GModule *module;
struct {
- struct Option *viname, *red, *nir, *green, *blue, *chan5,
+ struct Option *winame, *red, *nir, *green, *blue, *chan5,
*chan7, *bits, *output;
} opt;
struct Flag *flag1;
@@ -49,7 +50,7 @@
char *bluechan, *greenchan, *redchan, *nirchan, *chan5chan, *chan7chan;
int i = 0, j = 0;
void *inrast_bluechan, *inrast_greenchan, *inrast_redchan;
- void *inrast_nirchan, *inrast_chan5chan, *inrast_chan7han;
+ void *inrast_nirchan, *inrast_chan5chan, *inrast_chan7chan;
DCELL * outrast;
RASTER_MAP_TYPE data_type_output = DCELL_TYPE;
@@ -75,7 +76,7 @@
opt.winame->description = _("Type of water index");
desc = NULL;
G_asprintf(&desc,
- "awei_noshadow;%s;awei_shadow;%s;lswi;%s;ndwi_McFeeters;%s;ndwi_Xu;%s;tcw;%s;",
+ "awei_ns;%s;awei_s;%s;lswi;%s;ndwi_mf;%s;ndwi_x;%s;tcw;%s;",
_("Automated Water Extraction Index - No Shadow"),
_("Automated Water Extraction Index - Shadow"),
_("Land Soil Water Index"),
@@ -144,7 +145,7 @@
if (G_parser(argc, argv))
exit(EXIT_FAILURE);
- wiflag = opt.viname->answer;
+ wiflag = opt.winame->answer;
redchan = opt.red->answer;
nirchan = opt.nir->answer;
greenchan = opt.green->answer;
@@ -360,7 +361,7 @@
Rast_set_d_null_value(&outrast[col], 1);
}
else {
- d = ls_wi(d_nirchan, d_swirchan);
+ d = ls_wi(d_nirchan, d_chan7chan);
((DCELL *) outrast)[col] = d;
}
}
@@ -370,7 +371,7 @@
Rast_set_d_null_value(&outrast[col], 1);
}
else {
- d = ndwi_mf(d_greenchan, d_nirchan);
+ d = ndwi_mcfeeters(d_greenchan, d_nirchan);
((DCELL *) outrast)[col] = d;
}
}
@@ -380,7 +381,7 @@
Rast_set_d_null_value(&outrast[col], 1);
}
else {
- d = ndwi_x(d_greenchan, d_chan5chan);
+ d = ndwi_xu(d_greenchan, d_chan5chan);
((DCELL *) outrast)[col] = d;
}
}
Modified: grass-addons/grass7/imagery/i.wi/wi.c
===================================================================
--- grass-addons/grass7/imagery/i.wi/wi.c 2016-01-25 11:08:11 UTC (rev 67660)
+++ grass-addons/grass7/imagery/i.wi/wi.c 2016-01-25 11:16:53 UTC (rev 67661)
@@ -6,8 +6,8 @@
* Adrian Fisher, Neil Flood, Tim Danaher, Comparing Landsat water index methods for automated water classification in eastern Australia, Remote Sensing of Environment, Volume 175, 15 March 2016, Pages 167-182, ISSN 0034-4257, http://dx.doi.org/10.1016/j.rse.2015.12.055.
* Landsat TM/ETM+ : 1.7204 + 171 b2 + 3 b3 - 70 b4 - 45 b5 - 71 b7
*/
-double wi( double greenchan, double redchan, double nirchan, double nirchan, double band7chan)
+double wi( double greenchan, double redchan, double nirchan, double chan5chan, double chan7chan)
{
- double result = 1.7204 + 171 * greenchan + 3 * redchan - 70 * nirchan - 45 * mirchan - 71 * band7chan;
+ double result = 1.7204 + 171 * greenchan + 3 * redchan - 70 * nirchan - 45 * chan5chan - 71 * chan7chan;
return result;
}
More information about the grass-commit
mailing list