< AJAX

ToolTips >

## 21. Geostatistics

## 21.1. Introduction

This chapter describes how to configure geostatistics functionnalities.

## 21.2. General Behavior

The Geostat plugin allows advanced cartographic representation based on attributes of geospatial data. Currently, there is only support for polygonal entities. There will be support for ponctual symbol very soon. Every vectorial formats supported by Mapserver may be use.

The client side of the plugin allow the specification of the mandatory and optional paramaters. These parameters will be passed to the server side which will create the map layer and return some informations about the dataset.

## 21.3. Server-side Configuration

### 21.3.1. Mapfile Configuration

On the server side, the first configuration step is made within the mapfile. The only requirement is a least on polygonal layer which expose at least one attribute. You may consider an attribute as exposed if you can use it as CLASSITEM for this layer. You must add one (and only one) class to this layer. It will be use as template for the generated classes. You may use this class to define border color, label or other default parameter. You should not add this layer to the `layers.ini` configuration file.

### 21.3.2. `geostat.ini` Configuration

Choropleth layers are managed differently then ordinary layer within cartoweb. `server_conf/mapId/geostat.ini` is used to define layers that may be used for geostatistics. Take a look to a sample of this file.

    geostat.0.mslayer = region_geostat_fill
    geostat.0.label = Region
    geostat.0.choropleth = true
    geostat.0.choropleth_attribs = POPULATION,HOUSINCOME
    geostat.0.choropleth_attribs_label = "Population","Average house income"

These example represents a single layer definition. The general for of parameter is geostat.`n`.`key` = `value`. `n` is an incremental number (first layer of the config file is 0. `key` is a parameter for this layer. `value` is the value associated to the following parameter. The following parameters defined choropleth generation :

- `msLayer` : name of the layer in the mapfile
- `label` : Label for the layer in the interface
- `choropleth` : Should choropleth be activated. This is present for future development
- `choropleth_attribs` : Comma separated list of attributes that may be used for choropleth
- `choropleth_attribs_label` : Comma separated list of labels to display as description of the preceding attributes

## 21.4. Client-side Configuration

Client-side configuration allow to specify which algorithms should be display within the user interface. Currently, there are 2 algoriths families that may be configured. The first is about classification algorithms. The second is about generation of color ramp. The signification of the parameter is pretty straightforward.

The `choroplethDataFromCurrentBoundingBox` parameter allows to choose whether classes should change when users zoom or if they should remain constant for every scales.

    ;The following classification method are currently supported
    ;   Custom : 0
    ;   Equal intervals : 1
    ;   Quantils : 2
    ;   Modes : 3
    choroplethClassifMethodDefault = 2
    choroplethClassifMethodsList = 0,2,3
    ;The following color ramp generation method are currently supported
    ;   Custom : 0
    ;   RGB interpolation : 1
    ;   HSV interpolation : 2
    ;   Max diffrence : 3
    choroplethColorRampMethodDefault = 1
    choroplethColorRampMethodList = 1,3
    choroplethDataFromCurrentBoundingBox = false