graphhopper | Open source routing engine for OpenStreetMap | Map library
kandi X-RAY | graphhopper Summary
kandi X-RAY | graphhopper Summary
GraphHopper supports several routing algorithms, such as Dijkstra and A* and its bidirectional variants. Furthermore, it allows you to use Contraction Hierarchies (CH) very easily. We call this speed mode; without this CH preparation, we call it flexible mode. The speed mode comes with very fast and lightweight (less RAM) responses and it does not use heuristics. However, only predefined vehicle profiles are possible and this additional CH preparation is time and resource consuming. Then there is the hybrid mode which also requires more time and memory for the preparation, but it is much more flexible regarding changing properties per request or e.g. integrating traffic data. Furthermore, this hybrid mode is slower than the speed mode, but it is an order of magnitude faster than the flexible mode and uses less RAM for one request. If the preparations exist you can switch between all modes at request time.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Returns a GeoJSON representation of a given point
- Finds all of the points in a given list of locations
- Wrap a geometry
- Find a node with a given stop id
- Handle a GET request
- Computes an IsolePolygon based on a set of edges
- Packs a list of rings into holes
- Gets the main component of the polygon with the specified point
- Handle GET requests
- Create EncodedValue from string
- Create a profile based on the profile information
- Read a 64 - bit long
- Extracts the road names of a way
- Imports a public transit index
- Of the edge pointer
- Checks if the edge is different from the last edge
- Get XY coordinates
- Create a route path
- Converts a feed into a trip with stopTimes
- Create a new edge
- Route a GHM request
- Entry point for the graphHopper
- Writes the specified list of entries to the storage
- Runs the graphhopper
- Handles a request to retrieve a geometry
- Implements the visitor to filter out variables
graphhopper Key Features
graphhopper Examples and Code Snippets
Community Discussions
Trending Discussions on graphhopper
QUESTION
I want to display routing machine control div on dashboard (collapse side bar like google maps) instead of map div, because it is covering the map on mobile version. is there any easier way to do that? I have tried this 2 ways : appending control div to another div , appending control div with onAdd(map)
I have 3 components MapComponent, RoutingMachine and Dashboard.
RoutingMachine.jsx
...ANSWER
Answered 2022-Mar-10 at 09:30You can achieve that behavior using two refs. One will be the div to attach the control and the other other one the ref of the routing machine instance.
QUESTION
I want to calculate the shortest route from one to many places with coordinates (latitude, longitude).
The question is now how to apply the Graphhopper library for coordinates with given latitude/longitude.
For example with the coordinates of some given cities (start place is Berlin), Berlin, Hamburg, Bielefeld, Dortmund, Essen, Bonn, Frankfurt, Trier and Paderborn, one route is: Berlin -> Hamburg -> Bielefeld -> Paderborn -> Dortmund -> Essen -> Bonn -> Trier -> Frankfurt
...ANSWER
Answered 2022-Jan-26 at 07:34The following link provides the implementation of the travelling salesman problem: https://www.javatpoint.com/travelling-salesman-problem-in-java
I used the solution to get the route:
QUESTION
Need Help! I am unable to convert a Point from MySQL using JdbcTemplate. However, when using JPA it worked out!
Don't suggest an answer with SELECT ST_AsWKT() + WKTReader()
, I have already tried and it did not work out very well...
Maybe you need to specify the SpatialDialect for JDBC or write a custom converter???
Error:
...ANSWER
Answered 2021-Nov-12 at 15:59Assuming you only want to "extract" the Point geometry,
I think you should check out how Hibernate Spatial does the extraction of JTS Geometry from JDBC ResultSet - your starting point should be org.hibernate.spatial.dialect.oracle.SDOGeometryValueExtractor
(if you also want to "store" the geometry, I don't have any tip right now for you)
The code (adapted from said class) could look something like this:
QUESTION
I am using Leaflet 1.2.0 and Leaflet Routing Machine 3.2.12.
My code is drawing the correct route on the map, yet, when i want to access the summary and the totalDistance from the summary, both are undefined. Why is that?
...ANSWER
Answered 2021-Dec-03 at 15:49this
doesn't have a summary
. You will need to refer to e.routes
, like e.routes[0].summary.totalDistance
.
QUESTION
Final edit- This turned out to be a bug with routing regression in AnyLogic and is getting fixed in the next update.
I'm developing a town simulation with pedestrian agents moving around it. The GIS region data I use is loaded from a .osm file in foot-traffic mode, and I randomly spawn building agents around the region.
They walk around the city fine at first, but around halfway to their destination, they suddenly fly across the town at high speed in a straight line to where they're going. They seem to arrive at the GIS node closest to the building, and then walk the last couple of meters inside. I believe this occurs with every pedestrian I've tried.
I am using Dijkstra bidirectional path-finding (built-in to AnyLogic). I have tried A* bidirectional with the same results, as well as using a different .osm/.pbf file, and trying it on fast and short route mode with no luck.
I have a feeling it is a bug in the bidirectional pathfinding, however AnyLogic doesn't allow non-bidirectional routing, or a way of implementing your own for GIS regions...
Any ideas would be appreciated.
-edit-
I came back to this bug and have determined it is 100% a path-finding bug. When creating a GIS route between 2 points using the AnyLogic online server, it works as expected and we can see a completed route. However, when using a loaded offline OSM or PBF file (I tried different map sources), I observe that the route it draws goes correctly halfway but then draws a straight line to the node closest to the destination, then a straight line to the destination. I have attached 2 pictures to demonstrate this.
Note that it doesn't make it halfway in distance, it is halfway in node count.
We can see the nodes exist based on the pictures below, but the routing ignores the second half of them. I'm sure it's not a disconnected network, as I tested a lot and sometimes it would route over a section of road fine, but other times it would fail at it.
So I suppose now my question is: how do I prevent or get around this? I tried using a custom GraphHopper router to get around the bidirectional routing and just use regular A* search, but didn't have any luck as the other algorithms I tried just made straight lines.
This is what happens when making the first point at the bottom:
This is what happens when making the first point at the top:
This is with online routing:
...ANSWER
Answered 2021-Aug-25 at 17:44as Benjamin already stated, this probably happens because you have multiple networks and routing acts in unpredictable ways sometimes when you have networks that are not defined as you would like.
Search on network on the projects section and be sure there is only 1 network..
For instance in the following image, you see that there are 2 networks... find a way to connect things in order to end up with 1 network...
QUESTION
I'm new in use map GraphHopper, OpenStreetMap, and others library. I want to draw route which generated by GraphHopper Routing Engine (actually in Java language). Is that possible for draw route from GH using OpenLayer?
I have read this GWT-OpenLayer, but I can't find how to write a route in real road like this GraphHopper Routing Example
I hope openlayers API can cover my need
- GH Routing Engine generate route from A (long, lat) to B (long, lat)
- OpenLayers GWT draw every route from GH
Any help will appreciate :)
...ANSWER
Answered 2021-Jun-25 at 10:04The GraphHopper routing API is very similar to many other routing APIs, it can be fetched directly from a JavaScript application such as OpenLayers and the result contains a polyline as used in this example https://openlayers.org/en/main/examples/feature-move-animation.html (but the polyline can contain elevations and has a standard ie5 scale factor). Changing the OpenLayers example to use the route in your GraphHopper example (I copied the API key but for production you should get your own) the result is:
QUESTION
I'm trying to start graphhopper using pm2
... graphhopper
is a java application and the way I initiate it on the terminal is by going to its folder and entering the following command:
ANSWER
Answered 2020-Jul-29 at 01:11As stated in the comments, this issue can be solved by creating a bash script and running it with pm2
instead of running directly the java application... The bash script used was the file graphhopper.sh
as the following:
QUESTION
How can I set the route profile 'foot'? Using the default profile 'car' I can't calculate the distance between any location (in the woods) and a nearby footpath.
The error message I get is:
...ANSWER
Answered 2020-Apr-16 at 05:34The issue was that the Graph (i.e. the graphhopper generated routing files) were not aligned with the config settings in the app.
In the answer below I wanted to have a routing facility for both foot, bike and car. It is of course possible to get only routing for only 1 type of 'vehicle'. I tested this also for the routing profile 'foot'.
To get this alignment, I first edited the config.yml file in a clone of the graphhopper project. In the config file I changed:
QUESTION
Gradle sync failed: Don't know how to build models for org.gradle.tooling.internal.gradle.DefaultGradleBuild@61cdce4
...ANSWER
Answered 2020-Apr-13 at 05:23Your build.gradle (Module:app) should look like this
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install graphhopper
4.x: documentation, web service jar, announcement
unstable master: documentation
To install the GraphHopper Maps UI and the web service locally you need a JVM (>= Java 8) and do:. After a while you see a log message with 'Server - Started', then go to http://localhost:8989/ and you'll see a map of Berlin. You should be able to right click on the map to create a route.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page