Drive Time and Distance Bands in SAP Dashboards

With the release of CMaps Analytics Designer in Jan 2015, drive time polygons is a new premium layer. The service that powers this native layer is also made available to CMaps Plugin customers with small and medium enterprise bundles.

drive distance polygon

Drive time polygons is not available for use with CMaps Plugin Lite

The following tutorial explains how to connect CMaps Plugin in SAP Dashboards to the Drive Time Polygon service. Because the drive time service is optimized for CMaps Analytics Designer, there are several additional steps specific to SAP Dashboards that require some basic Excel skills.

Step 1. Open a dashboard project

Step 2. Add an XML Data Connection in SAP Dashboards. We named the connection Drive Distance.

drivedistance

Step 3. Bind the XML Data URL: https://cmapsanalytics.net/DriveTime/DriveTimeServlet?Format=simplexml&Cache=true&AuthenticationKey=[YOUR AUTHENTICATION KEY]

Step 4. Find your Authentication key. A valid product Authkey is required to use the service. Inside of SAP Dashboards, open the CMaps Plugin component, open the “Information” tab, scroll to the bottom to locate your license and auth key.

Copy the contents after the “:” (highlighted in yellow) and paste it into your spreadsheet or in your XML Data URL shown in step 3

Capture

Step 5. Set the MIME Type = text/xml

CaptureStep 6. Enable “Send” and create 3 input variables.

NOTE: It is important that the spelling and formatting of these variables match.

StartPoint: Needs to be formatted as a comma separated longitude,latitude and bound to a single cell.

CMaps Analytics generally uses a latitude,longitude format for loading data. This service currently uses longitude,latitude with plans to add geocoding in the future so you can type any location value.

If you have a latitude,longitude value in a cell, the following formula can be utilized to change it dynamically:

=IF(C2="","",RIGHT(C2,LEN(C2)-FIND(",",C2,1))&","&LEFT(C2,FIND(",",C2,1)-1))

Distances: Distances is the distance from the start point. This can also be a time. You can define multiple, comma seperated values if you want multiple bands (polygons) to be drawn at once. So “5,10,15” would draw 3 bands at 5,10 and 15 miles.

Unit: The unit will control how the polygons are drawn. The following is a list of supported units

“m” (meters)

“mi” (miles)

“km” (kilometers)

“min” (minutes)

EXAMPLE: The following is an example of the contents of each input parameter:

Capture


CaptureStep 7.
Enable “Load”

Step 8. Create your Range(s) which correspond to the Distances Input, and bind the Name property.

Create the same number of ranges as there are Distances values. If there are 3 distances as shown in the pictured example, you will create Ranges. In the image, the Distances parameter is “15,10,5”.

IMPORTANT NOTE: Each range name must be prefixed with “Range_”.  As shown in the image. If your dashboard changes the Distances input dynamically

Step 9: Bind each Range property to a single column of data

For each Distance polygon band, it will have its own range where the polygon cordinates are placed for CMaps Plugin. For example “Range_15” Range property is bound to a 200 cell column.

IMPORTANT NOTE: Generally a polygon will contain 300-400 points so bind the range to 400 points.

Step 10: Re-Format your Range column data.

NOTE: A critical step to successfully load the polygon data into CMaps Plugin is flip the data from Longitude,Latitude to Latitude,Longitude.

Assuming “G4” is the cell containing Long,Lat, here is how we can format it back to Lat,Long before binding it to the map.

=IF(G4="","",RIGHT(G4,LEN(G4)-FIND(",",G4,1))&","&LEFT(G4,FIND(",",G4,1)-1))

Copy the formula for each column and cell in your Range. The re-formatted range is what CMaps Plugin will be bound to.

excel

Triggering your XML Connection

connectionDuring dashboard runtime you can trigger a data connection with a button or using any number of data or driven data triggers. Because the web service can take 3-8 seconds to generate drive time polygons on the fly without network latency, it is not recommended to use sliders or other components to trigger drive time polygons.

 

Binding your Map

CaptureCMaps Plugin can be bound to the loaded output fields from the XML connector.

Step 1: Create the same number of layers as output variables (ranges) from the XML service. In the pictured example we would have 3 layers.

NOTE: For multiple bands, the layer ordering is extremely important to ensure the drawing and interactivity are to end user expectations. The largest bands in distance should come first and the smallest band is last. CMaps Analytics will stack each band on top of each other based on the ordering in the map.

Step 2: Set each layer type to Shape and click on the Shape options to the right of the radio button

shape

Step 3: Click on the configuration button next to the Shape Data radio button and select “Spreadsheet Data” and set the Type to “Polygon” Then click OK.

shape2

Step 4: With your new layer created, bind the “Address / Lat,Lng Range to the same column as your re-formatted XML Connection range covered in the above section, step 10. As you can see in the example below the Range_2500 “Range” is bound to the same range as the “Address / Lat,Lng Range” in CMaps Plugin.

Generally a polygon will contain roughly 200 data points.

shape3

Step 5: Click Preview to test your polygons.

Having Trouble?

We are here to help. The fastest path to resolution is working with our support team to verify your dashboard design. Simply send your XLF file to our support team and we will help identify and resolve configuration issues.

 KNOWN ISSUES

The polygon service only supports North America so international lat,long values will not work.