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

I want to write an offline app that read my country's map and the end user can select two points on the map and the app must calculate all ways between these points and based on some other condition show the best way to the user

asked 28 Jun '16, 06:28

Moolerian's gravatar image

Moolerian
16113
accept rate: 0%


You almost certainly do not want all ways since that would be a very large number (including all detours). What you are looking for is a routing algorithm; you don't want to compute all ways first and then select the best, but instead apply an algorithm that finds the best right away. There are ready-made routing engines for OSM that you could use (e.g. GraphHopper), or building blocks that you can somehow call from your application (e.g. libosmscout). Of course you can also choose to write everything yourself; search for the terms "routing" and "graph" on this help site for more pointers.

permanent link

answered 28 Jun '16, 06:49

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

edited 28 Jun '16, 06:52

thank you , i know that i don't want ALL ways i want sth like google direction in it's map but mine is offline and suggested direction based on some manual conditions

(28 Jun '16, 07:11) Moolerian

Hello Moolerian, I assume that you have already seen the OSM wiki page http://wiki.openstreetmap.org/wiki/Routing ... also with its sub pages about online and offline routing ... What solution comes near your aim? IIRC graphhopper has now a feature implemented about alternative routes.

(01 Jul '16, 15:16) stephan75

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:

×167
×126
×63

question asked: 28 Jun '16, 06:28

question was seen: 3,622 times

last updated: 01 Jul '16, 15:16

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