The Content (Region Borders) of the Analytic Map Control
Visual Business choropleth map uses a special file in the MIME repositiory to get the geographical data of the displayed regions e.g. the country borders. This data ("the content") is not delivered by SAP because of the different customer requirements. It can be downloaded from various internet sources.
In this document you find an overview where to get the content, how to change it to the right format and where to store it.
We attached a sample data file and the reports mentioned here to this document, see below.
If you want to use the country borders you can find the content file in this document Country Content for Visual Business analytic map
You can then proceed with the section "Upload the content file to the mime repository" below.
The content must be provided in the GeoJSON format, it has to be uploaded to a dedicated location in the MIME repository.
Setup the Content and Preparing the L0.json file
This chapter descibes where in the internet to download e.g. the content country borders in different resolutions and how to convert it into the GeoJSON format.
Here a step-by-step describtion is provided for customer specific content. If you want to use country borders directly you can skip this chapter and download the content directly as an attachment to the document Country Content for Visual Business analytic map.
A natural source for analytic map country data is http://www.naturalearthdata.com/downloads/110m-cultural-vectors/, here download the data by pressing the “Download countries” button.
Now you should have the file “ne_110m_admin_0_countries.zip” in your preferred folder on your local PC. Extract the zip-file to “ne_110m_admin_0_countries”, you will find 6 files inside this folder.
The file, which is relevant for us, is “ne_110m_admin_0_countries.shp”. It contains the country border information in the so-called ESRI shape file format
We will convert this file to the GeoJSON format using the GDAL(Geospatial Data Abstraction Library).
Download the binaries for you specific operating system from http://trac.osgeo.org/gdal/wiki/DownloadingGdalBinaries. You will only need the core components, for windows this is “gdal-111-1400-core.msi“ at the time being. The “typical” installation is sufficient.
The library installs typicically in C:\Program Files\GDAL on a Windows system. Open a command prompt, cd “C:\Program Files\GDAL” and run “GDALShell.bat” for setting the path and environment variables within the command shell. Create on folder “data” within “C:\Program Files\GDAL” and copy all the files from the ne_110m_admin_0_countries folder to the “data” folder.
ogr2ogr -f "GeoJSON" Geo.json ne_110m_admin_0_countries.shp
in the command prompt. This gives you an additional file "Geo.json", the shape file converted to GeoJSON, within the “data” folder.
We still have two steps to go until we are able to use this file for the analytic map:
- Run the report “Z_VBI_GEOJSON_ADD_ISO” and upload Geo.json, save it as L0_id.json.
- Run the “Z_VBI_GEOJSON_CONDENSE”, upload L0_id.json and save it as L0.json
The first step adds the iso country codes the next one condenses the data.
Upload the content file to the mime repository
The content has to be uploaded as a GeoJSON file by the customers administrator into the MIME repository.
Currently it must have the filename “L0.json”.
This file must finally be uploaded to the MIME folder /SAP/PUBLIC/BC/VBI/Analytical_Map.
Test & Result
Now you should be able to test the analytic map by testing the page "AnalyticMapUI5.htm" within the BSP application "VBI_TEST_AM":