Tuesday, March 25, 2014

SAP Lumira Extension: Custom Map of Japan

With this blog post I will build on my SAP Lumira extension of a choropleth map of Japan.

The extension can be downloaded here., and the following blog will cover it's use.

The background to the original extension is covered in my SCN blog

Custom Choropleth Maps with VizPacker

This blog and my extension was featured as a "Cool Example" in the SAP webinar here

SAP Lumira SDK - An Introduction and Cool Examples

My intentions for adding extra features/functionality to this extension is a way to try and build the best map *I* can. Emphasis on the "I" as I can't build the best map ever :) . Also it is a good example for me to learn more about D3 and making the map as user friendly as possible inside SAP Lumira.

A free copy of SAP Lumira can be downloaded from the main Lumira site http://saplumira.com/
I only use the free personal edition and all my examples are built on this free version.

I will be adding blog entries on a regular basis with added features or new ways of implementing the technical code for the map or for different countries.

I will be releasing with an update based on dates and the first of these being the 26th March 2014.

Japan Choropleth Map Update 1 - 26/03/2014

Custom Choropleth Map of Japan.

The main updates to the map for this post is to create a pure choropleth map of Japan and strip out the football references in the SCN blog. Also the method to lookup the prefectures is extended, the first example only used the names found inside the Natural Earth Shapefile to recognise the prefectures. With the first update I have added Kanji, Romaji, ISO-codes, FIPS codes and prefecture numbers as ways to build the choropleth map. These can be selected or changed without reloading the map. I have added Javascript code to auto detect these values to match the prefecture name to the map. These lookup values are also available for download for reference.

Download the code and the lookup table from here

The zip file contains two files,

Close SAP Lumira if it is already running.

Extract the downloaded VizPacker file "viz.ext.japanv1.zip" extension to the "extension" directory as shown in the screenshot

After the extension is extracted there should be the japanv1-bundle.js file in the directory structure as shown below.

Example using the Wikipedia data for the population of Japan by prefecture

Taking the first line of the actual data from the Wikipedia page. As you can see the prefecture name is in Japanese and romaji. My SAP Lumira map extension will be able to use these "Prefectures" and "Japanese" columns as attributes to create the choropleth map. The text file in the download contains all the possible attributes that can be used.

(Oct 1, 2010 to
Sep 30, 2011)
of Japanese
(Oct 1, 2010)
1Tōkyō-to東京都13,195,9746,523,5516,672,42336,58612,869,20513,159,3882,188.676,029.22Shinjuku-ku, Tōkyō-to

Example  using the "Prefectures" column for the prefectures and the measure "Estimated Male Population" to create a map in SAP Lumira.

Using the "Prefecture" attribute from the wikipedia table  (red arrow in the screenshot above) this attribute is in romaji and I have moved the mouse over Tōkyō-to and this is shown in the screen shot too.

Next example using the "Japanese" column for the prefectures and keeping the same measure "Estimated Male Population" to create a map in SAP Lumira.

Exactly the same Lumira chart extension but simply swapping to the "Japanese" attribute from the wikipedia data  (red arrow in the screenshot above) this attribute is in Kanji and I have moved the mouse over 東京都 and this is shown in the screen shot too.

Licensed under the creative commons

Creative Commons License

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

Google +