Free Method of calculating travel time with directions in Lazarus? lazarus / 21-General ---------------------------------------------------------------------- MrMaxMusterman · 2021-05-21 19:30 So im searching for an online service (API?) that can calculate my travel time from point a to b (by car over streets, not directly A to B over the air). It doesnt need to have live traffic included etc. but it should be free to use. If theres anyone out there that knows a service like this (that is free) and could mabye help me to implement it into my program, feel free to leave a comment down below. Thanks! ---------------------------------------------------------------------- lucamar · 2021-05-21 19:44 Google Maps or, in general, any of the "maps" web out there (like OpenStreetMap) should do it nicely ... unless you want to know how much time you'll spend on the road from Alaska to Argentina ---------------------------------------------------------------------- MrMaxMusterman · 2021-05-21 19:48 Thanks for the answer. I already took a look at google maps and they do acutally offer something called "Distance Matrix API". The only problem with it is that the API key costs money. ---------------------------------------------------------------------- MarkMLl · 2021-05-21 20:11 Quote from: MrMaxMusterman on May 21, 2021, 09:30:30 pmSo im searching for an online service (API?) that can calculate my travel time from point a to b (by car over streets, not directly A to B over the air). It doesnt need to have live traffic included etc. but it should be free to use. If theres anyone out there that knows a service like this (that is free) and could mabye help me to implement it into my program, feel free to leave a comment down below. I believe you mean "I'd appreciate any comments". As Lucamar says, you're unlikely to get anything free since somebody has to do a substantial amount of work determining how fast roads are in practice. You might get /distance/ so look at something like https://gis.stackexchange.com/questions/73766/how-to-create-an-od- road-distance-matrix-in-qgis but this would probably still involve substantial work... and you'd be unlikely to interface to it in Pascal. Alternatively you might still be able to find a copy of pre-MS Autoroute somewhere for a one-off cost, I think that the full version of that had an API. But it would almost certainly lack much recent data. MarkMLl ---------------------------------------------------------------------- MarkMLl · 2021-05-21 20:48 Quote from: MrMaxMusterman on May 21, 2021, 09:48:00 pmThanks for the answer. I already took a look at google maps and they do acutally offer something called "Distance Matrix API". The only problem with it is that the API key costs money. What's an API? https://xkcd.com/1481/ applies. In this particular context, do you mean "getting the technical info costs money?" or "I need to buy account on their mainframe (for want of a better word) before I can do anything clever". Elsewhere, somebody's suggested using Google Earth for this. However I don't recall Earth being aware of roads or similar entities which can constrain a route such that it's not a mere "as the crow flies" guess. I'd add though that there's a great deal of useful stuff buried inside Earth: it was actually a fairly competent piece of GIS software before Google bought it up and bent it to their unholy will. And looked at from the other side, QGIS (as one specific example) can get overlays from Google and others... but again I don't know whether that has the concept of following roads. MarkMLl ---------------------------------------------------------------------- avra · 2021-05-22 07:44 You could download Open Street Maps data, host server your self locally (or use some of the public ones on the net), use TMapViewer for displaying maps, and use some of the tools/libs on the provided wiki page for routing, directions, and travel time calculations. If you don't find command line tool or REST API that suits you, then you will probably have to make headers for some of the C libs. https://wiki.openstreetmap.org/wiki/Routing https://wiki.openstreetmap.org/wiki/Simple_route_API This could be your best bet: https://wiki.openstreetmap.org/wiki/OpenRouteService https://openrouteservice.org https://github.com/ObuhovToplyvoApp/osm.routes This might also be interesting: https://github.com/search?q=osm+routing Google directions API: https://code.google.com/archive/p/delphimaps/