Search This Blog

Saturday, 25 April 2015

Customizing legend of the layer with cluster strategy of OpenWebGIS

What is clustering features on the map? - This is merging of close to each other features in one feature. What may it be useful for? - It may be necessary when a large number of features clutters the map and a user wants to hide the excessive information at the moment. As well clustering is useful when it is needed to get information on the amount of any objects on a territory quickly  - not counting them  and without using the menu item "Calculation". Let's look at some examples.

Example 1. Major cities on the world map without clustering shown in Figure 1
Figure 1

After applying the clustering method in the legends settings layer "Cities", the map can look like shown in Map 1.
Map 1

Example 2.  The result of the fractal creation on the map is shown in Figure 2. You can read more about the fractal creation on the map in OpenWebGIS here.
Figure 2.

After applying clustering method in the settings of layer legend "Fractal", the map can look as shown in Map 2. Make zoom in, zoom out of the map and you will see how the number of elements in the clusters will change - as the distance between the elements changes and clusters are recalculated.
Map 2

Find out how to create clusters and maps like Map 1 and Map 2. For it you must change the layer legend . To do this, click on the word "legend" under the layer name, you are interested in. Afterwards under the layer name the area will appear on which you click to open the legend settings window.  Look at the Figure 3.
Figure 3.
 Notations in clustering settings (see Figure 3):

- "No strategy" means that all features are rendered, no clustering shall be applied;
- "Simple cluster-strategy" applies the cluster strategy with default options to the layer;
- "Attributive cluster-strategy" uses a customized cluster strategy. This strategy is configured to cluster features of the same value of selected attribute only. A cluster will now contain only features of the same value of selected attribute;
- "Rulebased cluster-strategy" uses another customized cluster strategy. This strategy is configured to cluster features that follow a certain rule only - the attribute value is equal to (=), greater than (>), less than (<), greater than and equal to (>=), less than and equal to (<=) of the inserted value. 
After setting of clustering parametres and pressing "OK" button under these parameters, you can change the clusters color  and sign a number of elements in them. To do this, you can set the number of classes for the legend and specify the appropriate parameters as shown in Figures 4,5,6.
Figure 4.

Figure 5.

Figure 6.

In order to see the attribute information of the layer you are interested in (for example "Fractal") you need: to select Layer's name "Fractal" in the dropdown list "Editable Layer". Then click (on the map) on the point or line, polygon you are interested in. The values of all attributes of the point, line, polygons you can see by hovering the cursor over it and clicking on it (if while hovering over a feature, it is not activated, then move the map a little bit and then again hover the cursor). After clicking on the feature you are interested in, the pop-up window will be opened. In this window you will see all layer attributes. See the result of it in Figure 7.
Figure 7.

The clustering can be applied not only to point features, but also to polygon and line features of vector layers.

No comments:

Post a Comment