Hi guys, Here is what I have in my mind:

  • I have a ~40GB compressed XML file on the host of OSM, I want to have separate downloadable files on my website for each city, so one shouldn't download whole country's database. However I guess I should include freeways and outskirts of a city, and it will probably have common areas if one wants to download two nearby cities, so it should understand and won't download what is already available.
  • No need to download further information for routing. The routing information should be included
  • I want to add extra information about a point on the map (either text or image), and they should be dynamic, so it shows metro schedule and the next train, or current problems on route or certain location online.
  • I want to add traffic information, and include it in routing.
  • If it is possible I want to add multiple condition for routing, e.g. one can say how can I go to X and have a Gas station, bank and... in my way with minimum traffic base on the hour.

I haven't worked with OSM APIs, so I don't know what they can do... which would work together better, and where should I implement my own codes. I read wiki.openstreetmap.org, but there where little information about each APIs and it would be nice to see a lot of sample codes so I can get ideas from them, there are only a simple project with each API, not a compilation of them.

asked 19 Jul '15, 12:18

youyeg's gravatar image

youyeg
11114
accept rate: 0%

edited 19 Jul '15, 12:19

4

This is way too ambitious for a simple help.openstreetmap.org answer. Essentially you want a complete mapping stack customised to your own requirements. Your requirements would take an OSM specialist days, even weeks to build (and several parts, such as train schedules and traffic levels, are not included in OSM at any rate). I think the nearest you'll get is checking out Mapbox's paid-for plans (http://mapbox.com), which are substantially OSM-based, and seeing if any of them come close to your requirements.

(19 Jul '15, 16:14) Richard ♦

I don't know where to began and choose which APIs. I need to know where I should began to implement my own parts, and where I can use others' work. I explained, so you know where I am to go. Thanks..

(19 Jul '15, 21:25) youyeg
2

First of all, openstreetmap.org's API is for editing. You're not building a map editor, so it's not relevant to you. You will need to use third-party components based on OSM data. As it happens, since you want offline use, online "APIs" per se probably aren't much use.

As SomeoneElse said, you need to break the question into parts - you have asked for simply too much. But at a very rough stab, look at GraphHopper for routing, and the Mapbox SDKs for map display. Traffic information is not included in OSM, nor are public transport timetables. I don't know of any modern, common library that uses the same info for map display and for routing.

(20 Jul '15, 08:31) Richard ♦

You know, the reason why I explain my work as a whole was that the reader know what I need. Surely if I wanted to ask separately I should have give explanation for each API I think I might need, and I thought it would cause further confusion. Anyway, I looked into Mapbox, and began to read its documents. About the traffic, I was thinking if it is possible to give the routes a weight, like a graph, so the nearest destination calculate base on the sum of weights. I don't expect that I have all I want at once, I want a library to access to map, a library for routing, and a library to display the map, and I know I should develop rest of it on my own. Could you please recommend those library which work best together? Reading map, Displaying map, and Routing. Thanks :)

(20 Jul '15, 08:53) youyeg
3

Well, the general expectation is that you try and find some stuff out yourself, and then come here when you're stuck.

Yes, you can give segments in a routing graph a weight, using OSRM or GraphHopper or any similar library. I'd suggest you download one, play with it, and then ask again here if you're having troubles.

Bear in mind that OSRM (aka Mapbox Directions) will not run comfortably on-device, whereas GraphHopper can.

(20 Jul '15, 09:05) Richard ♦

Thank you Richard.

(20 Jul '15, 09:09) youyeg
3

The main OSM API is only for editing so you won't be using that. Then there's a Nominatim API operated by the project which allows you to find places on the map of which you only know a name. Then there's project-osrm.org which is a third-party OSM based routing engine that finds you the fastest route from A to B. Then there's overpass-api.de which is a third-party search service for the OSM database that can do more "programmer like" queries than Nominatim can. All of these services require an online connection and have strict usage limits. If you want to go offline then you might want to look into "libosmscout". But if you hope that there are ready-made components that you just have to mix and match then you will be disappointed; existing libraries will only do a small part of what you are looking for.

(21 Jul '15, 19:10) Frederik Ramm ♦

Your answer was very helpful Frederik, I wish I know more about OSM-based free offline APIs so I could combine and develop what I need. I looked into wiki.openstreetmap.org, but there were no comprehensive list of OSM-based projects, it would be great if there were a list with features of each one. Anyway, I should thank you a lot. :)

(22 Jul '15, 08:46) youyeg
showing 5 of 8 show 3 more comments

As Richard has said, public libraries to do what you want in its entirety do not exist (on any platform). As you've found, there are solutions to some parts of the problems that you're posing yourself, but not others, and certainly not all together.

Where you go next is likely to depend on what it is that you're actually trying to do and how much money you've got - are you trying to develop a commercial app, or is this just a college project? If the former, then paying someone someone else to help you with what's possible, what's not and how much it'll all cost is surely the way forward. There are some possibilities listed here, and I'm sure there will be suggestions in the wiki too. If the latter, then obviously you have to develop something yourself. I'd suggest breaking the problem down into parts and seeing what bits OSM data can help with and what parts it can't. The essence of OSM is that 40Gb of data that you've downloaded - what you do with it after that is up to you.

permanent link

answered 19 Jul '15, 22:25

SomeoneElse's gravatar image

SomeoneElse ♦
36.1k71366854
accept rate: 16%

For Android you can try mapsforge and GraphHopper which both are running offline on the device. GraphHopper includes a simple Android demo including some maps to download. GraphHopper also runs on iOS too, but I do not know much about offline libs for maps there. (note: I'm the author of GraphHopper)

But traffic data and offline is not fitting well together :). Though you can integrate traffic in the routing but your devices need online access - see this blog post

permanent link

answered 23 Jul '15, 10:11

peatar's gravatar image

peatar
3512312
accept rate: 8%

Thanks, I began to work of GraphHopper, and I will ask if there were anything to ask. I thought I could have something like MAMPS.ME (MapsWithMe) so routing data and maps data could be together. Would it be possible? With GraphHopper? :) Thanks.

(24 Jul '15, 08:47) youyeg

Hi youyeg, two rules for this forum; its specific for OSM troubles, not for developers and theyre troubleshooting. ask one question at the time, so that you end up whith an clear answer to your question. Greetz Ps Try to ask or take a look here http://wiki.openstreetmap.org/wiki/Develop

permanent link

answered 19 Jul '15, 16:08

Hendrikklaas's gravatar image

Hendrikklaas
9.3k200237385
accept rate: 5%

Hi, could you please link me to the proper section? Thanks. :)

(20 Jul '15, 05:30) youyeg

OK. But, what I was looking for was what the existing APIs can do, and where should I try to fill the gap. It would be very appreciated if someone could say: A can do this, but has this limitation, and B can do that part for you and... I couldn't even find collection of examples in OSM, just API and an example only for that API. I wish I could find a slightly similar project and look into it and then finally figure out what should I do!

permanent link

answered 20 Jul '15, 03:10

youyeg's gravatar image

youyeg
11114
accept rate: 0%

edited 20 Jul '15, 05:34

Your answer
toggle preview

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:

×351

question asked: 19 Jul '15, 12:18

question was seen: 3,076 times

last updated: 28 Jul '15, 17:24

powered by OSQA