Just Analytics Blog | Performance Management News, Views and Op-ed

Geospatial Analytics in OBIEE – Part III – Role of Mapviewer

Written by Umesh Kakkad | Feb 1, 2014 2:45:00 PM

In my previous post on Geospatial Analytics in OBIEE, I had talked about shapefiles, and how shapefiles could be imported using Map Builder. As mentioned earlier, the shapefiles contain the positional/geographic information. Once we have loaded this geographic information in to the spatial database, we need a map/spatial engine to process this information for use in tools like Oracle BI. This is what Oracle Mapviewer is for.

Oracle Mapviewer is a J2EE application which acts as a spatial/map engine to render maps based on the geodetic information available in the spatial tables. It can integrate with a variety of applications. When it comes to OBIEE, Mapviewer comes deployed in WebLogic (we don't need to download or install anything for Mapviewer). The focus of this post will be to examine how we can configure Mapviewer, including setting up connectivity to the spatial database and also to create base maps or background maps.

Mapviewer can be accessed through the browser, the URL being http://<hostname>:9704/mapviewer.

The first step in configuring Mapviewer is setting up the connectivity to the spatial database. This is needed mainly for two things:

  1. Mapviewer accesses the spatial database to retrieve and process the layers that were created as part of the shapefile import process
  2. Through Mapviewer, we create Map Tile Layers (or background maps as they are referred to, in Oracle BI) , upon which we would overlay the layers (created as a result of shapefile import) in Oracle BI to get the map view. Mapviewer stores the data and metadata associated with these Map TIle Layers in the spatial database.

To create a data source (connectivity) to the spatial database, there are two ways:

  • Create a datasource in the config file (through Configuration manager)
  • Create a datasource in the Datasources section

Currently, there is a bug in Mapviewer related to the second option, due to which, upon restarting the Mapviewer service after creating a datasource in the Datasources section, the datasource is wiped off. So the recommendation for the time being is to create the datasources in the config file itself.

To create a datasource:

  1. In Mapviewer, click on 'Configuration' link on the left hand side (In version 11.1.1.7 onwards, the look and feel of Mapviewer has changed slightly, but the overall functionality remains the same)
  2. This will bring us to the editor for the actual config file (mapViewerConfig.xml). Scroll to the bottom and add the following:

<map_data_source name="<datasource name that you wish to give>"
jdbc_host="<hostname or host IP>"
jdbc_sid="<SID>"
jdbc_port="<port>"
jdbc_user="<schema username>"
jdbc_password="!<schema password>"
jdbc_mode="thin"
number_of_mappers="3"
allow_jdbc_theme_based_foi="false"

/>

Take note that for the value for jdbc_password, there is a '!' symbol preceeding the schema password. This is to enable mapviewer to encrypt the password upon restarting the mapviewer service.

Also ensure that the above piece of code is uncommented, and that the closing tag is in place (some of the things which usually can prevent a successful restart or restart without any change)

3. After the above steps, restart Mapviewer service by clicking on 'Save and Restart' at the bottom of the page

After completing the above steps, click on 'Datasources' link on the left hand panel. This will take you the Datasources section, where you will see the data source that you had defined earlier in the configuration section. This completes configuration of the datasource.

The next step is to create a background map. Background maps are referred to as Tile Layers in Mapviewer.

  1. Click on 'Create Tile Layer' on the left hand panel
  2. This will bring you to a drop down selection, where you select the map that you intend to use/configure as your background map. For the purposes of this blog, we will be using Google Maps as the base map, but you can try out other maps which are supported by Mapviewer. Select 'Google Map' and click on Continue.
  3. This brings us to the Google Maps configuration page

  • Name - Give a name for this background map. This name will appear in the list of background maps in OBIEE.
  • Data Source - Select the data source that was created earlier (or reuse an existing datasource)
  • lib_url - This refers to the path where the Google Maps API resides. This does not need to be changed unless you want to localize the map
  • key - This refers to the Google Maps API Key. You will need to enter a valid API key here. You can get more details about how to use Google Maps API and their licensing terms at https://developers.google.com/maps/documentation/javascript/tutorial#api_key
  • map_type_values - This refers to the types of maps (Satellite, Road, Hybrid, etc.) available for use
  • version - API version
  • map_type_visible - This allows users to select the type of map they want to see (Satellite, Road, Hybrid, etc.) as it is usually done in Google Maps. This is a new feature they have enabled in v 11.1.1.7+

4. Click on 'Submit' once done. You will be redirected to the 'Manage Tile Layers' which lists out all the map tile layers which have been created.

This concludes the setting up/configuration of Mapviewer.

In my next blog, which would be the final part to the 'Geospatial Analytics in OBIEE' series, I will talk about how we could put to use all these (layers, background maps, etc.) in OBIEE and create map based visualizations.

Until then, happy learning!

 

Related Blogs

Geospatial Analytics in OBIEE Basics
Shapefiles and map builder