YOURS

From OpenStreetMap Wiki
Jump to: navigation, search
Help
Available languages
English Русский
Quick links
Live demonstration
Routing engine
Indexing service
Route altitude profiles
Routing Benchmarks

This is the main wiki project page for YOURS, Yet another OpenStreetMap Route Service.

Contents

Introduction

YOURS goal is to use OpenStreetMap data to make a routing website utilizing as much other (opensource) applications as possible. Currently integrated applications are:

Name

As there are already a number of route services using OSM data it becomes more difficult to find a suitable application/project name. Each ones name contains relevant words like 'open', 'service', 'route', etc. So I thought of 'Yet Another Openstreetmap Routing Service' short YAORS which sounds like 'yours' hence: YOURS. As in 'your route service'...oh well :-)

Features

Compare YOURS against other online OpenStreetMap navigation websites.

Development

YOURS code is available under the BSD license. You can download the code for version 1 (as shown on http://www.yournavigation.org) from the OpenStreetMap SVN server:

 svn co http://svn.openstreetmap.org/applications/routing/yours/branches/version-1.0-via

The developer version which will support route via's and driving directions will be committed to the trunk of the repository in a few weeks. Contributors please check out the branch 'version-1.0' only. SVN trunk is not yet up to date!

 svn co http://svn.openstreetmap.org/applications/routing/yours/trunk (Do not use this link)

Contact, bug reports and feature requests

Bug reports and feature requests should preferably be done as Trac tickets assigned to the YOURS project. You can also add your comment to the discussion page or forum topic. For other stuff you can email me: osm at na1400 dot info but I'm also often present on the irc channels #osm and #osm-dev between 09:00 and 23:00 CET.

Contribution

Any help in making YOURS better is welcome! Please refer to a ticket when committing your changes like:

 Added new feature blah (refs #1234)

Where 1234 is the ticket number requesting the new feature or bugreport

Known issues

There is a list of active Trac tickets. A list of sub-optimal or weird routes is listed here.

Altitude profile

The altitude profile is based upon SRTM data which comprises multiple terabytes of data when covering the world but sponsored servers usually don't have that amount of storage available. A possible solution for this is to spread the data over a number of servers. Below is a list of currently supported servers by YOURS. Please send me a message if you have configured a server yourself and want YOURS to support it too. If you decide to configure a profile server please make sure to overlap the neighboring areas by e.g. 1 degree as that will make generating profiles easier.

Host Base URL Area description Area bbox
Metacarta http://labs.metacarta.com/altitude/profile/ North and South America N60 W-179 S-56 E-44
Komяpa http://altitude.komzpa.net/profile/ Belarus N57 W23 S50 E33

The website

Setup instructions

Prerequisites

Installing Gosmore routing engine

Installing YOURS website

You should now have a directory named 'yours' in the public html directory.

Finally

Start your browser and go to: http://www.my-server.com/yours and enjoy!

Embedding YOURS into 3rd party web application

It's fairly easy to get routing in your own web application. Determine the TO and FROM coordinates and ask www.yournavigation.org to calculate a route for you. Have a look at the API documentation for more information on the parameters and it's usage.

Cross-site AJAX calls

Browsers don't allow cross-site AJAX calls (it's a security restriction). There are two possible solutions for this:

  1. Relay the request to www.yournavigation.org via a proxy on your own server.
  2. Use a 3rd party JavaScript library that uses tricks to perform cross-site AJAX requests. E.g. by using a Flash or Java applet.

Option 1 is probably easiest to understand and implement. There are many proxy's available on the internet, but the YOURS repository already contains a proxy for cross-site calls: Transport.php

Once you have the proxy in place on your server then you can request a route using an AJAX call like this (untested!):

var url = 'http://www.my-server.com/yours/transport.php?url=http://www.yournavigation.org/api/1.0/gosmore.php&format=kml&flat=52.215676&flon=5.963946&tlat=52.2573&tlon=6.1799&v=motorcar&fast=1&layer=mapnik';

Notice the replacement of 'gosmore.php?' with 'gosmore.php&' compared to regular URL constructions when using the proxy script in the example above.

Note: This proxy script needs the CURL plugin for PHP.

Websites that run their own instance of YOURS

Please add your website here

API documentation

If you would like to embed some of the functions of the YOURS website in your own site or application then you can incorporate the API. The API is described below.

Usage

Use of the API is on a Fair Use Policy basis: everyone can use the API as long as it won't overload the server systematically. If you do overload but provide an X-Yours-client header (as described below) then I'll try to contact you to find a solution. If you don't provide this information (or I can't contact you) then you might become blocked (this has happened only once so far, so don't worry too much about it).

Speed/Reliability

The sponsored server that runs www.yournavigation.org only has 2 GB ram but the routing database is about 12 GB. This forces the server to move blocks of data in and out of ram when there are multiple concurrent users that request routes all over the world. Despite the speed with which Gosmore is able to calculate routes in optimal conditions, the harddisk seeks will slow the server down almost completely in case of such situation and new requests might be rejected if there are already too many concurrent requests running (this happens quite often unfortunately, multiple times per day). There is not much that can be done about it unless the server is upgraded with more ram and/or an SSD harddisk (Hint!).

API revisions

The API can have multiple revisions. In each version the interface is kept unchanged to prevent 3rd party applications from becoming broken. Each API version is kept in it's own directory which allows multiple API versions to operate simultaneously without interfering with each other. 3rd party developers can then gradually move from one version to another without being forced to do so on short notice. Note: The API interface can change without notice as long as it's called 'dev'.

The current API revision is '1.0'. The 2.0 API is being developed as 'dev'. The base URL for each API is: http://www.yournavigation.org/api/, so the 1.0 API is located at: http://www.yournavigation.org/api/1.0/ and the dev API is located at: http://www.yournavigation.org/api/dev/.

Version 1.0

Clients of this API version are kindly requested to identify themselves using an extra HTTP header: X-Yours-client. This way the (amount of) users can be tracked and appropriate action taken if a 3rd party application is overloading the service or otherwise misbehaving. E.g. the yournavigation website is identified by X-Yours-client: www.yournavigation.org.

Routing API

The routing API provides routing information based upon a given start/end location and some route parameters like the vehicle type, etc. The resulting route is returned as a KML file containing all the nodes from start to finish. If Gosmore is unable to successfully calculate a route then the most complete route so far will be returned.

Base URL

http://www.yournavigation.org/api/1.0/gosmore.php

Parameters

Available parameters are described below. Only the location parameters are required. All other parameters are optional, they will use the default value when omitted.

Example URL

http://www.yournavigation.org/api/1.0/gosmore.php?format=kml&flat=52.215676&flon=5.963946&tlat=52.2573&tlon=6.1799&v=motorcar&fast=1&layer=mapnik

Export API

YOURS can export a route in different formats, like Waypoints or GPX track. Provide the route and it will return the route in the requested format.

Base URL

http://www.yournavigation.org/api/1.0/saveas.php

Parameters

Example URL

http://www.yournavigation.org/api/1.0/saveas.php?type=gpx&data=5.62373%2053.01,5.62359%2053.01014,5.62336%2053.01024,5.62314%2053.010303

API users

Please add your service here as well

Todo list

Personal tools
Namespaces
Variants
Actions
site
Toolbox