[pktools] 156/375: changed examples in doc and some msknodata options

Bas Couwenberg sebastic at xs4all.nl
Wed Dec 3 21:54:09 UTC 2014


This is an automated email from the git hooks/post-receive script.

sebastic-guest pushed a commit to branch upstream-master
in repository pktools.

commit e8d8bb556612d04e5f856ef2332fb2534a58090f
Author: Pieter Kempeneers <kempenep at gmail.com>
Date:   Thu Dec 12 11:20:17 2013 +0100

    changed examples in doc and some msknodata options
---
 ChangeLog                  | 31 +++++++++++++++++++++++++-
 doc/examples_pkgetmask.dox |  6 +++---
 doc/examples_pkinfo.dox    |  4 ++--
 doc/examples_pkmosaic.dox  | 14 ++++++------
 doc/examples_pkndvi.dox    |  6 +++---
 doc/examples_pksetmask.dox | 20 ++++++++---------
 doc/examples_pkstat.dox    | 16 --------------
 src/apps/pkclassify_nn.cc  | 16 +++++++-------
 src/apps/pkclassify_svm.cc | 14 ++++++------
 src/apps/pkdiff.cc         |  2 +-
 src/apps/pkextract.cc      | 54 +++++++++++++++++++++++-----------------------
 src/apps/pkstatascii.cc    | 10 ++++-----
 12 files changed, 103 insertions(+), 90 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 347ce8d..c9b3275 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -175,5 +175,34 @@ version 2.4.2
 	support of transposed output
 
 version 2.4.3
-	consistently use nodata, srcnodata, dstnodata and msknodata instead of invalid, mvalue, flag options
+ - pkclassify_nn
+	option msknodata and nodata to set nodata value in mask and classified image
+ - pkclassify_svm
+	option msknodata and nodata to set nodata value in mask and classified image
+ - pkcrop
+	option nodata to set nodata value
+ - pkdiff
+	option nodata to set nodata value
+ - pkenhance
+	option nodata to set nodata value
+ - pkgetmask
+	option nodata to set nodata value
+ - pkinfo
+	option nodata to set nodata value
+ - pklas2img
+	option nodata to set nodata value
+ - pkndvi
+	option nodata to set nodata value
+ - pkreclass
+	option nodata to set nodata value
+ - pksetmask
+	option nodata to set nodata value
+ - pkdumpimg
+	option srcnodata and dstnodata to set nodata value in source and destination image
+ - pkmosaic
+	option srcnodata and dstnodata to set nodata value in source and destination image
+ - pkextract
+	option msknodata to set nodata value in mask
+ - pksetmask
+	option msknodata to set nodata value in mask
 
diff --git a/doc/examples_pkgetmask.dox b/doc/examples_pkgetmask.dox
index 70ba325..fd37ac9 100644
--- a/doc/examples_pkgetmask.dox
+++ b/doc/examples_pkgetmask.dox
@@ -1,11 +1,11 @@
 \section examples_pkgetmask Examples of pkgetmask
 \code
-pkgetmask -i input.tif -o output.tif --min 0 -t 1 -f 0
+pkgetmask -i input.tif -o output.tif -min 0 -nodata 0 -data 1
 \endcode
 create mask, setting all negative values to 0 (rest to 1)
 
 \code
-pkgetmask -i input.tif -o output.tif --min 0 --max 10 --min 0 --max 250 -b 0 -b 1
+pkgetmask -i input.tif -o output.tif -min 0 -max 10 -min 0 -max 250 -b 0 -b 1
 \endcode
-create mask. Mask is set to 0 (default value for -f) if either band 0 is not between 0 and 10 OR (default operator) band 1 is not between 0 and 250. Else mask is set to 1 (default value for -t) 
+create mask. Mask is set to 0 (default value for -nodata) if either band 0 is not between 0 and 10 OR (default operator) band 1 is not between 0 and 250. Else mask is set to 1 (default value for -data) 
 
diff --git a/doc/examples_pkinfo.dox b/doc/examples_pkinfo.dox
index 0d88816..e675524 100644
--- a/doc/examples_pkinfo.dox
+++ b/doc/examples_pkinfo.dox
@@ -36,11 +36,11 @@ pkinfo -i image1.tif --mask 0 --mask 255 -ref
 show the refence pixel (centre of gravity) for image1.tif, treating 0 and 255 as NO VALUE
 
 \code
-pkinfo -i image.tif $(pkinfo -i image.tif -c
+pkinfo -i image.tif $(pkinfo -i image.tif -c) -geo -r
 \endcode
 read (dump) pixel value at image centre for band 0
 
 \code
-pkinfo $(for IMAGE in *.tif; do pkinfo -i $IMAGE --cover -x 3528120 -y 4329681;done) -x 3528120 -y 4329681 -geo -r
+pkinfo $(for IMAGE in modis_2010*.tif; do pkinfo -i $IMAGE --cover -x 4215500 -y 2534000;done) -x 4215500 -y 253400
 \endcode
 read (dump) pixel value in band 0 (default) for all images in current directory that cover this geographic location  
diff --git a/doc/examples_pkmosaic.dox b/doc/examples_pkmosaic.dox
index f6b0baa..351ea9e 100644
--- a/doc/examples_pkmosaic.dox
+++ b/doc/examples_pkmosaic.dox
@@ -5,22 +5,22 @@ pkmosaic -i input1.tif -i input2.tif -o output.tif
 create mosaic from two input images. If images overlap, keep only last image (default rule)
 
 \code
-pkmosaic -i input1.tif -i input2.tif -o output.tif -m 4 --validBand 1 -t 255 -f 0
+pkmosaic -i input1.tif -i input2.tif -o output.tif --validBand 1 -srcnodata 255 -dstnodata 0
 \endcode
-create mosaic from two input images. Values of 255 in band 1 (starting from 0) are masked as invalid (rule=4). Typical use when multi-band image contains cloud mask
+create mosaic from two input images. Values of 255 in band 1 (starting from 0) are masked as invalid. Typically used when multi-band image contains cloud mask
 
 \code
-pkmosaic -i input1.tif -i input2.tif -o output.tif -m 1 --rband=0 --rband=1 -t 255 -f 0
+pkmosaic -i input1.tif -i input2.tif -o output.tif -cr maxndvi -rb 0 -rb 1 -srcnodata 255 -dstnodata 0
 \endcode
-create maximum NDVI (normalized difference vegetation index) composit. Values of 255 in band 0 (default) are masked as invalid and flagged as 0 if no other valid coverage. Typical use for (e.g., MODIS) images where red and near infrared spectral bands are stored in bands 0 and 1 respectively
+create maximum NDVI (normalized difference vegetation index) composit. Values of 255 in band 0 (default) are masked as invalid and flagged as 0 if no other valid coverage. Typically used for (e.g., MODIS) images where red and near infrared spectral bands are stored in bands 0 and 1 respectively
 
 \code
-pkmosaic -i input1.tif -i input2.tif -i input3.tif -o output.tif -m 5 -w 0.75 -w 1.5 -w 0.75
+pkmosaic -i input1.tif -i input2.tif -i input3.tif -o output.tif -cr mean -w 0.75 -w 1.5 -w 0.75
 \endcode
 create composite image using weighted mean: output=(3/4*input1+6/4*input2+3/4*input2)/3.0
 
 \code
-pkmosaic -i large.tif $(for IMAGE in *.tif;do pkinfo -i $IMAGE --cover $(pkinfo -i coverage.tif -bb);done) -m 4 -min 0 -o output.tif
+pkmosaic -i large.tif $(for IMAGE in *.tif;do pkinfo -i $IMAGE --cover $(pkinfo -i coverage.tif -bb);done) -cr median -min 0 -o output.tif
 \endcode
-create composit of all images found in current directory that cover (part of) coverage.tif. Values smaller or equal to 0 are invalid and flagged as 0 (default flag value)
+create median composit of all GTiff images found in current directory that cover (at least part of) coverage.tif. Values smaller or equal to 0 are set as nodatas 0 (default value for -dstnodata)
 
diff --git a/doc/examples_pkndvi.dox b/doc/examples_pkndvi.dox
index 86fb272..fe4d2a1 100644
--- a/doc/examples_pkndvi.dox
+++ b/doc/examples_pkndvi.dox
@@ -1,5 +1,5 @@
-\section examples_pkpolygonize Examples of pkpolygonize
+\section examples_pkndvi Examples of pkndvi
 \code
-pkpolygonize -i input.tif -m input.tif -o ouput.shp
+pkndvi -i input.tif -b 0 -b 1 -r ndvi -o ndvi.tif
 \endcode
-create vector file from raster image (typically a classification image), based on pixel (land cover class) values. 
+create normalized difference vegetation index (NDVI) from input image, where band 0 and 1 contain the reflectances in red and near infrared respectively
diff --git a/doc/examples_pksetmask.dox b/doc/examples_pksetmask.dox
index f152088..22083ed 100644
--- a/doc/examples_pksetmask.dox
+++ b/doc/examples_pksetmask.dox
@@ -2,47 +2,47 @@
 
 \section single_mask Using a single mask
 
-With a single mask you can provide as many triples (--operator, --invalid, --flag) as you wish. All operators work simultaneously on that mask. Caution: the first operator that tests true will be selected. This is explained in the next example:
+With a single mask you can provide as many triples (--operator, --msknodata, --nodata) as you wish. All operators work simultaneously on that mask. Caution: the first operator that tests true will be selected. This is explained in the next example:
 
 \code
-pksetmask -i input.tif -m mask.tif --operator='>' --invalid 0 --flag 0 --operator='>' --invalid 10 --flag 10 -o output.tif
+pksetmask -i input.tif -m mask.tif --operator='>' --msknodata 0 --nodata 0 --operator='>' --msknodata 10 --nodata 10 -o output.tif
 \endcode
 Warning: second operator will never test true as first will supersede!
 \code
-pksetmask -i input.tif -m mask.tif --operator='>' --invalid 10 --flag 10 --operator='>' --invalid 0 --flag 1 -output.tif
+pksetmask -i input.tif -m mask.tif --operator='>' --msknodata 10 --nodata 10 --operator='>' --msknodata 0 --nodata 1 -output.tif
 \endcode
 OK: values above 10 will be 10, values between 0 and 10 will be 1
 
 \section multiple_masks Using multiple masks
-With multiple masks, you can use one triple (--operator, --invalid, --flag) for each corresponding mask (following the same order of input). If the number of triples is not equal to the number of masks, then only the first triple is used for all masks simultaneously
+With multiple masks, you can use one triple (--operator, --msknodata, --nodata) for each corresponding mask (following the same order of input). If the number of triples is not equal to the number of masks, then only the first triple is used for all masks simultaneously
 \code
-pksetmask -i input.tif -m mask1.tif --operator '>' --invalid 250 --flag 1 -m mask2.tif --operator '>' --invalid 100 --flag 2 -o output.tif
+pksetmask -i input.tif -m mask1.tif --operator '>' --msknodata 250 --nodata 1 -m mask2.tif --operator '>' --msknodata 100 --nodata 2 -o output.tif
 \endcode
 If mask1.tif is above 250, the output will be 1. If mask2 is above 100, the output will be 2. If both operators test true, the first will supersede (output will be 1)
 
 \code
-pksetmask -i input.tif -m mask1.tif -m mask1.tif --operator '>' --invalid 250 --flag 1 -o output.tif
+pksetmask -i input.tif -m mask1.tif -m mask2.tif --operator '>' --msknodata 250 --nodata 1 -o output.tif
 \endcode
 If either mask1.tif or mask2.tif is above 250, the output will be 1
 
 \section more_examples More examples
 
 \code
-pksetmask -i input.tif -m mask.tif -o output.tif -ot Byte -t 0 -f 255
+pksetmask -i input.tif -m mask.tif -o output.tif -ot Byte --msknodata 0 -nodata 255
 \endcode
 copy pixel values from input.tif to output.tif, applying mask.tif, setting all values to 255 where mask is 0.
 
 \code
-pksetmask -i input.tif -m mask.tif -o output.tif -ot Byte -t 1 -f 255 --operator '!'
+pksetmask -i input.tif -m mask.tif -o output.tif -ot Byte --msknodata 1 -nodata 255 --operator '!'
 \endcode
 copy values from input.tif to output.tif, but set all values to 255 if mask is not 1
 
 \code
-pksetmask -i input.tif -m mask1.tif -m mask2.tif -o output.tif -ot Byte -t 0 -f 255
+pksetmask -i input.tif -m mask1.tif -m mask2.tif -o output.tif -ot Byte --msknodata 0 -nodata 255
 \endcode
 Application of two masks. Copy pixel values from input.tif to output.tif, setting all values to 255 where either mask is 0.
 
 \code
-pksetmask -i input.tif -m mask.tif -o output.tif -ot Byte -t 0 -t 1 -f 255 -f 255
+pksetmask -i input.tif -m mask.tif -o output.tif -ot Byte --msknodata 0 --msknodata 1 -nodata 255 -nodata 255
 \endcode
 copy pixel values from input.tif to output.tif, applying single masks, setting all values to 255 where mask is either 0 or 1.
\ No newline at end of file
diff --git a/doc/examples_pkstat.dox b/doc/examples_pkstat.dox
deleted file mode 100644
index 2b33448..0000000
--- a/doc/examples_pkstat.dox
+++ /dev/null
@@ -1,16 +0,0 @@
-\section examples_pkstat Examples of pkstat
-\code
-pkstat -i input.txt -n
-\endcode
-count number of records (same as wc -l input.txt)
-
-\code
-pkstat -i input.txt -hist -bin 100 -c 1 -rel
-\endcode
-report relative histogram in second column (starting from 0) using 100 bins.
-
-\code
-pkstat -i input.txt -m -c 0 -c 1
-\endcode
-report mean value of colums 0 and 1. 
-
diff --git a/src/apps/pkclassify_nn.cc b/src/apps/pkclassify_nn.cc
index 147c639..419b27a 100644
--- a/src/apps/pkclassify_nn.cc
+++ b/src/apps/pkclassify_nn.cc
@@ -60,7 +60,7 @@ int main(int argc, char *argv[])
   Optionpk<int> bagSize_opt("bs", "bsize", "Percentage of features used from available training features for each bootstrap aggregation (one size for all classes, or a different size for each class respectively", 100);
   Optionpk<string> classBag_opt("cb", "classbag", "output for each individual bootstrap aggregation (default is blank)"); 
   Optionpk<string> mask_opt("m", "mask", "mask image (see also mvalue option (default is no mask)"); 
-  Optionpk<short> mask_nodata_opt("mask_nodata", "mask_nodata", "mask value(s) not to consider for classification (use negative values if only these values should be taken into account). Values will be taken over in classification image. Default is 0", 0);
+  Optionpk<short> msknodata_opt("msknodata", "msknodata", "mask value(s) not to consider for classification (use negative values if only these values should be taken into account). Values will be taken over in classification image. Default is 0", 0);
   Optionpk<unsigned short> nodata_opt("nodata", "nodata", "nodata value to put where image is masked as nodata", 0);
   Optionpk<string> output_opt("o", "output", "output classification image"); 
   Optionpk<string>  otype_opt("ot", "otype", "Data type for output image ({Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/CInt16/CInt32/CFloat32/CFloat64}). Empty string: inherit type from input image");
@@ -101,7 +101,7 @@ int main(int argc, char *argv[])
     bagSize_opt.retrieveOption(argc,argv);
     classBag_opt.retrieveOption(argc,argv);
     mask_opt.retrieveOption(argc,argv);
-    mask_nodata_opt.retrieveOption(argc,argv);
+    msknodata_opt.retrieveOption(argc,argv);
     nodata_opt.retrieveOption(argc,argv);
     output_opt.retrieveOption(argc,argv);
     otype_opt.retrieveOption(argc,argv);
@@ -757,17 +757,17 @@ int main(int argc, char *argv[])
         bool masked=false;
         if(!lineMask.empty()){
           short theMask=0;
-          for(short ivalue=0;ivalue<mask_nodata_opt.size();++ivalue){
-            if(mask_nodata_opt[ivalue]>=0){//values set in mask_nodata_opt are invalid
-              if(lineMask[icol]==mask_nodata_opt[ivalue]){
+          for(short ivalue=0;ivalue<msknodata_opt.size();++ivalue){
+            if(msknodata_opt[ivalue]>=0){//values set in msknodata_opt are invalid
+              if(lineMask[icol]==msknodata_opt[ivalue]){
                 theMask=lineMask[icol];
                 masked=true;
                 break;
               }
             }
-            else{//only values set in mask_nodata_opt are valid
-              if(lineMask[icol]!=-mask_nodata_opt[ivalue]){
-                  theMask=(nodata_opt.size()==mask_nodata_opt.size())? nodata_opt[ivalue] : nodata_opt[0];// lineMask[icol];
+            else{//only values set in msknodata_opt are valid
+              if(lineMask[icol]!=-msknodata_opt[ivalue]){
+                  theMask=(nodata_opt.size()==msknodata_opt.size())? nodata_opt[ivalue] : nodata_opt[0];// lineMask[icol];
                 masked=true;
               }
               else{
diff --git a/src/apps/pkclassify_svm.cc b/src/apps/pkclassify_svm.cc
index e9bd63d..8a1e2f1 100644
--- a/src/apps/pkclassify_svm.cc
+++ b/src/apps/pkclassify_svm.cc
@@ -77,7 +77,7 @@ int main(int argc, char *argv[])
   Optionpk<int> bagSize_opt("bs", "bsize", "Percentage of features used from available training features for each bootstrap aggregation (one size for all classes, or a different size for each class respectively", 100);
   Optionpk<string> classBag_opt("cb", "classbag", "output for each individual bootstrap aggregation");
   Optionpk<string> mask_opt("m", "mask", "mask image (see also mvalue option"); 
-  Optionpk<short> mask_nodata_opt("mask_nodata", "mask_nodata", "mask value(s) not to consider for classification (use negative values if only these values should be taken into account). Values will be taken over in classification image.", 0);
+  Optionpk<short> msknodata_opt("msknodata", "msknodata", "mask value(s) not to consider for classification (use negative values if only these values should be taken into account). Values will be taken over in classification image.", 0);
   Optionpk<unsigned short> nodata_opt("nodata", "nodata", "nodata value to put where image is masked as nodata", 0);
   Optionpk<string> output_opt("o", "output", "output classification image"); 
   Optionpk<string>  oformat_opt("of", "oformat", "Output image format (see also gdal_translate). Empty string: inherit from input image");
@@ -123,7 +123,7 @@ int main(int argc, char *argv[])
     bagSize_opt.retrieveOption(argc,argv);
     classBag_opt.retrieveOption(argc,argv);
     mask_opt.retrieveOption(argc,argv);
-    mask_nodata_opt.retrieveOption(argc,argv);
+    msknodata_opt.retrieveOption(argc,argv);
     nodata_opt.retrieveOption(argc,argv);
     output_opt.retrieveOption(argc,argv);
     oformat_opt.retrieveOption(argc,argv);
@@ -742,16 +742,16 @@ int main(int argc, char *argv[])
         bool masked=false;
         if(!lineMask.empty()){
           short theMask=0;
-          for(short ivalue=0;ivalue<mask_nodata_opt.size();++ivalue){
-            if(mask_nodata_opt[ivalue]>=0){//values set in mask_nodata_opt are invalid
-              if(lineMask[icol]==mask_nodata_opt[ivalue]){
+          for(short ivalue=0;ivalue<msknodata_opt.size();++ivalue){
+            if(msknodata_opt[ivalue]>=0){//values set in msknodata_opt are invalid
+              if(lineMask[icol]==msknodata_opt[ivalue]){
                 theMask=lineMask[icol];
                 masked=true;
                 break;
               }
             }
-            else{//only values set in mask_nodata_opt are valid
-              if(lineMask[icol]!=-mask_nodata_opt[ivalue]){
+            else{//only values set in msknodata_opt are valid
+              if(lineMask[icol]!=-msknodata_opt[ivalue]){
                 theMask=lineMask[icol];
                 masked=true;
               }
diff --git a/src/apps/pkdiff.cc b/src/apps/pkdiff.cc
index 54d1fb5..a007699 100644
--- a/src/apps/pkdiff.cc
+++ b/src/apps/pkdiff.cc
@@ -30,7 +30,7 @@ int main(int argc, char *argv[])
   Optionpk<string> input_opt("i", "input", "Input image file.");
   Optionpk<string> reference_opt("ref", "reference", "Reference image file");
   Optionpk<string> output_opt("o", "output", "Output image file. Default is empty: no output image, only report difference or identical.");
-  Optionpk<string> mask_opt("m", "mask", "Mask image file. A single mask is supported only, but several mask values can be used. See also mask_nodata option. (default is empty)");
+  Optionpk<string> mask_opt("m", "mask", "Mask image file. A single mask is supported only, but several mask values can be used. See also msknodata option. (default is empty)");
   Optionpk<int> masknodata_opt("msknodata", "msknodata", "Mask value(s) where image is invalid. Use negative value for valid data (example: use -t -1: if only -1 is valid value)", 0);
   Optionpk<string> colorTable_opt("ct", "ct", "color table (file with 5 columns: id R G B ALFA (0: transparent, 255: solid)");
   Optionpk<short> valueE_opt("\0", "correct", "Value for correct pixels (0)", 0);
diff --git a/src/apps/pkextract.cc b/src/apps/pkextract.cc
index 661afd9..189af23 100644
--- a/src/apps/pkextract.cc
+++ b/src/apps/pkextract.cc
@@ -42,7 +42,7 @@ int main(int argc, char *argv[])
   Optionpk<string> image_opt("i", "image", "Input image file");
   Optionpk<string> sample_opt("s", "sample", "Input sample file (shape) or class file (e.g. Corine CLC) if class option is set");
   Optionpk<string> mask_opt("m", "mask", "Mask image file");
-  Optionpk<int> mask_nodata_opt("mask_nodata", "mask_nodata", "Mask value where image is invalid. If a single mask is used, more nodata values can be set. If more masks are used, use one value for each mask.", 1);
+  Optionpk<int> msknodata_opt("msknodata", "msknodata", "Mask value where image is invalid. If a single mask is used, more nodata values can be set. If more masks are used, use one value for each mask.", 1);
   Optionpk<int> class_opt("c", "class", "Class(es) to extract from input sample image. Use -1 to process every class in sample image, or leave empty to extract all valid data pixels from sample file");
   Optionpk<string> output_opt("o", "output", "Output sample file (image file)");
   Optionpk<string> test_opt("test", "test", "Test sample file (use this option in combination with threshold<100 to create a training (output) and test set");
@@ -70,7 +70,7 @@ int main(int argc, char *argv[])
     doProcess=image_opt.retrieveOption(argc,argv);
     sample_opt.retrieveOption(argc,argv);
     mask_opt.retrieveOption(argc,argv);
-    mask_nodata_opt.retrieveOption(argc,argv);
+    msknodata_opt.retrieveOption(argc,argv);
     class_opt.retrieveOption(argc,argv);
     output_opt.retrieveOption(argc,argv);
     test_opt.retrieveOption(argc,argv);
@@ -349,10 +349,10 @@ int main(int argc, char *argv[])
                   }
                 }
                 int ivalue=0;
-                if(mask_opt.size()==mask_nodata_opt.size())//one invalid value for each mask
-                  ivalue=static_cast<int>(mask_nodata_opt[imask]);
+                if(mask_opt.size()==msknodata_opt.size())//one invalid value for each mask
+                  ivalue=static_cast<int>(msknodata_opt[imask]);
                 else//use same invalid value for each mask
-                  ivalue=static_cast<int>(mask_nodata_opt[0]);
+                  ivalue=static_cast<int>(msknodata_opt[0]);
                 if(maskBuffer[imask][colMask]==ivalue){
                   valid=false;
                   break;
@@ -378,8 +378,8 @@ int main(int argc, char *argv[])
                     oldmaskrow[0]=rowMask;
                   }
                 }
-                for(int ivalue=0;ivalue<mask_nodata_opt.size();++ivalue){
-                  if(maskBuffer[0][colMask]==static_cast<int>(mask_nodata_opt[ivalue])){
+                for(int ivalue=0;ivalue<msknodata_opt.size();++ivalue){
+                  if(maskBuffer[0][colMask]==static_cast<int>(msknodata_opt[ivalue])){
                     valid=false;
                     break;
                   }
@@ -598,10 +598,10 @@ int main(int argc, char *argv[])
                   }
                 }
                 int ivalue=0;
-                if(mask_opt.size()==mask_nodata_opt.size())//one invalid value for each mask
-                  ivalue=static_cast<int>(mask_nodata_opt[imask]);
+                if(mask_opt.size()==msknodata_opt.size())//one invalid value for each mask
+                  ivalue=static_cast<int>(msknodata_opt[imask]);
                 else//use same invalid value for each mask
-                  ivalue=static_cast<int>(mask_nodata_opt[0]);
+                  ivalue=static_cast<int>(msknodata_opt[0]);
                 if(maskBuffer[imask][colMask]==ivalue){
                   valid=false;
                   break;
@@ -627,8 +627,8 @@ int main(int argc, char *argv[])
                     oldmaskrow[0]=rowMask;
                   }
                 }
-                for(int ivalue=0;ivalue<mask_nodata_opt.size();++ivalue){
-                  if(maskBuffer[0][colMask]==static_cast<int>(mask_nodata_opt[ivalue])){
+                for(int ivalue=0;ivalue<msknodata_opt.size();++ivalue){
+                  if(maskBuffer[0][colMask]==static_cast<int>(msknodata_opt[ivalue])){
                     valid=false;
                     break;
                   }
@@ -915,10 +915,10 @@ int main(int argc, char *argv[])
                 }
                 //               char ivalue=0;
                 int ivalue=0;
-                if(mask_opt.size()==mask_nodata_opt.size())//one invalid value for each mask
-                  ivalue=static_cast<int>(mask_nodata_opt[imask]);
+                if(mask_opt.size()==msknodata_opt.size())//one invalid value for each mask
+                  ivalue=static_cast<int>(msknodata_opt[imask]);
                 else//use same invalid value for each mask
-                  ivalue=static_cast<int>(mask_nodata_opt[0]);
+                  ivalue=static_cast<int>(msknodata_opt[0]);
                 if(maskBuffer[imask][colMask]==ivalue){
                   valid=false;
                   break;
@@ -948,8 +948,8 @@ int main(int argc, char *argv[])
                     oldmaskrow[0]=rowMask;
                   }
                 }
-                for(int ivalue=0;ivalue<mask_nodata_opt.size();++ivalue){
-                  if(maskBuffer[0][colMask]==static_cast<int>(mask_nodata_opt[ivalue])){
+                for(int ivalue=0;ivalue<msknodata_opt.size();++ivalue){
+                  if(maskBuffer[0][colMask]==static_cast<int>(msknodata_opt[ivalue])){
                     valid=false;
                     break;
                   }
@@ -1267,10 +1267,10 @@ int main(int argc, char *argv[])
                       }
                       //               char ivalue=0;
                       int ivalue=0;
-                      if(mask_opt.size()==mask_nodata_opt.size())//one invalid value for each mask
-                        ivalue=static_cast<int>(mask_nodata_opt[imask]);
+                      if(mask_opt.size()==msknodata_opt.size())//one invalid value for each mask
+                        ivalue=static_cast<int>(msknodata_opt[imask]);
                       else//use same invalid value for each mask
-                        ivalue=static_cast<int>(mask_nodata_opt[0]);
+                        ivalue=static_cast<int>(msknodata_opt[0]);
                       if(maskBuffer[imask][colMask]==ivalue){
                         valid=false;
                         break;
@@ -1302,8 +1302,8 @@ int main(int argc, char *argv[])
                           oldmaskrow[0]=rowMask;
                         }
                       }
-                      for(int ivalue=0;ivalue<mask_nodata_opt.size();++ivalue){
-                        if(maskBuffer[0][colMask]==static_cast<int>(mask_nodata_opt[ivalue])){
+                      for(int ivalue=0;ivalue<msknodata_opt.size();++ivalue){
+                        if(maskBuffer[0][colMask]==static_cast<int>(msknodata_opt[ivalue])){
                           valid=false;
                           break;
                         }
@@ -1882,10 +1882,10 @@ int main(int argc, char *argv[])
                       }
                       //               char ivalue=0;
                       int ivalue=0;
-                      if(mask_opt.size()==mask_nodata_opt.size())//one invalid value for each mask
-                        ivalue=static_cast<int>(mask_nodata_opt[imask]);
+                      if(mask_opt.size()==msknodata_opt.size())//one invalid value for each mask
+                        ivalue=static_cast<int>(msknodata_opt[imask]);
                       else//use same invalid value for each mask
-                        ivalue=static_cast<int>(mask_nodata_opt[0]);
+                        ivalue=static_cast<int>(msknodata_opt[0]);
                       if(maskBuffer[imask][colMask]==ivalue){
                         valid=false;
                         break;
@@ -1917,8 +1917,8 @@ int main(int argc, char *argv[])
                           oldmaskrow[0]=rowMask;
                         }
                       }
-                      for(int ivalue=0;ivalue<mask_nodata_opt.size();++ivalue){
-                        if(maskBuffer[0][colMask]==static_cast<int>(mask_nodata_opt[ivalue])){
+                      for(int ivalue=0;ivalue<msknodata_opt.size();++ivalue){
+                        if(maskBuffer[0][colMask]==static_cast<int>(msknodata_opt[ivalue])){
                           valid=false;
                           break;
                         }
diff --git a/src/apps/pkstatascii.cc b/src/apps/pkstatascii.cc
index b3404d8..6d6643d 100644
--- a/src/apps/pkstatascii.cc
+++ b/src/apps/pkstatascii.cc
@@ -40,23 +40,23 @@ int main(int argc, char *argv[])
   Optionpk<std::string> randdist_opt("dist", "dist", "distribution for generating random numbers, see http://www.gn/software/gsl/manual/gsl-ref_toc.html#TOC320 (only uniform and Gaussian supported yet)", "gaussian");
   Optionpk<double> randa_opt("rnda", "rnda", "first parameter for random distribution (standard deviation in case of Gaussian)", 1);
   Optionpk<double> randb_opt("rndb", "rndb", "second parameter for random distribution (standard deviation in case of Gaussian)", 0);
-  Optionpk<bool> mean_opt("m","mean","calculate median",false);
-  Optionpk<bool> median_opt("med","median","calculate median",false);
+  Optionpk<bool> mean_opt("mean","mean","calculate median",false);
+  Optionpk<bool> median_opt("median","median","calculate median",false);
   Optionpk<bool> var_opt("var","var","calculate variance",false);
   Optionpk<bool> skewness_opt("skew","skewness","calculate skewness",false);
   Optionpk<bool> kurtosis_opt("kurt","kurtosis","calculate kurtosis",false);
   Optionpk<bool> stdev_opt("stdev","stdev","calculate standard deviation",false);
-  Optionpk<bool> sum_opt("s","sum","calculate sum of column",false);
+  Optionpk<bool> sum_opt("sum","sum","calculate sum of column",false);
   Optionpk<bool> minmax_opt("mm","minmax","calculate minimum and maximum value",false);
   Optionpk<double> min_opt("min","min","set minimum value",0);
   Optionpk<double> max_opt("max","max","set maximum value",0);
   Optionpk<bool> histogram_opt("hist","hist","calculate histogram",false);
   Optionpk<bool> histogram2d_opt("hist2d","hist2d","calculate 2-dimensional histogram based on two columns",false);
-  Optionpk<short> nbin_opt("bin","bin","number of bins to calculate histogram",0);
+  Optionpk<short> nbin_opt("nbin","nbin","number of bins to calculate histogram",0);
   Optionpk<bool> relative_opt("rel","relative","use percentiles for histogram to calculate histogram",false);
   Optionpk<double> kde_opt("kde","kde","bandwith of kernel density when producing histogram, use 0 for practical estimation based on Silverman's rule of thumb");
   Optionpk<bool> correlation_opt("cor","correlation","calculate Pearson produc-moment correlation coefficient between two columns (defined by -c <col1> -c <col2>",false);
-  Optionpk<bool> rmse_opt("e","rmse","calculate root mean square error between two columns (defined by -c <col1> -c <col2>",false);
+  Optionpk<bool> rmse_opt("rmse","rmse","calculate root mean square error between two columns (defined by -c <col1> -c <col2>",false);
   Optionpk<bool> reg_opt("reg","regression","calculate linear regression error between two columns (defined by -c <col1> -c <col2>",false);
   Optionpk<short> verbose_opt("v", "verbose", "verbose mode when > 0", 0);
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/pktools.git



More information about the Pkg-grass-devel mailing list