فهرست منبع

Add mod(x,y) function to r.mapcalc and r3.mapcalc doc (#1617)

* Add mod(x,y) function to r.mapcalc doc

* Add mod(x,y) function to r3.mapcalc doc

* Add mod(x,y) to r.mapcalc wx functions list

* Solve conflicts in gui/wxpython/modules/mcalc_builder.py
Andrea Giudiceandrea 3 سال پیش
والد
کامیت
cea980fea0
3فایلهای تغییر یافته به همراه54 افزوده شده و 51 حذف شده
  1. 52 51
      gui/wxpython/modules/mcalc_builder.py
  2. 1 0
      raster/r.mapcalc/r.mapcalc.html
  3. 1 0
      raster/r.mapcalc/r3.mapcalc.html

+ 52 - 51
gui/wxpython/modules/mcalc_builder.py

@@ -74,54 +74,55 @@ class MapCalcFrame(wx.Frame):
         #
         #
         self.heading = _('mapcalc statement')
         self.heading = _('mapcalc statement')
         self.funct_dict = {
         self.funct_dict = {
-            'abs(x)': 'abs()',
-            'acos(x)': 'acos()',
-            'asin(x)': 'asin()',
-            'atan(x)': 'atan()',
-            'atan(x,y)': 'atan( , )',
-            'cos(x)': 'cos()',
-            'double(x)': 'double()',
-            'eval([x,y,...,]z)': 'eval()',
-            'exp(x)': 'exp()',
-            'exp(x,y)': 'exp( , )',
-            'float(x)': 'float()',
-            'graph(x,x1,y1[x2,y2..])': 'graph( , , )',
-            'if(x)': 'if()',
-            'if(x,a)': 'if( , )',
-            'if(x,a,b)': 'if( , , )',
-            'if(x,a,b,c)': 'if( , , , )',
-            'int(x)': 'int()',
-            'isnull(x)': 'isnull()',
-            'log(x)': 'log(',
-            'log(x,b)': 'log( , )',
-            'max(x,y[,z...])': 'max( , )',
-            'median(x,y[,z...])': 'median( , )',
-            'min(x,y[,z...])': 'min( , )',
-            'mode(x,y[,z...])': 'mode( , )',
-            'nmax(x,y[,z...])': 'nmax( , )',
-            'nmedian(x,y[,z...])': 'nmedian( , )',
-            'nmin(x,y[,z...])': 'nmin( , )',
-            'nmode(x,y[,z...])': 'nmode( , )',
-            'not(x)': 'not()',
-            'pow(x,y)': 'pow( , )',
-            'rand(a,b)': 'rand( , )',
-            'round(x)': 'round()',
-            'round(x,y)': 'round( , )',
-            'round(x,y,z)': 'round( , , )',
-            'sin(x)': 'sin()',
-            'sqrt(x)': 'sqrt()',
-            'tan(x)': 'tan()',
-            'xor(x,y)': 'xor( , )',
-            'row()': 'row()',
-            'col()': 'col()',
-            'nrows()': 'nrows()',
-            'ncols()': 'ncols()',
-            'x()': 'x()',
-            'y()': 'y()',
-            'ewres()': 'ewres()',
-            'nsres()': 'nsres()',
-            'area()': 'area()',
-            'null()': 'null()'
+            "abs(x)": "abs()",
+            "acos(x)": "acos()",
+            "asin(x)": "asin()",
+            "atan(x)": "atan()",
+            "atan(x,y)": "atan( , )",
+            "cos(x)": "cos()",
+            "double(x)": "double()",
+            "eval([x,y,...,]z)": "eval()",
+            "exp(x)": "exp()",
+            "exp(x,y)": "exp( , )",
+            "float(x)": "float()",
+            "graph(x,x1,y1[x2,y2..])": "graph( , , )",
+            "if(x)": "if()",
+            "if(x,a)": "if( , )",
+            "if(x,a,b)": "if( , , )",
+            "if(x,a,b,c)": "if( , , , )",
+            "int(x)": "int()",
+            "isnull(x)": "isnull()",
+            "log(x)": "log(",
+            "log(x,b)": "log( , )",
+            "max(x,y[,z...])": "max( , )",
+            "median(x,y[,z...])": "median( , )",
+            "min(x,y[,z...])": "min( , )",
+            "mod(x,y)": "mod( , )",
+            "mode(x,y[,z...])": "mode( , )",
+            "nmax(x,y[,z...])": "nmax( , )",
+            "nmedian(x,y[,z...])": "nmedian( , )",
+            "nmin(x,y[,z...])": "nmin( , )",
+            "nmode(x,y[,z...])": "nmode( , )",
+            "not(x)": "not()",
+            "pow(x,y)": "pow( , )",
+            "rand(a,b)": "rand( , )",
+            "round(x)": "round()",
+            "round(x,y)": "round( , )",
+            "round(x,y,z)": "round( , , )",
+            "sin(x)": "sin()",
+            "sqrt(x)": "sqrt()",
+            "tan(x)": "tan()",
+            "xor(x,y)": "xor( , )",
+            "row()": "row()",
+            "col()": "col()",
+            "nrows()": "nrows()",
+            "ncols()": "ncols()",
+            "x()": "x()",
+            "y()": "y()",
+            "ewres()": "ewres()",
+            "nsres()": "nsres()",
+            "area()": "area()",
+            "null()": "null()",
         }
         }
 
 
         if self.rast3d:
         if self.rast3d:
@@ -627,16 +628,16 @@ class MapCalcFrame(wx.Frame):
             pass
             pass
 
 
         newmcalcstr += what
         newmcalcstr += what
-        
+
         # Do not add extra space if there is already one
         # Do not add extra space if there is already one
         try:
         try:
             if newmcalcstr[-1] != ' ' and mcalcstr[position] != ' ':
             if newmcalcstr[-1] != ' ' and mcalcstr[position] != ' ':
                 newmcalcstr += ' '
                 newmcalcstr += ' '
         except:
         except:
             newmcalcstr += ' '
             newmcalcstr += ' '
-        
+
         newmcalcstr += mcalcstr[position:]
         newmcalcstr += mcalcstr[position:]
-        
+
         self.text_mcalc.SetValue(newmcalcstr)
         self.text_mcalc.SetValue(newmcalcstr)
         if len(what) > 0:
         if len(what) > 0:
             match = re.search(pattern="\(.*\)", string=what)
             match = re.search(pattern="\(.*\)", string=what)

+ 1 - 0
raster/r.mapcalc/r.mapcalc.html

@@ -359,6 +359,7 @@ log(x,b)                log of x base b                                 F
 max(x,y[,z...])         largest value of those listed                   *
 max(x,y[,z...])         largest value of those listed                   *
 median(x,y[,z...])      median value of those listed                    *
 median(x,y[,z...])      median value of those listed                    *
 min(x,y[,z...])         smallest value of those listed                  *
 min(x,y[,z...])         smallest value of those listed                  *
+mod(x,y)                return the modulus (the remainder) of x/y       *
 mode(x,y[,z...])        mode value of those listed                      *
 mode(x,y[,z...])        mode value of those listed                      *
 nmax(x,y[,z...])        largest value of those listed, excluding NULLs  *
 nmax(x,y[,z...])        largest value of those listed, excluding NULLs  *
 nmedian(x,y[,z...])     median value of those listed, excluding NULLs   *
 nmedian(x,y[,z...])     median value of those listed, excluding NULLs   *

+ 1 - 0
raster/r.mapcalc/r3.mapcalc.html

@@ -224,6 +224,7 @@ log(x,b)                log of x base b                                 F
 max(x,y[,z...])         largest value of those listed                   *
 max(x,y[,z...])         largest value of those listed                   *
 median(x,y[,z...])      median value of those listed                    *
 median(x,y[,z...])      median value of those listed                    *
 min(x,y[,z...])         smallest value of those listed                  *
 min(x,y[,z...])         smallest value of those listed                  *
+mod(x,y)                return the modulus (the remainder) of x/y       *
 mode(x,y[,z...])        mode value of those listed                      *
 mode(x,y[,z...])        mode value of those listed                      *
 nmax(x,y[,z...])        largest value of those listed, excluding NULLs  *
 nmax(x,y[,z...])        largest value of those listed, excluding NULLs  *
 nmedian(x,y[,z...])     median value of those listed, excluding NULLs   *
 nmedian(x,y[,z...])     median value of those listed, excluding NULLs   *