2

I've been looking at OSRM for distance calculations and essentially have the following query which does a distance calculation between two postcodes in the UK.

http://maps.googleapis.com/maps/api/distancematrix/json?origins=KY3%200RS&destinations=DD3%209LE&sensor=false&units=imperial

The server API documentation (https://github.com/DennisOSRM/Project-OSRM/wiki/Server-api) doesn't seem to have any mention of post codes, only londitude and latitude.

Does anyone know what the equivalent to the Google maps query in OSRM would be? Also, if you have any other recommendations on FOSS routing projects and how retrieving a distance based on two postcodes could be achieved.

scai
  • 20,297
  • 4
  • 56
  • 72
jmood
  • 77
  • 2
  • 9

1 Answers1

4

OSRM is not a geocoder, just a routing engine. Hence you will need a geocoder for converting addresses into exact locations. Nominatim is a great geocoder based on OSM data. Unfortunately Nominatim still has problems with postcodes, but give it a try. There are also other geocoders using OSM data.

In case you are wondering how OSRM's web frontend is able to convert addresses to locations: It just uses Nominatim in the background.

scai
  • 20,297
  • 4
  • 56
  • 72