Does anyone have any tutorial, link, video etc on how I can use Open Street Map for routes? I know google maps and saw that I can easily do that. But this application will have an internal module and we can not afford the license.
-
project-osrm.org or openrouteservice.org perhaps?– EricaJul 15, 2014 at 13:42
-
www.switch2osm.org ?– til_bJul 15, 2014 at 13:57
-
1wiki.openstreetmap.org/wiki/Routing/online_routers and wiki.openstreetmap.org/wiki/Routing/offline_routers and wiki.openstreetmap.org/wiki/Routing and wiki.openstreetmap.org/wiki/List_of_OSM_based_Services#Routing– scaiJul 15, 2014 at 15:14
-
You want to create (single) routes, or add a routing service to your own site?– MapperJul 15, 2014 at 16:11
-
I want to add a routing service to my intranet. This service is to calculate the shortest route between origin and destination requested based on the mileage and calculate a value. How is an internal application can not use the google maps api.– csfJul 16, 2014 at 18:34
4 Answers
GraphHopper (using OpenStreetMap Data)
GraphHopper offers memory efficient algorithms in Java for routing on graphs. E.g. Dijkstra and A* but also optimized road routing algorithms like Contraction Hierarchies. It stands under the Apache License and is build on a large test suite.
OpenStreetMap is directly supported from GraphHopper. Without the amazing data from OpenStreetMap GraphHopper wouldn't be possible at all. Other map data will need a custom import procedure.
The other answers on this page provide some great specific details - but I think a more general answer to the question is in order (not least for future viewers with similar problems):
There are many many methods to work with routing based on Openstreetmap data. A key information page on this is the OSM wiki page on routing It's important to understand that the services available on any one Openstreetmap based website, or from any one tool, will be limited - an in particular that the website openstreetmap.org isn't designed to be a one-stop-shop - that the value in the Openstreetmap project comes from the huge range of services, maps and apps based on the OSM data.
If you go looking you'll find a large number of tutorials and websites offering information about how to work with the many different possible individual solutions to your question. Simply 'how to do routing based on Openstreetmap' is a very big subject.
pgRouting is another routing option using OpenStreetMap data. pgRouting.org
pgRouting extends the PostGIS / PostgreSQL geospatial database to provide geospatial routing functionality.
Core Features pgRouting provides functions for:
- All Pairs Shortest Path, Johnson’s Algorithm
- All Pairs Shortest Path, Floyd-Warshall Algorithm
- Shortest Path A*
- Bi-directional Dijkstra Shortest Path
- Bi-directional A* Shortest Path
- Shortest Path Dijkstra
- Driving Distance
- K-Shortest Path, Multiple Alternative Paths
- K-Dijkstra, One to Many Shortest Path
- Traveling Sales Person
- Turn Restriction Shortest Path (TRSP)
- Shortest Path Shooting Star
Here's a link to their workshop / tutorial : workshop.pgrouting.org
-
In this case I'll have to upload a shape of streets into PostGIS? If in case there is a new road, for example, will have to refzer uploading. There is a ready api like google maps? Openlayers makes routes?– csfJul 16, 2014 at 18:48
-
Yes, you need to download OSM data, then import it into PostGIS. I have used osm2pgrouting which automatically converts to pgRouting compatible. For new roads, you can download the weekly changeset from planet.openstreetmap.org and import that with osm2pgrouting I believe, though I have not tried that yet.– widesGISJul 17, 2014 at 22:13
We provide a free OSM converter, which you can use to import OSM data into our routing solutions. Could be either RW NetServer 3 (standalone server application) or RW Net 4 (.NET component). Both can be seen on www.routeware.dk and provides standard features such as routing, driving directions, travelling salesman optimization etc.