Saturday, February 21, 2015

Setting Up Spatial Data Source in MapViewer

To use Map Views within OBIEE there must be an Oracle database setup with a schema to manage the metadata associated with Map Builder and and MapViewer.  If you are using other databases for your source data you still need the Oracle database for the map metadata; it can even be Oracle Database Express Edition 11g Release 2

If you follow the setup for the MVDEMO that is provided by Oracle you will get basic a schema with maps for majority of the Countries and a full collection of Map metadata to support MapViewer.

I will leave the Oracle preloaded demo data for you to explore on your own as there is quite a bit there.

My intent with this post is to show how to set up a map source separate from the MVDEMO.

The first thing you need to do is create a schema that is going to hold your spatial metadata.  Log into your Oracle Database using sys or sysdba. You can do this with SQLPlus or my favorite tool SQLDeveloper.

For this post we will create a user/schema mvdata to hold our tables with geometry data and give the user proper privileges within the database.


--Create a new user mvdata:

create user mvdata identified by mvdata;

--Grant some privileges to this new user:

grant connect, resource, unlimited tablespace, create view to mvdata;


mvdata_01


Now that the ID is created we need to update the mapviewer.config and add our new schema.


Log into the MapViewer Administration Console

http://server:9704/mapviewer/



Within the MapViewer Admin Console go to the Management tab and select Configuration.





 Scroll to the end of the config panel to the section labeled
<!-- ******************** Predefined Data Sources ******************** -->




Copy the example provided and paste below removing the <!-- and -->
Provide your server information, user ID and password.  Note to put an ! before your password so that the clear text will get encrypted when MapViewer is restarted

<map_data_source name="mvdata"
     jdbc_host="localhost"
     jdbc_sid="xe"
     jdbc_port="1521"
     jdbc_user="mvdata"
     jdbc_password="!mvdata" 
     jdbc_mode="thin"
     number_of_mappers="3"
     allow_jdbc_theme_based_foi="false"
     editable="false"
/>

Click the Save & Restart below the config text area.

After restart, scroll back to the bottom to check the encryption.






Confirm that your datasource is set up, switch to the Datasources view.




One thing we can do while still within MapView Admin Console is to create a Map Tile Layer.  This Tile Layer is the background or wallpaper on which to project our Map Themes.

Go to the Create Tile Layer section.






You will notice you have a few choices

  • Internal
  • External
  • Oracle Maps
  • Bing Maps
  • Nokia Maps
  • Google Maps
  • TomTom Maps
The last four require you to get a license key to function.  Each has their own SRID projection.  In a later post I will compare each of them as well as discuss SRID.
For now we will use the Oracle Maps




Select your newly created data source to add this tile layer.

Click Submit to save.

You will be taken to the Manage Tile Layers section




In the list select your Tile Layer and click the View




On the next pane click Show to view the Map Tile Layer




If all is configured correcly you should see the world map




Now we are ready to start creating our collection of spatial data for use within OBIEE.