Changes between Version 5 and Version 6 of MapGuideRfc32


Ignore:
Timestamp:
Mar 10, 2008 3:02:01 PM (11 years ago)
Author:
bentrumbore
Comment:

Updated the RFC to exactly match the actual implementation.

Legend:

Unmodified
Added
Removed
Modified
  • MapGuideRfc32

    v5 v6  
    4343== Proposed Solution ==
    4444
    45 Three theming functions are proposed.  In all cases, every parameter is supplied as a string, even though it may represent data of another type.  The first function is quite simple:
     45Three theming functions are proposed.  Except where noted, each parameter can be a constant or expression that evaluates to a string or numerical value.  The first function is quite simple:
    4646
    47      '''IF(Condition, !TrueValue, !FalseValue)'''
     47     '''If('Condition', !TrueValue, !FalseValue)'''
    4848
    49 The ‘Condition’ parameter is any expression that evaluates to a Boolean value.  Typically, this might be a single comparison such as “population > 1000”, where ‘population’ is a feature property of the layer.  ‘!TrueValue’ and ‘!FalseValue’ are independent expressions that are evaluated and returned when the condition is true or false, respectively.  This example could be used to rotate an upward-facing arrow symbol to indicate rising or falling populations:
     49The ‘Condition’ parameter is a string containing any expression that evaluates to a Boolean value (essentially, a filter).  Typically, this might be a single comparison such as 'population > 1000', where ‘population’ is a feature property of the layer.  ‘!TrueValue’ and ‘!FalseValue’ are expressions that are evaluated and returned when the condition is true or false, respectively.  Both expressions must evaluate to the same data type (string or number).
    5050
    51      IF(“pop2005 > pop2000”, “0.0”, “180.0”)
     51This example could be used to rotate an upward-facing arrow symbol to indicate rising or falling populations:
    5252
    53 By recursively using more ‘IF’ functions for ‘!TrueValue’ and ‘!FalseValue’, it is possible to specify any set of discrete theme categories.  However, since such expressions would be inefficient to evaluate, the following two functions are also proposed:
     53     If('pop2005 > pop2000', 0.0, 180.0)
    5454
    55      '''LOOKUP(Expression, !DefaultValue, Key1, Value1, … KeyN, ValueN)'''
     55By recursively using more ‘If’ functions for ‘!TrueValue’ and ‘!FalseValue’, it is possible to specify any set of discrete theme categories.  However, since such expressions would be inefficient to evaluate, the following two functions are also proposed:
    5656
    57 This function implements a lookup table where each key is associated with a single value.  ‘Expression’ is an expression that evaluates to a key (integer, real or string).  This key is compared to the remaining constant ‘Key#’ parameters to select the constant ‘Value#’ parameter that is to be returned.  If the requested key is not found, ‘!DefaultValue’ is returned.  The ‘Value#’ parameters are expected to all represent the same data type.  The number of key-value pairs is not fixed.  This example could be used to assign colors to parcels based on their zoning type:
     57     '''Lookup(Expression, !DefaultValue, Key1, Value1, … KeyN, ValueN)'''
    5858
    59      LOOKUP(“zoning”, “ff888888”, “Industrial”, “ffff0000”, “Commercial”, “ff00ff00”, “Residential”, “ff0000ff”)
     59This function implements a lookup table where each key is associated with a single value.  ‘Expression’ is an expression that evaluates to a key (string or number).  This key is compared to the remaining constant ‘Key#’ parameters to select the constant ‘Value#’ parameter that is to be returned.  If the requested key is not found, ‘!DefaultValue’ is returned.  The ‘Expression’ and all ‘Key’ parameters must have the same data type, as must the ‘!DefaultValue’ and all ‘Value#’ parameters.  The number of key-value pairs is not fixed.
     60
     61This example could be used to assign colors to parcels based on their zoning type:
     62
     63     Lookup(zoning, 0xff888888, 'Industrial', 0xffff0000, 'Commercial', 0xff00ff00, 'Residential', 0xff0000ff)
    6064
    6165In the last function, the ‘Expression’ key is compared to a set of ranges, where a key matches a range if MIN <= KEY < MAX:
    6266
    63      '''RANGE(Expression, !DefaultValue, Min1, Max1, Value1, … MinN, MaxN, ValueN)'''
     67     '''Range(Expression, !DefaultValue, Min1, Max1, Value1, … MinN, MaxN, ValueN)'''
    6468
    65 Ranges are specified by the constant ‘Min#’ and ‘Max#’ parameters, and each has an associated constant ‘Value#’ parameter.  If the requested key does not match any of the provided ranges, ‘!DefaultValue’ is returned.  If ranges overlap, the first range that matches the key will be selected.  The number of range-value sets is not fixed.  This example could be used to specify symbol size depending on city populations:
     69Ranges are specified by the ‘Min#’ and ‘Max#’ parameters, and each has an associated ‘Value#’ parameter.  If the requested key does not match any of the provided ranges, ‘!DefaultValue’ is returned.  If ranges overlap, the first range that matches the key will be selected.  The ‘Expression’ and all ‘Min’ and `Max’ parameters must have the same data type, as must the ‘!DefaultValue’ and all ‘Value#’ parameters.  The number of range-value sets is not fixed.
    6670
    67      RANGE(“population”, “4.0”, “100000”, “1000000”, “6.0”, “1000000”, “10000000”, “8.0”)
     71This example could be used to specify symbol size depending on city populations:
     72
     73     Range(population, 4.0, 100000, 1000000, 6.0, 1000000, 10000000, 8.0)
    6874
    6975== Implications ==