Changes between Version 5 and Version 6 of MapGuideRfc32
 Timestamp:
 Mar 10, 2008 3:02:01 PM (11 years ago)
Legend:
 Unmodified
 Added
 Removed
 Modified

MapGuideRfc32
v5 v6 43 43 == Proposed Solution == 44 44 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:45 Three 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: 46 46 47 '''I F(Condition, !TrueValue, !FalseValue)'''47 '''If('Condition', !TrueValue, !FalseValue)''' 48 48 49 The ‘Condition’ parameter is a ny 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 upwardfacing arrow symbol to indicate rising or falling populations:49 The ‘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). 50 50 51 IF(“pop2005 > pop2000”, “0.0”, “180.0”) 51 This example could be used to rotate an upwardfacing arrow symbol to indicate rising or falling populations: 52 52 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) 54 54 55 '''LOOKUP(Expression, !DefaultValue, Key1, Value1, … KeyN, ValueN)''' 55 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: 56 56 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 keyvalue 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)''' 58 58 59 LOOKUP(“zoning”, “ff888888”, “Industrial”, “ffff0000”, “Commercial”, “ff00ff00”, “Residential”, “ff0000ff”) 59 This 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 keyvalue pairs is not fixed. 60 61 This 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) 60 64 61 65 In the last function, the ‘Expression’ key is compared to a set of ranges, where a key matches a range if MIN <= KEY < MAX: 62 66 63 '''R ANGE(Expression, !DefaultValue, Min1, Max1, Value1, … MinN, MaxN, ValueN)'''67 '''Range(Expression, !DefaultValue, Min1, Max1, Value1, … MinN, MaxN, ValueN)''' 64 68 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 rangevalue sets is not fixed. This example could be used to specify symbol size depending on city populations:69 Ranges 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 rangevalue sets is not fixed. 66 70 67 RANGE(“population”, “4.0”, “100000”, “1000000”, “6.0”, “1000000”, “10000000”, “8.0”) 71 This 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) 68 74 69 75 == Implications ==