BIP and Mapviewer Mash Up I

I was out in Yellowstone last week soaking up various wildlife and a bit too much rain ... good to be back until the 95F heat yesterday.

Taking a little break from the Excel templates; the dev folks are planing an Excel patch in the next week or so that will add a mass of new functionality. At the risk of completely mis leading you I'm going to hang back a while. What I have written so far holds true and will continue to do so.

This week, I have been mostly eating 'mapviewer' ... answers on a post card please, TV show and character. I had a request to show how BIP can call mapviewer and render a dynamic map in an output. So I hit the books and colleagues for some answers. Mapviewer is Oracle's geographic information system, hereby known as GIS. I use it a lot in our BIEE demos where the interaction with the maps is very impressive. Need a map of California and its congressional districts? I have contacts; Jerry and David with their little black box of maps. Once in my possession I can build highly interactive, clickable maps that allow the user to drill into more information using a very friendly interface driving BIEE content and navigation. But what about maps in BIP output?

Bryan Wise, who has written some articles on this blog did some work a while back with the PL/SQL API interface. The extract for the report called a function that in turn called the mapviewer server, passing a set of mapping requirements, it then returned a URL to a cached copy of that map. Easy to then have BIP render that image. Thats still very doable. You need to install a couple of packages and then load the mapviewer java APIs into the database. Then you can write your function to the APIs. A little involved? Maybe, but the database is doing all the heavy lifting for you.

I thought I would investigate another method for getting the maps back into BIP. There is a URL interface you can call, this involves building an XML message to be passed to the mapviewer server. It's pretty straightforward to use on the mapviewer side. On the BIP side things are little more tricksy. After some unexpected messing about I finally got the ubiquitous Hello World map to render using the URL method.

Not the most exciting map in the world, lots of ocean and a rather long URL to get it to render.

Notice all of the encoding in the URL string to handle the spaces, quotes, etc. All necessary to get BIP to make the call to the mapviewer server correctly without truncating the URL if it hits a real space rather than a %20. With that in mind constructing the URL was pretty simple. I'm not going to get into the content of the URL too much, for that you need to bone up on the mapviewer XML API. Check out the home page here and the documentation here.

To make the template portable I used the standard CURRENT_SERVER_URL parameter from the BIP server and declared that in my template.


Ignore the 'myserver', that was just a dummy value for testing at runtime it will resolve to:


Not quite what we need as mapviewer has its own server path, in my case I needed 'mapviewer/omserver?xml_request=' as the fixed path to the mapviewer request URL. A little concatenation and substringing later I came up with


Thats the basic URL that I can then build on. To get the Hello World map I need to add the following:

<map_request title="Hello World" datasource="cagis" format="GIF_STREAM"/>

Those angle brackets were the source of my headache, BIPs XSLT engine was attempting to process them rather than just pass them. Hok Min to the rescue ... again. I owe him lunch when I get out to HQ again! To solve the problem, I needed to escape all the characters and white space and then use native XSL to assign the string to a parameter.

<xsl:param xdofo:ctx="begin"name="pXML">%3Cmap_request%20title=%22Hello%20World%22

I did not need to assign it to a parameter but I felt that if I were going to do anything more serious than Hello World like plotting points of interest on the map. I would need to dynamically build the URL, so using a set of parameters or variables that I then concatenated would be easier.

Now I had the initial server string and the request all I then did was combine the two using a concat:


Embedding that into an image tag:

<fo:external-graphic src="url({concat($mURL,$pXML)})"/>

and I was done. Notice the curly braces to get the concat evaluated prior to the image call.

As you will see next time, building the XML message to go onto the URL can get quite complex but I have used it with some data. Ultimately, it would be easier to build an extension to BIP to handle the data to be plotted, it would then build the XML message, call mapviewer and return a URL to the map image for BIP to render. More on that next time ...


I think your "This week I will mostly be..." is from "Jesse's Fashion Tips" on the Fast Show. What a great programme...

Posted by Jim on June 08, 2010 at 10:36 PM MDT #

Got it in one Jim

Posted by Tim on June 09, 2010 at 02:59 AM MDT #

Couldn’t have said it better myself Wonderful information.I agree 100% great site. Please keep blogging!!

Posted by organizasyon on June 21, 2010 at 10:12 AM MDT #

You actually raise the right points, still , There's no doubt that your primary analysis definitely is off base, really good piece of content though, great job. Allison

Posted by Colby Diersen on July 27, 2010 at 03:58 PM MDT #

I'm finding out lots of interesting ideas from this site.

Posted by Mitchell Lingo on September 12, 2010 at 01:41 AM MDT #

I am exploring the capabilities of mapviewer with BI to produce dashboards reports. Need a little handholding.
Have used mapviewer in the past and know database very well. But new to BI publisher.

Where do I start after installing bi publisher.

Thank you very much

Posted by guest on September 08, 2011 at 01:48 AM MDT #

If you are looking at dashboards and ad-hoc reporting and merging maps into the dashboard. There is configurable out of the box mapping integration with OBIEE 11g. Its covered in the documentation.

If you are looking specifically at BIP, then this comes with the braoder suite or can be installed on its own. If its BIP, then this article and a couple of others on the blog will help.

Posted by Tim on September 08, 2011 at 04:33 AM MDT #

Post a Comment:
  • HTML Syntax: NOT allowed

Follow bipublisher on Twitter Find Us on Facebook BI Publisher Youtube ChannelDiscussion Forum

Join our BI Publisher community to get the most and keep updated with the latest news, How-to, Solutions! Share your feedback and let us hear your voice @bipublisher on Twitter, on our official Facebook page, and Youtube!


« July 2014