long doUniqueClassification(string attrName)
This method uniquely classifies the layer (which must be a database layer), based on attrName, where attrName is the name of a column in the corresponding database table. This means that the features in the layer are colored, such that each feature with a distinct value of attrName receives a distinct color. For example, if the following holds:
- The layer consists of 10 political polygons representing counties
- The corresponding database table has a column titled "County Name"
- Each row of the table has a unique value in the "County Name" column
- The layerAPI for this layer has the variable name countyLayer
- The call countyLayer.doUniqueClassification("County Name") is made
then, each county will be given a unique color, i.e. there will be 10 distinct colors. Now, suppose that two of these polygons actually belong to the same county (say, a large county on the coast and a small island, just off the coast, belonging to that county), and therefore, two rows of the table have the same value under "County Name". Then, there will be 9 distinct colors, with two polygons having one of those colors.
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.