Using PTV xRoute Server with Java/Jsp and C#1  Overview2  Use case samples3  Sample 1: Calculate distance and travel time for a simple route3.1  Jsp Sample4  Sample 2: Calculate an extended route for a car4.1  Jsp Sample5  Sample 3: Calculate an extended route for a truck with different total weight (TOTAL_WEIGHT)5.1  Jsp Sample6  Sample 4: Calculate an extended route for a truck with different height (HEIGHT)6.1  Jsp Sample7  Troubleshooting8  C# installation
Back to PTV xServer Management Console

Using PTV xRoute Server with Java/Jsp and C#

Overview

If you have accessed this page through the xServer's management console, you can immediately view and execute the Jsp code samples, just click the links below. Refer to the troubleshooting section if the samples do not work. This page is best viewed with Mozilla Firefox.

In order to install the C# samples which are not displayed here by default, refer to the C# installation section.

These samples are designed to be executed with the default data of Luxemburg. If you changed the data path in xroute.properties these samples may not work properly.

Use case samples

Please choose an xRoute sample use case

Sample 1: Calculate distance and travel time for a simple route

This sample shows how to calculate distance and travel time for a simple route consisting of two stop-off points.

Jsp Sample

View the source by clicking 'show/hide source' below, or execute it by clicking execute.

Sample 2: Calculate an extended route for a car

This sample shows how to calculate distance, travel time and a street list for an extended route consisting of two stop-off points.

Jsp Sample

View the source by clicking 'show/hide source' below, or execute it by clicking execute.

Sample 3: Calculate an extended route for a truck with different total weight (TOTAL_WEIGHT)

This sample shows how to calculate distance, travel time and a street list for an extended route consisting of two stop-off points.

The road is blocked for heavy trucks.

Two Results are listed:

1) a truck making a detour

2) a truck driving the direct way

Jsp Sample

View the source by clicking 'show/hide source' below, or execute it by clicking execute.

Sample 4: Calculate an extended route for a truck with different height (HEIGHT)

This sample shows how to calculate distance, travel time and a street list for an extended route consisting of two stop-off points.

The road is blocked for high trucks.

Two Results are listed:

1) a truck making a detour

2) a truck driving the direct way

Jsp Sample

View the source by clicking 'show/hide source' below, or execute it by clicking execute.

Troubleshooting

If the Jsp samples cannot be executed, please view the source code and check the serviceUrl variable.

C# installation

The C# samples can be found in the xServer's samples folder. Please unpack them into the root folder of your local IIS installation, usually C:\Inetpub\wwwroot. Then call the IIS management console from the Control Panel and register the sample folder as IIS application.

Additionally make sure, that Microsoft.Net Framework 2.0 redistributables are installed and ASP.NET is registered within Internet Information Services (IIS). For registration use the ASP.NET IIS Registration tool with the command line

aspnet_regiis.exe -i

After having executed these steps, please reload this page. The C# samples are automatically displayed and can be executed.