Overview
Thematic mapping allows the display of data with aggregated numeric totals in iShare Maps or iShare GIS. The data may have been prepared using the Astun Geopivoting functions, but if not, must still meet the necessary requirements in terms of tabular structure, namely the presence of a column of a numeric data type representing the values you wish to display, and an unique field such as ogc_fid. See the Geopivoting topic for information on how to include these in your dataset.
Installing the GPT Statistics component on your Data Share database
Before you can configure Thematic Mapping you need to have installed the GPT Statistics component from the AstunPGInstaller onto your Data Share database. Tick the box for GPT Statistics on the Install Options dialog.
Configuring your MapServer .MAP file - only required pre v5.6.0
Once the table has been created with the required structure, it can be configured as a layer in the MapServer map file. It is a PostGIS layer, which requires some additional parameters.
Create a LAYER section as normal, and add the following lines within the LAYER declaration, where the dbname, username and password should be substituted for those appropriate for your database:
CONNECTIONTYPE POSTGIS CONNECTION "dbname=yourdatabasename user=yourdbusername password=yourpassword host=localhost" DATA "wkb_geometry from (select * from tablename) as subquery using unique ogc_fid using srid=27700"
The tablename that you use in the select statement (see above) MUST be in the public schema in your Data Share database.
Since this layer will be displayed as a thematic layer in iShare Maps or iShare GIS, the styling will be handled dynamically. Simply include the basic styling for the type of layer you are configuring, such as an OUTLINECOLOR and WIDTH for a polygon e.g.
Filtering your Thematic Data
If you wish to filter your data, then it is necessary to include a predicate in the SQL sub query rather than a FILTER parameter in your LAYER declaration. For example, given a dataset of Civil Parishes, to filter out those in a particular county the DATA syntax would be:
DATA "wkb_geometry from (select * from civil_parishes where county=’SURREY_COUNTY’) as subquery using unique ogc_fid using srid=27700"
e.g.
If you wish to display this data as a normal (non-thematic) layer then you will need a separate entry in the map file. This will not have dynamic styling, so should be styled as you wish it to be displayed.
Configuring your Thematic Layer in Studio
For details on how to configure your Thematic Layer in Studio please refer to the following:
- V5.6.0 or greater - see OGC Layer Configuration to create your OGC Layer and then OGC Layer - Advanced Thematic & Geometry Options to configure the Thematics.
- Pre V5.6.0 - Thematic Layer Configuration.