Use Cases > PTV xRoute > How to Use BCR Converter

How to Use BCR Converter

BCR Converter

With the PTV xRoute Server in combination with the BCR Converter it is possible to calculate and export routes into a standard-format called BCR format. The BCR format is an easy readable text file format e.g. used in PTV Navigator or PTV Map&Guide products.

To export a calculated route from a PTV xRoute Server an additional xRoute java class library is available, called PTV xRoute Server BCR Converter. This extension allows a PTV xRoute client to convert a PTV xRoute route object into a string in BCR format. For this example, we assume that you know how to calculate a simple or extended route.

Benefits

Prerequisites

Installation Guide

Configuration Guide

The PTV Route Server BCR Converter library contains the public class BCRConverter. It converts a PTV xRoute response to BCR (text) format and tapers the route according to quality parameters.

The route is represented as polygon of Magnetic View Points (MVP) that are set in the middle of each segment and also contain the heading, length, and station index of the current segment.

There are three quality parameters which influence the route tapering:

BCR Parameter

Programming Guide

If you want to export a route into a BCR formatted file, you have to execute the following steps:

  1. Calculate a route
  2. Pass this route to the BCR Converter
  3. Export the results into a text file

If you want to calculate a route you have to be aware that the response of the server includes a complete route containing its geometry (set polygon true)

ResultListOptions resultListOptions = new ResultListOptions();  
resultListOptions.setPolygon(true);
		

The below named parameters can be optionally used to dilute the magnetic view points.

public class BCRBasic {  
public static double maxangle = 3.0;  
public static int maxdistance = 50000;  
public static int mindistance = 10;
		

Call the method BCRConverter to export a route in this specific BCR format which will be used for guided navigation.

private static String runBCR(Route route) {  
  String bcr_export = "";  
  try {  
    bcr_export = BCRConverter.route2BCR(route, maxangle, maxdistance, mindistance);  
  }   
  catch (Exception ex) {  
    bcr_export = "Converting failed";  
  }  
  return bcr_export;  
}  
		

The example BCR basic is also executable as a stand-alone java program. Using the PTV xMap server the route will be plotted besides the BCR export in a *.bcr text file using the BCR libraries.