Creating New Maps other than US

By default Vitara map chart can show US map and World Countries. But we can also draw any other country’s map. Let’s consider a simple example of creating a map for Countries of the United Kingdom by population. The data file i have is:

map creating map1

The first step is, to download the shapefile (.geo.json file) which suits with our data. As the data i have is at country level, i have to search for shapefile of the United Kingdom at country level (admin-0 level).

The reference web page to download GeoJSON shape-files:

The following is the geojson file which we need for our example.

map creating map2

Click on GeoJSON file type to downloaded the file. We have to check the downloaded GeoJSON file, whether it contains the same coordinates which we want. For this purpose, use any online json viewers, for example:

map creating map3

Open the downloaded GeoJSON file using any text editor, for example notepad. Copy the entire text and paste in json viewer web page.

map creating map4

Now click on ‘Viewer’ tab beside the ‘Text’ tab.

map creating map5

Now the geojson content will be displayed in json tree structure.

map creating map6

In JSON tree structure, one of the object is ‘features’ array. If we expand ‘features’ array we will have the objects for each partition of the chart. In our United Kingdom countries example, as there are four partitions in the chart representing each country (England, Scotland, Wales and Northern Ireland) so there are objects named from 0 to 3.

map creating map7

Now it is clear that the shape we downloaded is what we require. Our data and the shapefile coordinates are perfectly matching.

The next step is, we have to identify the ‘dictionary key’. Dictionary key is the parameter by which each partition in the shape file is identified uniquely. The united Kingdom map has four partitions, and these partitions should be identified with some boundary coordinated. Each of these boundary coordinates are given one unique name. These unique names are mentioned in the ‘properties’ field of each partition of GeoJSON file. To know dictionary key expand any object, for example ‘0’ and expand ‘properties’ array.

Please see the rounded area in the below screenshot.

map creating map8

In this properties array there are several fields which can be used as dictionary key. For example, we can use ‘hc-a2’ field as dictionary key. For England hc-a2 field value is ‘EN’, for Wales it is ‘WA’, for Scotland it is ‘SC’ and for Northern Ireland it is ‘NI’. You may notice that all the fields are unique.

Here the point is you can define any field as dictionary key but it should match with our data. In our data file we have country names rather than short forms.

map creating map9

Therefore, exact matching fields in the properties array with our data is the ‘name’ field.

map creating map10

In case if we don’t find any matching dictionary key field in shapefile with data file, we have to create the synonyms. This is explained in the section ‘Dictionary property’ in the documet titled ‘Customization of the Map chart’.

After identifying dictionary key we can define a new map layer for our example. For this edit ‘mappinglayers.txt’ file, which will be in the following path in Vitara map chart installation folder.

C:\Program Files\Apache Software Foundation\Tomcat 8.0\webapps\MicroStrategy \plugins\VitaraMaps\custom

The following is the screenshot of ‘mappingLayers.txt’ file. There are three predefined mapping layers, world physical, US physical, and US Countries.

map creating map11

The following is the notation to add new map layer: <ns>.<property>

<ns>: NameSpace, this can be any combination of alphabets, but choose a unique value for each new map layer. The map layer should contain the following properties;

<ns>.name =

<ns>.shape =

<ns>.dictionarykey =

In the ‘name’ property we define the name of the map we want to give.

For example, i want to give ‘United Kingdom’ as the name, then ‘name’ property definition will be United Kingdom

In the shape property definition we should give the path where we copied the shape file of our map. For our example, as we copied the shape file into VitaraMaps\custom\shapes folder, the following is the shape property definition.

kk.shape= custom/shapes/uk-countries.geo

All the shape files should be placed in ‘Shapes’ folder in custom folder. This is not compulsory, but in the naming convention point of view it’s better to do.

Dictionary key property definition will be the unique identity field we selected in GeoJSON shapefile.

kk.dictionarykey = name

In the mapping layers text file start a new map definition and define name, shape, dictionary key properties.

(please refer section ‘Mapping layers text file‘ in the document titled ‘Customization of the Map chart’for more information about ‘mapping layers text file) United Kingdom

kk.shape= custom/shapes/uk-countries.geo

kk.dictionarykey= name

Please refer the sections ‘Name’ property, ‘Shape’ property, ‘Dictionary key’ property and Dictionary’ property in the document titled ‘Customization of the Map chart’ to know the procedure how to define these properties. After defining all these properties save ‘Mapping layers’ text file.

The following is the screenshot of mappingLayes.txt file after defining United Kingdom mapping layer.

map creating map12

Now create a dossier or RS document in MicroStrategy and apply Vitara map chart. By default vitara map will display ‘World Physical’ map. Click on ‘edit’ button, and select ‘map’ tab. Expand the ‘Map Layer’ drop down button. Here you will find the new map definition ‘United Kingdom’. Select this map layer. Please refer the below screenshot.

map creating map13

Apply required Map attribute and a metric to the visualization.

map creating map14