pgRouting

WebRouting Service (WRS)

[日本語]

Introduction

WebRouting Service is a Web service designed to use easily the routing functions through HTTP protocol. WebRouting Service is based on REST (Representational State Transfer), which is a "Ressource-oriented architecture" (see the book RESTful Web Service by Leonard Richardson & Sam Ruby). WebRouting Service is developed in Java language and uses Restlet framework, which is a framework for mapping REST concepts to Java classes.

To be easily used, WebRouting Service can deal with many kinds of geographic formats (Geojson, Gml, Kml,...)

Installation (Version 1.0)

Checkout the project from the SVN repository:

svn checkout http://pgrouting.postlbs.org/svn/pgrouting/branches/routingservice wrs

Requirements:

 * pgRounting 1.0
 * Java Runtime Environment (JRE) 1.5 or higher

Thanks to Java technology, WebRouting Service can be installed on any operating system (OS) accepting a Java implementation. Currently, we have only tested WebRouting Service under Linux environment. And for the client, you only need an application which is able to make and to send POST or GET request to a server.

Download WebRouting Service:

Download the latest release of WebRouting Service. When the download is done, unzip the tar file into the directory where you want to install your WebRouting Service.

Configuration:

Before to start WebRouting Service you need to configure your server. To do it, you have simply to edit the "configuration.xml" file. You can find it at the root of your WebRouting Service directory.

How to start under Linux:

Now your WebRouting Service is ready to start, simply call the shell script: "start.sh". If there is not any error, your installation is OK, the! WebRouting? Service could start. Otherwise two possibilities:

  • Your XML configuration file is wrong, in this case go back to "Configuration" step.
  • Your JRE is not correctly installed or the JAVA_HOME environment variable is not defined correctly.
./start.sh

How to use

Your installation seems OK, we will try to make a request, but before it, an glimpse of "How works WebRouting Service".
You have two ways to call your WebRouting Service: GET request or POST request.

For both ways, you must provide a URL which will specify: the provider, the service, and which kind of format you want for input and ouput data. The URL format must be like this:

http://ip_address:port_number/provider_name/format_for_input_data/service_name.format_for_output_data

Example:

http://178.1.1.10:8182/geobase/geojson/shortest_path.kml

In this example you call the WebRouting Service with data from geobase provider and geojson input data, and you ask to shortest path service with KML result object. Thus, the URL specifies "what I have" and "what I want". The next step is: provide the value of the parameters used by the specified service. All parameters available for one service are specified in XML Configuration file, you can also set if one parameter is required or only optional. To do this step, you have choice between GET or POST request.

Now, you are really ready to make a request. Go within "tests" repertory and open "test.html" file. This simple page provides you an easy way to test your WebRouting Service. You have just to fill in the form and GET/POST request will be automatically generated. The result of your request will be appear in the bottom of your web page.

If it doesn't work, go back to "Installation" step.

== How to build==

Soon available :)