[mapserver-commits] r11974 - branches/branch-6-0/docs/en/mapfile trunk/docs/en/mapfile

svn at osgeo.org svn at osgeo.org
Fri Jul 29 09:26:24 EDT 2011


Author: havatv
Date: 2011-07-29 06:26:24 -0700 (Fri, 29 Jul 2011)
New Revision: 11974

Modified:
   branches/branch-6-0/docs/en/mapfile/expressions.txt
   trunk/docs/en/mapfile/expressions.txt
Log:
Expressions: Updated the expression document with spatial operators and functions (#3613)

Modified: branches/branch-6-0/docs/en/mapfile/expressions.txt
===================================================================
--- branches/branch-6-0/docs/en/mapfile/expressions.txt	2011-07-27 22:48:27 UTC (rev 11973)
+++ branches/branch-6-0/docs/en/mapfile/expressions.txt	2011-07-29 13:26:24 UTC (rev 11974)
@@ -1,3 +1,4 @@
+
 .. _expressions:
 
 *****************************************************************************
@@ -307,7 +308,7 @@
 
   ( ( Expression1 ) && ( Expression2 ) )
 
-  ... true when both of the logical expressions (Expression1 and
+  returns true when both of the logical expressions (Expression1 and
   Expression2) are true.
 
 
@@ -315,16 +316,16 @@
 
   ( ( Expression1 ) || ( Expression2 ) )
 
-  ... true when at least one of the logical expressions (Expression1
+  returns true when at least one of the logical expressions (Expression1
   or Expression2) is true.
 
 * NOT ( Expression1 )
 
   ! ( Expression1 )
 
-  ... true when Expression1 is false.
+  returns true when Expression1 is false.
    
-String operations that return a logical value
+String expressions that return a logical value
 ...............................................................................
 
 Syntactically, a sting is something encapsulated in single or double
@@ -336,47 +337,47 @@
 
    ( "String1" = "String2" )
 
-   ... true when the strings are equal.  Case sensitive.
+   returns true when the strings are equal.  Case sensitive.
 
 *  ( "String1" =\* "String2" )
 
-   ... true when the strings are equal.  Case insensitive.
+   returns true when the strings are equal.  Case insensitive.
 
 *  ( "String1" != "String2" )
 
    ( "String1" ne "String2" )
 
-   ... true when the strings are not equal.
+   returns true when the strings are not equal.
 
 *  ( "String1" < "String2" )
 
    ( "String1" lt "String2" )
 
-   ... true when "String1" is lexicographically smaller than "String2"
+   returns true when "String1" is lexicographically smaller than "String2"
 
 *  ( "String1" > "String2" )
 
    ( "String1" gt "String2" )
 
-   ... true when "String1" is lexicographically larger than "String2".
+   returns true when "String1" is lexicographically larger than "String2".
 
 *  ( "String1" <= "String2" )
 
    ( "String1" le "String2" )
 
-   ... true when "String1" is lexicographically smaller than or equal
+   returns true when "String1" is lexicographically smaller than or equal
    to "String2"
 
 *  ( "String1" >= "String2" )
 
    ( "String1" ge "String2" )
 
-   ... true when "String1" is lexicographically larger than or equal
+   returns true when "String1" is lexicographically larger than or equal
    to "String2".
 
 *  ( "String1" IN "token1,token2,...,tokenN" )
 
-   ... true when "String1" is equal to one of the given tokens.
+   returns true when "String1" is equal to one of the given tokens.
 
    .. note:: 
 
@@ -384,41 +385,18 @@
       can not be unnecessary white space in the list and that tokens
       that have commas in them cannot be compared.
 
-*  ( "String1" =~ "regexp" )
+*  ( "String1" ~ "regexp" )
 
-   ... true, when "String1" matches the regular expression
+   returns true when "String1" matches the regular expression
    "regexp". This operation is identical to the regular expression
    matching described earlier.
 
-String operations that return string values
-...............................................................................
+*  ( "String1" ~* "regexp" )
 
-*  "String1" + "String2'
+   returns true when "String1" matches the regular expression "regexp"
+   (case insensitive). This operation is identical to the regular
+   expression matching described earlier.
 
-   ... returns "String1String2", that is, the two strings concatenated
-   to each other.
-
-String functions that return a number
-...............................................................................
-
-*  length ( "String1" )
-
-   ... returns the number of characters of "String1"
-
-Functions that return a string
-...............................................................................
-
-*  tostring ( n1, "Format1" )
-
-   ... uses "Format1" to format the number n1 (C style formatting
-   - sprintf).
-
-*  commify ( "String1" )
-
-   ... adds thousands separators (commas) to a long number to make it
-   more readable
-
-
 Arithmetic expressions that return a logical value
 ...............................................................................
 
@@ -431,69 +409,150 @@
 
    ( n1 = n2 )
 
-   ... true when the numbers are equal.
+   returns true when the numbers are equal.
 
 *  ( n1 != n2 )
 
    ( n1 ne n2 )
 
-   ... true when the numbers are not equal.
+   returns true when the numbers are not equal.
 
 *  ( n1 < n2 )
 
    ( n1 lt n2 )
 
-   ... true when n1 is smaller than n2.
+   returns true when n1 is smaller than n2.
 
 *  ( n1 > n2 )
 
    ( n1 gt n2 )
 
-   ... true when n1 is larger than n2.
+   returns true when n1 is larger than n2.
 
 *  ( n1 <= n2 )
 
    ( n1 le n2 )
 
-   ... true when n1 is smaller than or equal to n2.
+   returns true when n1 is smaller than or equal to n2.
 
 *  ( n1 >= n2 )
 
    ( n1 ge n2 )
 
-   ... true when n1 is larger than or equal to n2.
+   returns true when n1 is larger than or equal to n2.
 
 *  ( n1 IN "number1,number2,...,numberN" )
 
-   ... true when n1 is equal to one of the given numbers.
+   returns true when n1 is equal to one of the given numbers.
 
 
-Arithmetic expressions that return a number
+Spatial expressions that return a logical value (GEOS)
 ...............................................................................
 
+*  ( shape1 eq shape2 )
+
+   returns true if shape1 and shape2 are equal
+
+*  ( shape1 intersects shape2 )
+
+   returns true if shape1 and shape2 intersect
+
+*  ( shape1 disjoint shape2 )
+
+   returns true if shape1 and shape2 are disjoint
+
+*  ( shape1 touches shape2 )
+
+   returns true if shape1 and shape2 touch
+
+*  ( shape1 overlaps shape2 )
+
+   returns true if shape1 and shape2 overlap
+
+*  ( shape1 crosses shape2 )
+
+   returns true if shape1 and shape2 cross
+
+*  ( shape1 within shape2 )
+
+   returns true if shape1 is within shape2
+
+*  ( shape1 contains shape2 )
+
+   returns true if shape1 contains shape2
+
+*  ( shape1 dwithin shape2 )
+
+   returns true if the distance between shape1 and shape2
+   is equal to 0
+
+*  ( shape1 beyond shape2 )
+
+   returns true if the distance between shape1 and shape2
+   is greater than 0
+
+
+String operations that return a string
+...............................................................................
+
+*  "String1" + "String2'
+
+   returns "String1String2", that is, the two strings concatenated
+   to each other.
+
+
+Functions that return a string
+...............................................................................
+
+*  tostring ( n1, "Format1" )
+
+   uses "Format1" to format the number n1 (C style formatting
+   - sprintf).
+
+*  commify ( "String1" )
+
+   adds thousands separators (commas) to a long number to make it
+   more readable
+
+
+String functions that return a number
+...............................................................................
+
+*  length ( "String1" )
+
+   returns the number of characters of "String1"
+
+
+Arithmetic operations and functions that return a number
+...............................................................................
+
+*  round ( n1 , n2 )
+
+   returns n1 rounded to a multiple of n2: n2 * round(n1/n2)
+
 *  n1 + n2
 
-   ... returns the sum of n1 and n2
+   returns the sum of n1 and n2
 
 *  n1 - n2
 
-   ... returns n2 subtracted from n1
+   returns n2 subtracted from n1
 
 *  n1 \* n2
 
-   ... returns n1 multiplicated with n2
+   returns n1 multiplicated with n2
 
 *  n1 / n2>
 
-   ... returns n1 divided by n2
+   returns n1 divided by n2
 
 *  -n1
 
-   ... returns n1 negated
+   returns n1 negated
 
 *  n1 ^ n2
 
-   ... returns n1 to the power of n2
+   returns n1 to the power of n2
 
 .. note::
 
@@ -514,6 +573,37 @@
 
     would return false.
 
+
+Spatial functions that return a number (GEOS)
+...............................................................................
+
+*  area ( shape1 )
+
+   returns the area of shape1
+
+
+Spatial functions that return a shape (GEOS)
+...............................................................................
+
+*  fromtext ( "String1" )
+
+   returns the shape corresponding to String1 (WKT - well known text)
+
+   ::
+
+     fromText('POINT(500000 5000000)')
+
+*  buffer (shape1 , n1 )
+
+   returns the shape that results when shape1 is buffered with
+   bufferdistance n1
+
+*  difference ( shape1 , shape2 )
+
+   returns the shape that results when the common area of
+   shape1 and shape2 is subtracted from shape1
+
+
 Temporal expressions
 ...............................................................................
 
@@ -550,35 +640,35 @@
 
    ( t1 = t2 )
 
-   ... true when the times are equal.
+   returns true when the times are equal.
 
 *  ( t1 != t2 )
 
    ( t1 ne t2 )
 
-   ... true when the times are not equal.
+   returns true when the times are not equal.
 
 *  ( t1 < t2 )
 
    ( t1 lt t2 )
 
-   ... true when t1 is earlier than t2
+   returns true when t1 is earlier than t2
 
 *  ( t1 > t2 )
 
    ( t1 gt t2 )
 
-   ... true when t1 is later than t2.
+   returns true when t1 is later than t2.
 
 *  ( t1 <= t2 )
 
    ( t1 le t2 )
 
-   ... true when t1 is earlier than or equal to t2
+   returns true when t1 is earlier than or equal to t2
 
 *  ( t1 >= t2 )
 
    ( t1 ge t2 )
 
-   ... true when t1 is later than or equal to t2.
+   returns true when t1 is later than or equal to t2.
 

Modified: trunk/docs/en/mapfile/expressions.txt
===================================================================
--- trunk/docs/en/mapfile/expressions.txt	2011-07-27 22:48:27 UTC (rev 11973)
+++ trunk/docs/en/mapfile/expressions.txt	2011-07-29 13:26:24 UTC (rev 11974)
@@ -1,3 +1,4 @@
+
 .. _expressions:
 
 *****************************************************************************
@@ -307,7 +308,7 @@
 
   ( ( Expression1 ) && ( Expression2 ) )
 
-  ... true when both of the logical expressions (Expression1 and
+  returns true when both of the logical expressions (Expression1 and
   Expression2) are true.
 
 
@@ -315,16 +316,16 @@
 
   ( ( Expression1 ) || ( Expression2 ) )
 
-  ... true when at least one of the logical expressions (Expression1
+  returns true when at least one of the logical expressions (Expression1
   or Expression2) is true.
 
 * NOT ( Expression1 )
 
   ! ( Expression1 )
 
-  ... true when Expression1 is false.
+  returns true when Expression1 is false.
    
-String operations that return a logical value
+String expressions that return a logical value
 ...............................................................................
 
 Syntactically, a sting is something encapsulated in single or double
@@ -336,47 +337,47 @@
 
    ( "String1" = "String2" )
 
-   ... true when the strings are equal.  Case sensitive.
+   returns true when the strings are equal.  Case sensitive.
 
 *  ( "String1" =\* "String2" )
 
-   ... true when the strings are equal.  Case insensitive.
+   returns true when the strings are equal.  Case insensitive.
 
 *  ( "String1" != "String2" )
 
    ( "String1" ne "String2" )
 
-   ... true when the strings are not equal.
+   returns true when the strings are not equal.
 
 *  ( "String1" < "String2" )
 
    ( "String1" lt "String2" )
 
-   ... true when "String1" is lexicographically smaller than "String2"
+   returns true when "String1" is lexicographically smaller than "String2"
 
 *  ( "String1" > "String2" )
 
    ( "String1" gt "String2" )
 
-   ... true when "String1" is lexicographically larger than "String2".
+   returns true when "String1" is lexicographically larger than "String2".
 
 *  ( "String1" <= "String2" )
 
    ( "String1" le "String2" )
 
-   ... true when "String1" is lexicographically smaller than or equal
+   returns true when "String1" is lexicographically smaller than or equal
    to "String2"
 
 *  ( "String1" >= "String2" )
 
    ( "String1" ge "String2" )
 
-   ... true when "String1" is lexicographically larger than or equal
+   returns true when "String1" is lexicographically larger than or equal
    to "String2".
 
 *  ( "String1" IN "token1,token2,...,tokenN" )
 
-   ... true when "String1" is equal to one of the given tokens.
+   returns true when "String1" is equal to one of the given tokens.
 
    .. note:: 
 
@@ -384,41 +385,18 @@
       can not be unnecessary white space in the list and that tokens
       that have commas in them cannot be compared.
 
-*  ( "String1" =~ "regexp" )
+*  ( "String1" ~ "regexp" )
 
-   ... true, when "String1" matches the regular expression
+   returns true when "String1" matches the regular expression
    "regexp". This operation is identical to the regular expression
    matching described earlier.
 
-String operations that return string values
-...............................................................................
+*  ( "String1" ~* "regexp" )
 
-*  "String1" + "String2'
+   returns true when "String1" matches the regular expression "regexp"
+   (case insensitive). This operation is identical to the regular
+   expression matching described earlier.
 
-   ... returns "String1String2", that is, the two strings concatenated
-   to each other.
-
-String functions that return a number
-...............................................................................
-
-*  length ( "String1" )
-
-   ... returns the number of characters of "String1"
-
-Functions that return a string
-...............................................................................
-
-*  tostring ( n1, "Format1" )
-
-   ... uses "Format1" to format the number n1 (C style formatting
-   - sprintf).
-
-*  commify ( "String1" )
-
-   ... adds thousands separators (commas) to a long number to make it
-   more readable
-
-
 Arithmetic expressions that return a logical value
 ...............................................................................
 
@@ -431,69 +409,150 @@
 
    ( n1 = n2 )
 
-   ... true when the numbers are equal.
+   returns true when the numbers are equal.
 
 *  ( n1 != n2 )
 
    ( n1 ne n2 )
 
-   ... true when the numbers are not equal.
+   returns true when the numbers are not equal.
 
 *  ( n1 < n2 )
 
    ( n1 lt n2 )
 
-   ... true when n1 is smaller than n2.
+   returns true when n1 is smaller than n2.
 
 *  ( n1 > n2 )
 
    ( n1 gt n2 )
 
-   ... true when n1 is larger than n2.
+   returns true when n1 is larger than n2.
 
 *  ( n1 <= n2 )
 
    ( n1 le n2 )
 
-   ... true when n1 is smaller than or equal to n2.
+   returns true when n1 is smaller than or equal to n2.
 
 *  ( n1 >= n2 )
 
    ( n1 ge n2 )
 
-   ... true when n1 is larger than or equal to n2.
+   returns true when n1 is larger than or equal to n2.
 
 *  ( n1 IN "number1,number2,...,numberN" )
 
-   ... true when n1 is equal to one of the given numbers.
+   returns true when n1 is equal to one of the given numbers.
 
 
-Arithmetic expressions that return a number
+Spatial expressions that return a logical value (GEOS)
 ...............................................................................
 
+*  ( shape1 eq shape2 )
+
+   returns true if shape1 and shape2 are equal
+
+*  ( shape1 intersects shape2 )
+
+   returns true if shape1 and shape2 intersect
+
+*  ( shape1 disjoint shape2 )
+
+   returns true if shape1 and shape2 are disjoint
+
+*  ( shape1 touches shape2 )
+
+   returns true if shape1 and shape2 touch
+
+*  ( shape1 overlaps shape2 )
+
+   returns true if shape1 and shape2 overlap
+
+*  ( shape1 crosses shape2 )
+
+   returns true if shape1 and shape2 cross
+
+*  ( shape1 within shape2 )
+
+   returns true if shape1 is within shape2
+
+*  ( shape1 contains shape2 )
+
+   returns true if shape1 contains shape2
+
+*  ( shape1 dwithin shape2 )
+
+   returns true if the distance between shape1 and shape2
+   is equal to 0
+
+*  ( shape1 beyond shape2 )
+
+   returns true if the distance between shape1 and shape2
+   is greater than 0
+
+
+String operations that return a string
+...............................................................................
+
+*  "String1" + "String2'
+
+   returns "String1String2", that is, the two strings concatenated
+   to each other.
+
+
+Functions that return a string
+...............................................................................
+
+*  tostring ( n1, "Format1" )
+
+   uses "Format1" to format the number n1 (C style formatting
+   - sprintf).
+
+*  commify ( "String1" )
+
+   adds thousands separators (commas) to a long number to make it
+   more readable
+
+
+String functions that return a number
+...............................................................................
+
+*  length ( "String1" )
+
+   returns the number of characters of "String1"
+
+
+Arithmetic operations and functions that return a number
+...............................................................................
+
+*  round ( n1 , n2 )
+
+   returns n1 rounded to a multiple of n2: n2 * round(n1/n2)
+
 *  n1 + n2
 
-   ... returns the sum of n1 and n2
+   returns the sum of n1 and n2
 
 *  n1 - n2
 
-   ... returns n2 subtracted from n1
+   returns n2 subtracted from n1
 
 *  n1 \* n2
 
-   ... returns n1 multiplicated with n2
+   returns n1 multiplicated with n2
 
 *  n1 / n2>
 
-   ... returns n1 divided by n2
+   returns n1 divided by n2
 
 *  -n1
 
-   ... returns n1 negated
+   returns n1 negated
 
 *  n1 ^ n2
 
-   ... returns n1 to the power of n2
+   returns n1 to the power of n2
 
 .. note::
 
@@ -514,6 +573,37 @@
 
     would return false.
 
+
+Spatial functions that return a number (GEOS)
+...............................................................................
+
+*  area ( shape1 )
+
+   returns the area of shape1
+
+
+Spatial functions that return a shape (GEOS)
+...............................................................................
+
+*  fromtext ( "String1" )
+
+   returns the shape corresponding to String1 (WKT - well known text)
+
+   ::
+
+     fromText('POINT(500000 5000000)')
+
+*  buffer (shape1 , n1 )
+
+   returns the shape that results when shape1 is buffered with
+   bufferdistance n1
+
+*  difference ( shape1 , shape2 )
+
+   returns the shape that results when the common area of
+   shape1 and shape2 is subtracted from shape1
+
+
 Temporal expressions
 ...............................................................................
 
@@ -550,35 +640,35 @@
 
    ( t1 = t2 )
 
-   ... true when the times are equal.
+   returns true when the times are equal.
 
 *  ( t1 != t2 )
 
    ( t1 ne t2 )
 
-   ... true when the times are not equal.
+   returns true when the times are not equal.
 
 *  ( t1 < t2 )
 
    ( t1 lt t2 )
 
-   ... true when t1 is earlier than t2
+   returns true when t1 is earlier than t2
 
 *  ( t1 > t2 )
 
    ( t1 gt t2 )
 
-   ... true when t1 is later than t2.
+   returns true when t1 is later than t2.
 
 *  ( t1 <= t2 )
 
    ( t1 le t2 )
 
-   ... true when t1 is earlier than or equal to t2
+   returns true when t1 is earlier than or equal to t2
 
 *  ( t1 >= t2 )
 
    ( t1 ge t2 )
 
-   ... true when t1 is later than or equal to t2.
+   returns true when t1 is later than or equal to t2.
 



More information about the mapserver-commits mailing list