-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow routing from arbitrary start and end coordinates #27
Comments
Can you please explain this? I mean, following the example code in mi app I call calcPath (fromLatitude, fromLongitude, toLatitude, toLongitude, mapName); where {from,to}{Latitude,Longitude} are double variables, whose values are not bound to anything. Why does it work? |
Not sure if I understand you ... there is a search functionality going on in Location2IDIndex which returns a node id from a point (lat,lon). But the node id could be relative far away from the original requested point. As we only need crossroads for routing, all other information of the actual path (e.g. for displaying) is stored in wayGeometry. In this ticket we'll have to extend the current algorithm interface to make it possible somehow to return the full path from start to end (both some valid positions on a road or path) not only from cross-road to cross-road. We could try to somehow introduce a virtual node to the graph. To make that thread safe we would need to separate node access from the Graph interface, e.g. instead of graph.getLatitude(int index) we would need something like new NodeAccess(graph).getLatitude(int index) and then return custom latitude values for our virtual node....hmmh. This change will trigger changes in RoutingAlgorithm and Path. |
BTW: this limitation will result in wrong routes if one starts or ends on one-way roads. See http://lists.openstreetmap.org/pipermail/graphhopper/2013-May/000136.html? |
I have developed a improvement for this.
I think I documented my code quite well and it has been synced with the master branch last Friday. Suggestion for a perfect optimal solution : |
Thanks! I'll have a look into it this week! |
Just a shared thought : As said before, start/end node are more or less arbitrary chosen. Instead of computing the 4 possible path (or event partly computing them) and take the best I wonder if that would not be possible to "simply" initializes the 4 edges' nodes weight with a weight computed from the GPS point. Let's take an example for the "from" node: A --------------- P --- B The index returns us the B node as the closest node and routing algorithm will use that node as start giving B the weight 0. That should give the best path, what do you think ? |
Exactly. One 'just' needs to put the first two nodes (with the correct weights) in the queue. But additionally one needs to check for two nodes as finish condition instead of only one. But for that one needs to add a method Last but not least one needs the post processing you already have implemented. |
I'm hope this is the correct issue, but I'll +1 it Unfortunately, this issue is keeping me from using Graphhopper in my application. |
…ng edges, additional tests for that in AbstractRoutingAlgorithmTester; repairs #105
Closing in favor of #115 |
Allow GPS-exact routing (not just from junction to junction) #27
* Fix issues with Continue instruction and fixed some typos * Use GH translation map instead
* Initial commit, moving relevant files from #1422 over to the new repository * Remove debugging output * Update README.md * Rename to graphhopper-navigation-mapbox * Add Tests (#3) * Make MapboxResponseConverter testable * Added Travis.yml * Mavenbuild (#4) * try maven build * packaging pom * Corrected conflict resolution * Add Travis build status image * Minor test improvement * Fix indentation issue * Remove WebHelper, fixes #1 * added a few properties required for deploying to maven central * let's configure executable from settings * Allow multiple waypoints (#5) * First approach at allowing multiple waypoints * Fix resetting time and distance * First improvement to repeat instructions regularly * Add a very far distance instruction to instruct users to continue on the road * Moved the very far message a bit * Reduce initial delay * Improve roundabout banner instructions * Add the very close instruction fall back * Added a simple translation map * Upper case the first letter of turn descriptions in bannerInstructions * Update README.md * Use GH translation map * Move translations to resources * Use Helper.firstBig * Have TranslationMap as singleton * TranslationMap as static variable * Update README.md * Update README.md * Update README.md * Update README.md * move to stable dep of GH core 0.11.0 * set explicit version to maven-compiler-plugin * Add bearings (#17) * Inigial approach of using bearings in the request * Disable CH * log test * Added Tests for MapboxResource#getBearing * Sett pass through to false * Add alternative Routes to Navigation Endpoint (#18) * Allow the addition of multiple routes when using headings * Use alternative routes by default * Add test for alternative routes * Remove alternative route calculation * upgrade GH core dependency * Add then voice and banner instruction (#19) Add comment and minor rename * Change Endpoint name and Maven Package (#20) * Rename maven package, endpoint, and files * Fix tmp issue with openjdk * Remove tmp fix for jdk issue * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * use jdk-12 instead of 10 * Add points * updated GH core version * upgraded to 0.12.0-pre3 * updated GH core to 0.12.0-pre6 * upgrade to 0.13-SNAPSHOT and using GH core 0.12.0 * upgrade GH core to 0.13.0-pre1 * upgrade GH core to 0.13.0-pre2 * Upgrade gh core to 0.13.0-pre3 * Init imperial voice unit support * Move VoiceInstructionConfig to seperate file * Add imperial unit translations * Add voice instruction tests * Set right inital voice instruction key * Remove redundant init from unit * Remove voiceUnit metric check * Set imperial as default if no voiceUnit is set * Refactor voice instruction configuration creation * Upgrade gh core to 0.13.0-pre4 * upgrade GH core to 0.13.0-pre5 * upgrade GH core to 0.13.0-pre6 * upgrade GH core to 0.13.0-pre7 * upgrade GH core to 0.13.0-pre8 * upgrade GH core to 0.13.0-pre12 * Fallback to the original profile (#26) * Load the correct translation map * upgrade GH core to 0.13.0-pre15 * Upgrade GH core to 0.13.0-pre16 * Upgrade GH core to 0.13.0-pre17 * Upgrade GH core to 0.13.0-pre18 * Upgrade GH core to 0.13.0-pre19 * Upgrade GH core to 0.13.0 * Upgrade GH core to 0.14.0-pre1 * Upgrade GH core to 1.0-pre1 * Upgrade GH core to 1.0-pre2 * Upgrade GH core to 1.0-pre3 * Upgrade GH core to 1.0-pre4 * Upgrade GH core to 1.0-pre5 * Update README.md * Fix continue instruction translation (#27) * Fix issues with Continue instruction and fixed some typos * Use GH translation map instead * Upgrade GH core to 1.0-pre7 (#28) * Upgrade GH core to 1.0-pre9 * Update pom.xml * Upgrade GH core to 1.0-pre11 * Upgrade GH core to 1.0-pre12 * Upgrade GH core to 1.0-pre14 * Upgrade GH core to 1.0-pre16 * Upgrade GH core to 1.0-pre17 * Upgrade GH core to 1.0-pre18 * Upgrade GH core to 1.0-pre21 * Upgrade GH core to 1.0-pre22 * Upgrade GH core to 1.0-pre23 * Upgrade GH core to 1.0-pre24 * Upgrade GH core to 1.0-pre25 * Upgrade GH core to 1.0-pre27 * Upgrade GH core to 1.0-pre28 * Upgrade GH core to 1.0-pre29 * Upgrade GH core to 1.0-pre30 * Fix compiler error, tests still fail * fix tests #31 * Upgrade GH core to 1.0-pre31 * update to jdk14 * Upgrade core to 1.0-pre32 * Upgrade core to 1.0-pre33 * Upgrade core to 1.0-pre33.2 * Upgrade core to 1.0-pre33.3 * Upgrade core to 1.0-pre33.4 * Upgrade core to 1.0-pre35 * fix resource * Upgrade core to 1.0-pre37 * Upgrade core to 1.0-pre38 * for now we need the legacy resolver also here * add logging * make profile mapping between mapbox and graphhopper configurable; remove legacy resolver * Update README.md * Update README.md * Update README.md * updated GH core * Set versions to 1.0-SNAPSHOT in pom.xml, keep dependency hashes in separate file * Move gh_dependencies into pom.xml instead * Rename: PathWrapper -> ResponsePath * Use core dependency from jitpack * Remove hash * Upgrade to 1.0-pre42, revert to old build process * Upgrade GH core to 1.0-pre43 * Upgrade GH core to 1.0 * Upgrade version to 2.0-SNAPSHOT * add development profile * Update core version, use GitHub packages, remove sonatype snapshot repository * Add GitHub workflow to publish packages, see core/#n2049 * Add missing distributionManagement * Add access token setup for travis with github packages * travis job: include access also for github packages * Update core version * Include sources for GitHub Packages deployments * Update core to 'remove unused methods encoder.defineNodeBits...' * Update core to 'Set default algo for edge-based CH back to Dijkstra' * Update core to 'Use Envelope in API' * Update core to 'Add comment about module GpxFromInstructions belongs to' * Update core to 'Add creator method for LMApproximator' * move into navigation subfolder * remove duplicate files * removed andorra osm * added apache license header to 2 files * added note in changelog Co-authored-by: Robin <[email protected]> Co-authored-by: easbar <[email protected]> Co-authored-by: Stefan Kienzl <[email protected]>
…er#27) * Add coverage config and publish report on Jenkins * Chenge test to verify in Jenkins
At the moment the routing start and end point can be only on a node. We need to extend the algorithm and the querying to allow arbitrary GPS coordinates on an edge (the road) too.
The text was updated successfully, but these errors were encountered: