Tuesday, July 7, 2015

Map Viewer Configuration for OBIEE 11g


1. Importing Schemas to your database:
1.Sign in to SQL*Plus as a system user and create a database user named mvdemo. Use the following script for reference:
CREATE USER mvdemo IDENTIFIED BY mvdemo DEFAULT TABLESPACE USERS;
2. Grant privileges to the mvdemo user.
GRANT CONNECT, RESOURCE, CREATE VIEW TO mvdemo IDENTIFIED BY mvdemo;
3. Copy mvdemo.dmp to a location on your machine. In my case mvdemo.dmp is copied to D:\Map Viewer\mvdemo. This is a database dump file exported from an Oracle database. You can import it into an Oracle 10g or 11g database.
4. Open a command window, change the directory to the location of mvdemo.dmp, and use the following command to import the data into user mvdemo:
imp mvdemo/mvdemo file=mvdemo.dmp full=y ignore=y
5. Verify the import. Connect as mvdemo and use the following script .
select table_name from user_tables;


6. Unzip mvdemosql.7z and then copy mvdemo.sql to a location on your machine. In my Case   mvdemo.sql is copied to D:\Map Viewer\mvdemo.
This script populates all the necessary spatial metadata, copies the predefined styles, themes, and base maps into the proper user views, and creates spatial indexes for the imported tables. It also creates several (cached) map tile layer definitions in the view USER_SDO_CACHED_MAPS so that all the Oracle Maps tutorials will work. Here is how to run the script from a SQL*Plus session while logged in as user mvdemo: 
7. Sign in to SQL*Plus as a system user and create a database user named obieemap. Use the following script for reference: 
CREATE USER obieemap IDENTIFIED BY obieemap DEFAULT TABLESPACE USERS;
8. Grant privileges to the obieemap user. Use the following script for reference: 
GRANT CONNECT, RESOURCE, CREATE VIEW TO obieemap IDENTIFIED BY obieemap;
9. Copy obieemap.dmp to a location on your machine. In My case  obieemap.dmp is copied to D:\MapViewer\obieemap. This is a database dump file with OBI data exported from an Oracle database. You can import it into an Oracle 10g or 11g database.
10. Open a command window, change the directory to the location of obieemap.dmp, and use the following command to import the OBI data into user obieemap: 
imp obieemap/obieemap file=obieemap.dmp full=y ignore=y
11. Verify the import. Connect as obieemap with password obieemap and use the following script.
select table_name from user_tables;

2. Creating a Map viewer Data Sources:
To create a Map Viewer data source, make sure your Oracle database is up and then perform the following steps.
  1. Open a browser and enter the following URL to connect to Map Viewer: http://host:port/mapviewer
  1. Click the Admin link in the upper right corner to open the Login screen.
   3. On the Login screen, enter your OBIEE administrative username and password. In this example the username is weblogic
4.Select Management > Configuration to open the Map Viewer XML configuration file inside a text area.
Scroll all the way down to the end of the file to find the sample Map Viewer data source definition: map_data_source name=.
 Make sure you have an exclamation point “!” in front of the supplied login password value. Then next time you restart Map Viewer it will automatically obfuscate this password.
5. Click on the Save & Restart button underneath the text area. Map Viewer will restart, reload this configuration file, and the mvdemo data source will be created (make sure the database and its listener are both up!).
6. At the top of the page, in the Information section, verify that mapViewerConfig.xml has been saved and Map Viewer has been restarted.
7. Select Datasources. In the top panel under Existing Data Sources it should list the mvdemo data source.
3. Installing and Configuring Mapbuilder
To install and configure Map Builder, perform the following steps:
1.Copy mapbuilder.jar to a location on your machine. In this tutorial the file is copied to D:\MapViewer\Mapbuilder
2. Double-click mapbuilder.jar to open the Oracle Map Builder user interface.
3. Expand the Connection drop-down list and select Load/Add/Remove to open the Load/Add/Remove Database Connections dialog box.
4. Click Add in the Load/Add/Remove Database Connections dialog box to open the Add Connection dialog box.
5. Enter the connection information for your environment. Use the screenshot for reference. For the environment used to build this tutorial, the information is:
Connection Name: mvdemo
User: mvdemo
Password: mvdemo 
Host: localhost
Post: 1521
SID: orcl
6. Click Test Connection. You should receive the message "Connection mvdemo is valid".
7. Click OK to close the Information message.
8. Click OK to close the Add Connection dialog box. You should receive the following message in the Map Builder Messages pane:
4. Creating Colour Style
1. Expand Styles > Colors in the Metadata Navigator tree. Notice that Oracle Map Builder is now populated with the mvdemo metadata. Although you could use this pre-built metadata to build your map, in the remainder of this OBE you create new metadata to become familiar with using Oracle Map Builder.
2. Right-click the Colors node and select Create Color Style to open an editor panel for Color Style on the right.
C:\Users\Rajkumar\Desktop\map\Capture1.PNG
3. Select the Fill option under Style Options. The fill attribute defines how the geometry will be filled.
4. Define the fill color by clicking on the color icon to open a dialog with colors, or by entering the hexadecimal value. In this example we enter the hexadecimal value #F2EFE9, which is a light gray color.
C:\Users\Rajkumar\Desktop\map\Capture2.PNG
5. Select the Stroke option. The stroke defines how the outline (border) will be rendered. In this example enter #0033FF in the Hex box to set the stroke color to Blue.
6. Click the Preview button to display the current color style representation

7. Enter C.STATES in the Name text field. Leave the optional description text field as it is.
9. Click the Save icon on the application tool bar to store the color style definition on the USER_SDO_STYLES database view.
C:\Users\Rajkumar\Desktop\map\Untitled.png
5. Creating a marker style
1. Copy cities_8X8.png to a location on your machine. In my case file is copied to D:\MapViewer\images
2. Right-click the Markers node and select Create Marker Style to open an editor panel for Marker Style on the right.
C:\Users\Rajkumar\Desktop\map\Capture5.PNG
3. Under Style Options, select the Marker Type option and click on the Image radio button.
4.Click Load Image, navigate to the directory where file cities_8x8.png is located, and select it. In this OBE image file is located in
C:\Users\Rajkumar\Desktop\map\Capture6.PNG
5. Click the Preview button to display the current marker style representation
C:\Users\Rajkumar\Desktop\map\Capture7.PNG
6. Enter M.CITIES in the Name text field. Leave the optional description text field as it is.
C:\Users\Rajkumar\Desktop\map\Capture8.PNG
7. Click the Save icon on the application tool bar to store the marker style definition on the USER_SDO_STYLES database view
C:\Users\Rajkumar\Desktop\map\Untitled.png
6.Creating a Text Style
1. Expand Styles > Texts in the Metadata Navigator tree.
2. Right-click the Texts node and select Create Text Style to open an editor panel for Text Style on the right.
3. Under Style Options, select the Text style option.and Change the font to Dialog, font size to 12, and style to Bold.
4. Select the Color tab and change the fill color to #0000FF (RGB: 0, 0, 255, blue). Leave Background color unchecked.
5. Click on the Halo option and set width to 2 and Color to #FFFFFF (white).
6.Click the Preview button to see the current text style representation.
7. Enter T.STATE_ABBRV in the Name text field.
8. Click the Save icon on the application tool bar to store the text style definition in USER_SDO_STYLES database view.
C:\Users\Rajkumar\Desktop\map\Untitled.png
7.Creating a State Theme
1. If necessary, click the Show Data button at the bottom of the screen to display the Data Navigator.
C:\Users\Rajkumar\Desktop\map\Capture9.PNG
2. Click the Tables tab.and  Expand Spatial Tables > Geometry Tables > MVDEMO.
C:\Users\Rajkumar\Desktop\map\Capture11.PNG
3. Right-click the STATES node and select Create Geometry Theme to open the Define a Geometry Theme wizard. Click Next to continue.
C:\Users\Rajkumar\Desktop\map\12.PNG
4. Notice that the Theme Parameters page is already populated with information obtained from the STATES table. Define the theme name as THEME_STATES and keep the other field values. Press Next to continue
C:\Users\Rajkumar\Desktop\map\13.PNG
5. On the Feature Style page, keep the style type as Color, and type C.STATES in the render style field or click the Select button to choose the C.STATES style. Recall that you created the C.STATES style earlier in this OBE. Click Next to continue.
C:\Users\Rajkumar\Desktop\map\14.PNG
6. In the Style Picker Dialog, you define the label parameters. Check the Label Style box to enable the fields. Define T.STATE_ABBRV as the text style and select STATE_ABRV as the label column. Click Next to continue
C:\Users\Rajkumar\Desktop\map\15.PNG
7. Define query conditions to be applied. In this case, leave it blank, which means that all features within the current map extent will be selected. Press Next to continue.
C:\Users\Rajkumar\Desktop\map\16.PNG
8. This last page contains the summary information for the theme that will be stored in USER_SDO_THEMES database view.
C:\Users\Rajkumar\Desktop\map\17.PNG
10. Press Finish to end the wizard. The theme editor page open on the right side of the application.
C:\Users\Rajkumar\Desktop\map\18.PNG
11. Click Advanced under Theme Options to open the Advanced Parameters screen on the right.
C:\Users\Rajkumar\Desktop\map\19.PNG1
12. Click the Edit button (pencil icon) to open the Edit Info Columns dialog. You may need to scroll down to see the Edit button.
C:\Users\Rajkumar\Desktop\map\20.PNG
13. Click the Add a new row button (green plus sign) to add a new table row.
C:\Users\Rajkumar\Desktop\map\21.PNG
14. In the Column field, select STATE_ABRV and then enter STATE_ABRV in the Name field. The column must be exact, but the name is arbitrary and can be any value.
C:\Users\Rajkumar\Desktop\map\22.PNG
15. Click OK to close the Edit Info Columns dialog. The column/name pair is added to the THEME_STATES geometry theme. This is the most critical step for OBI integration. You defined the unique key column in the map data (STATE_ABRV) that will align with an OBI presentation attribute. Later in this OBE you complete this integration using the OBI Presentation Services Administration page.
16. Select the Preview tab at the bottom of the page and click the green arrow to display data for this theme. Your results should look similar to the screenshot. If desired, use zoom controls to adjust the preview.
C:\Users\Rajkumar\Desktop\map\23.PNG
17. Click the Save button to save THEME_STATES
C:\Users\Rajkumar\Desktop\map\Untitled.png
8.Creating Cities Theme
1. If necessary, click the Show Data button at the bottom of the screen to display the Data Navigator.
C:\Users\Rajkumar\Desktop\map\Capture9.PNG
2. Click the Tables tab.

3. Expand Spatial Tables > Geometry Tables > MVDEMO.
4. Right-click the CITIES node and select Create Geometry Theme to open the Define a Geometry Theme wizard. Click Next to continue
C:\Users\Rajkumar\Desktop\map\24.PNG
5. Notice that this Theme Parameters page is already populated with information obtained from the CITIES table. Define the theme name as THEME_CITIES and keep the other field values. PressNext to continue.
C:\Users\Rajkumar\Desktop\map\25.PNG
6. On the Feature Style page, set the style type as Marker and M.CITIES as the render style. Recall that you created the M.CITIES style earlier in this OBE. Click Next to continue.
C:\Users\Rajkumar\Desktop\map\26.PNG
7.In the Style dialog, check the Label Style box to enable the fields. Define T.CITIES as the text style and leave the attribute as CITY. Click Next.
C:\Users\Rajkumar\Desktop\map\27.PNG
8. In the Query Condition dialog box leave the query condition blank and click Next to continue.
C:\Users\Rajkumar\Desktop\map\28.PNG
9. This last page contains the summary information for the theme that will be stored in USER_SDO_THEMES database view. Review the XML definition of the theme so far.
C:\Users\Rajkumar\Desktop\map\29.PNG
10. Press Finish to end the wizard The theme editor page open on the right side of the application. then Click Advanced under Theme Options.
C:\Users\Rajkumar\Desktop\map\30.PNG
11. Click the Edit Info Columns button (pencil icon) to open the Edit Info Columns dialog. Then Click the Add a new row button (green plus sign) to add a new row.
12. Select the Preview tab (at the bottom) and click the green arrow to render the cities with labels. Your results should look similar to the screenshot. If desired, use zoom controls to adjust the preview.

C:\Users\Rajkumar\Desktop\map\32.PNG
13. Click the Save button on the Toolbar to save the theme definition.
C:\Users\Rajkumar\Desktop\map\Untitled.png
9. Creating Tile Layer
1.Open a browser and enter the following URL to connect to Map Viewer: http://host:port/mapviewer
2.Click the Admin link in the upper right corner to open the Login screen.
   3.On the Login screen, enter your OBIEE administrative username and password. In this example the username is weblogic
4.Go to “Create Tile Layer”, select “Google Maps” as map source type from drop down list and click “continue” button, Then Enter following details
C:\Users\Rajkumar\Desktop\map\Untitledf.png
5.go to below link then login with your google account
Create new project .In my case i created API project
6.After Creating Project
Go to APIs & auth -->Credential create New Key
7.Click Browser Key

8.After Creating Key Go to APIs




9.Click Url Short API
C:\Users\Rajkumar\Desktop\map\tu.png
11.Click Enable API
12.Copy that created API Key from Below Screen
13.Paste the API Key  Into Key Column  
13. : Go to “Manage tile layers” tab, select tile layer that you created and click “Bring Online” button.

10.Configuring Maps in OBIEE Analytics
1. Go to Administration link in Analytics, then go to “Manage Map Data”.
In “Layers” tab, click “import layers” button.
C:\Users\Rajkumar\Desktop\map\34.PNG
2.In the Edit Layer dialog, under BI Associations, notice that the layer key is set to STATE_ABRV, which is the column attribute you set earlier when you created the theme in Map Builder. Click theBI Key Columns icon (green plus sign)
C:\Users\Rajkumar\Desktop\map\Capture.PNG
C:\Users\Rajkumar\Desktop\map\40.PNG
3. Confirm that Geometry Type is set to Polygon.

4. Click OK to close the Edit Layer dialog.
5. Select the THEME_CITIES layer and click the Edit Layers button to open the Edit Layer dialog. Notice that the layer key is set to CITY, which is the column attribute you set earlier when you created the theme in Map Builder. Confirm that Sample Data is visible for the Layer Key.

C:\Users\Rajkumar\Desktop\map\42.PNG
6.click ok
7. Click the Background Maps tab.
C:\Users\Rajkumar\Desktop\map\35.PNG

8.In the Edit Background Map dialog, arrange the layers from top to bottom: THEME_CITIESTHEME_STATES, and select the zoom levels at which each layer can be displayed. Your results should look similar to the screenshot.
8888


C:\Users\Rajkumar\Desktop\map\43.PNG


11.Creating An Oracle Bi Anlysis with a MapView.
1. Select New > Analysis and select the OBIEEMAP subject area
2.Create a report from the subject area where map related data exists. And select “Map View” from the views list. And your map looks like the below image. Edit the map view and apply different formatting as per your requirement.

C:\Users\Rajkumar\Desktop\map\45.PNG

4 comments:

  1. Hi,
    Thank you very much for the post. I am trying to get mapviewer to work with some data i have. So i've got longitude, latitude for particular addresses in separate columns. The city is also available.
    How can i get this information to work with mapviewer?

    ReplyDelete
    Replies
    1. FYI, the data i have is worldwide, not particular to the US

      Delete
  2. This is very nice blog,and it is helps for student's Tableau Online Training

    ReplyDelete
  3. PERCHè IN OBIEE NON MI ESCE LA COLONNA CHIAVE DEFINITA NEL TEMA?

    ReplyDelete