I think OSM is an accomplishment on the significance level of Wikipedia and I'm glad it exists.
I think OSM is an accomplishment on the significance level of Wikipedia and I'm glad it exists.
I don't think Google actually dog foods their Android Google Maps API, so it tends to be pretty limited.
Very common operation is looking for pairwise distance matrix. Pricing and limits are totally irrational.
100,000 daily limit is totally impossible for an app with 10 users. 100x100 = 10,000 :D
Given that Google probably has all of the distances cached somewhere on their servers, I see no technical reason why this limit can't easily be increased. My app can have millions of shortest paths requests per day, and I certainly do not have Google's infrastructure.
I get incomparable functionality using OSM.
https://developers.google.com/maps/documentation/javascript/...
I'm also not aware of OSM offering anything comparable out of the box, although there are some commercial providers who offers similar paid services based on OSM data.
Also, if you think "all of the distances" are cached, I invite you to estimate how many places there are in the world and how big a matrix of every distance from every point to every other point would be.
(Disclaimer: Used to work on Geo at Google. Opinions mine only, etc.)
OSRM is a nice project - out of the box. The lead went to some giant - so project is currently a bit stray but there are also some other alternatives on github which work well but might not be as mature as OSRM.
Google caches insane amounts of things. What one might think is insane algorithms, it's probably just Googles multimillion cluster memory.
Google is also lucky that no one needs the whole matrix, I'm sure that distance matrix is insanely sparse and can be stored in not that large amount of memory.
I understand completely that Google offers these APIs completely for free and they can shut them down easily. I'm willing to pay for more but my quadratic needs aren't met with root pricing.
So, to waste sub-linearly I can easily setup OSRM for my needs :D
What system would calculate a shortest path between Sydney and London? There's an incredible amount of sparseness in the matrix.
OSRM builts a hierarchy that allows fast computation of shortest paths for the whole world map. It takes about 4 hours on my server, fills around 40GB of RAM, and then after that I can magically do insane amounts of shortest path queries.
Paper below has an even faster algorithm that has an operation of finding shortest paths equivalent to just several reads in memory (according to experimental results in the paper, it's roughly equal to 5 reads, meaning it's just 5 times slower than that 1E18 table we'd have). It works on a single workstation.
It might not be a pairwise cache but man, this is some advanced stuff and I'm sure Google's engineers wouldn't think of having 1E18 elements matrix.
That's why I'm a bit surprised by the pricing and the limits. I guess network traffic bandwidth costs.
http://research.microsoft.com/apps/pubs/default.aspx?id=1456...
[1]http://people.mpi-inf.mpg.de/~dmatijev/papers/DIMACS06.pdf
The osm datasets actually aren't that big, the entire PBF formatted dataset is <30GB. You can fit that on any system (not in RAM of course but hard disk access is still a million times quicker than using an online service). There are simple scripts to keep the dataset in sync on your server.
Also it's just completely fucking ridiculous to send a request over the internet to perform a calculation.
I encountered the issue myself ages ago where i had a task to reverse geocode for a railways GPS system for every train every minute. Google and other services would have costed millions of dollars every year, used massive amounts of bandwidth and been waaay too slow. I wrote a library - https://github.com/AReallyGoodName/OfflineReverseGeocode in a day that could easily do millions of lookups each minute.
Also not that you cannot really cache routes, nor could you store all (not even Google) or even just distances or ETAs. But that is also not necessary to get fast and relative 'CPU light' responses.
> I get incomparable functionality using OSM.
Have a look at https://graphhopper.com/ with a reasonable pricing model for the whole Directions API and specifically for the Matrix API https://github.com/graphhopper/directions-api/blob/master/FA...
(note: I'm the author of GraphHopper)
OSS is eating the world of geo.