How to gather BCR file from xServer to trigger guided navi?

PTV's mobile solution based on off-line maps - standard application and SDK
Post Reply
User avatar
Bernd Welter
Site Admin
Posts: 2572
Joined: Mon Apr 14, 2014 10:28 am
Contact:

How to gather BCR file from xServer to trigger guided navi?

Post by Bernd Welter »

Hi there,

as you know the PTV Navigator is able to use a so-called BCR file to guide a driver along a given route - this is what we call "guided navigation". Here's an example of such a string / text. Below the sample I explain different techniques of "how to assemble such a file" based on the output of different engines...
[CLIENT]
ROUTENAME=xServer 2 - guided navigation route export
MAP_VERSION=unknown

[COORDINATES]
STATION1=937170,6270123
STATION2=936043,6274708

[VISITED]
STATION1=0
STATION2=0

[Station2Segmentcenters]
Point1=936972,6269962,238
Point2=936583,6270029,350
Point3=936350,6270099,270
Point4=936080,6270359,0
Point5=934091,6272218,38
  • PTV Developer: Code Sample
  • xRoute2: probably the easiest way. The regular routing method calculateRoute offers a parameter resultFields which enables you to request a complete BCR text (BASE64 encoded): guidedNavigationRoute
  • xRoute1: as this engine does not return a ready-to-be-used BCR you would have to write your own implementation of a BCR converter. Check the section Interface for Guided Navigation in the User Guide Guided Navigation. Or look at the famous PTV xServer Cookbook!
  • MAP&GUIDE Internet: offers a feature where you can send a route straight to a PTV Navigator device once you defined the connection between M&G and the device based on the device ID.
  • Other engines: probably same as with xRoute1- at least if the engine offers the required input such as coordinates.
Best regards,
Bernd
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
User avatar
Bernd Welter
Site Admin
Posts: 2572
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: How to gather BCR file from xServer to trigger guided navi?

Post by Bernd Welter »

I've jst been asked by some client about how to get this nice BCR string displayed in the post.
Well, here's what you should be aware of when you use xRoute2.calculateRoute / RouteResponse:
  • gather the byte array given in guidedNavigationRoute
  • Transform the byte array through

    Code: Select all

            public static string getBcrFromByteArray(byte[] bytes)
            {
                return Encoding.UTF8.GetString(bytes).Replace("\n", "\r\n");
            }
    
Does this help? Works fine in my C# driven samples... Maybe you need to look for similar libs in your programming language.
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
Post Reply