long doRangeClassification(string attrName, int n)
This method classifies the layer (which must be a database layer) into n groups, based on attrName, where attrName is the name of a column in the corresponding database table. This means that each feature in the layer is assigned to one of n groups, where the range of values in each group is the range of values in the designated column divided by n. Each group is then assigned a distinct color. For example, if the following holds:
- The layer consists of some number of cities
- The corresponding database table has a column titled "Population"
- Each row of the table contains the population of the corresponding city
- The range of population is from 1,000,000 to 11,000,000
- The layerAPI for this layer has the variable name cityLayer
- The call cityLayer.doRangeClassification("Population", 4) is made
then, there will be 4 distinct colors, classifying the cities into 4 groups according to population, as folllows: 1 to 3.5 million, 3.5 to 6 million, 6 to 8.5 million, and 8.5 to 11 million.
The colors are assigned based on the current default color scheme, which is set using overrideDefaultColorScheme.
This method returns zero upon success, and returns an error code if:
- The layer is not a database layer.
- The current default color scheme is CUSTOM and the number of colors defined does not match the number of unique values in column with name attrName.