NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

We have a application where we need routing information(Transport distance) between two points so I am trying to setup my own routing server. I used OSRM backend API to calculate routing waypoints but they have usage limit. Alternatives to that are Mapbox(Paid APIs), Openlayers(Free APIs).

Geofabrik provides data extracts in .osm.pbf format But how can I use the data to to get routing information(distance between two LatLong).

I explored leaflet library also, but they seems to be using same OSRM backend API.

Should I create my own library to access this data or using Openlayers is good option? Any suggestions, ideas or if I am mising out anything, Please guide me.

asked 03 Mar '23, 14:05

Vikas%20Singla's gravatar image

Vikas Singla
16224
accept rate: 0%


You can set up either GraphHopper or OSRM on your own infrastructure, then load a PBF file from Geofabrik into that software, and then use the API on your own server. Both Leaflet and OpenLayers can be used but the routing software's API could also be used directly by the application that requires the distance, no need to use a Javascript library.

permanent link

answered 03 Mar '23, 15:50

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Hey thanks, I was able set up my own OSRM and load pbf file from Geofabrik. However, if I load for smaller region like berlin. It works. But if I try it for entire US. It does not. I am trying to figure out.

(06 Mar '23, 04:49) Vikas Singla
1

OSRM has hefty hardware requirements and you may need a bigger server to run the whole US.

(06 Mar '23, 11:35) Richard ♦

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×3

question asked: 03 Mar '23, 14:05

question was seen: 915 times

last updated: 06 Mar '23, 11:35

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum