Code Monkey home page Code Monkey logo

openrouteservice's Introduction

Openrouteservice

Docker Nightly Build Status Docker Version Status Quality Gate Status Vulnerabilities Security Rating Maintainability Rating Release LICENSE

Openrouteservice is a highly customizable, performant routing service written in Java. It uses a forked and edited version of graphhopper 4.0 and provides global spatial services by consuming user-generated and collaboratively collected free geographic data directly from OpenStreetMap:

¹) Snapping, Export, Health and Status Endpoint are not available in our public openrouteservice API aka "live API"! You can use them by running your own instance of openrouteservice.

And to avoid any misunderstandings, it should also be mentioned at this point that our live API provides several other endpoints that are not part of the openrouteservice software/repository:

  • openpoiservice: A stand-alone service from HeiGIT that returns points of interest in the area surrounding a geometry
  • openelevationservice: A stand-alone service from HeiGIT that returns the elevation for point or line geometries
  • Pelias: A (reverse) geocoder hosted by HeiGIT that resolves geographic coordinates to addresses and vice versa
  • VROOM: The Vehicle Routing Open-source Optimization Machine hosted by HeiGIT

To play around with openrouteservice you may use our demonstration server which comes with both the backend and a frontend. Or simply sign up for an API key and fire your requests against the API directly. You can also do this in our API Playground - take a look at the API Reference to get more information.

map-client-isochrones

Installation

You can easily run openrouteservice yourself!

tl;dr: We suggest using docker to install and launch openrouteservice. In short, a machine with a working docker installation will get everything done for you.

Change to the directory where you want to install your local openrouteservice and first create some directories, where openrouteservice will persist its data:

mkdir -p ors-docker/config ors-docker/elevation_cache ors-docker/graphs ors-docker/files ors-docker/logs

Only use nightly (main branch) if you know what you do. We recommend running docker compose with the latest release version. Get the docker compose file for a release, e.g. v8.0.0:

wget https://github.com/GIScience/openrouteservice/releases/download/v8.0.0/docker-compose.yml

Start openrouteservice in the background:

docker compose up -d

This will pull the openrouteservice docker image of the selected version and start it up using an example setup and the provided test OSM file for Heidelberg/Germany and surrounding area.

To see the container's logs, run:

docker compose logs 

Stop the container with:

docker compose down

Usage

The above mentioned endpoints will be available on port 8080:

  • http://localhost:8080/ors/v2/directions
  • http://localhost:8080/ors/v2/isochrones
  • http://localhost:8080/ors/v2/matrix
  • http://localhost:8080/ors/v2/snap
  • http://localhost:8080/ors/v2/export
  • http://localhost:8080/ors/v2/health
  • http://localhost:8080/ors/v2/status

You can find more information in the endpoint documentation pages linked above.

On the API Reference there is also a description how you can use the Swagger-UI and the API Playground for local instances of openrouteservice.

Changelog/latest changes

Openrouteservice CHANGELOG

Contribute

We appreciate any kind of contribution - bug reports, new feature suggestion or improving our translations are greatly appreciated. Feel free to create an issue and label it accordingly. If your issue regards the openrouteservice web-app please use the corresponding repository.

If you want to contribute your improvements, please follow the steps outlined in our CONTRIBUTION guidelines

The sourcespy dashboard provides a high level overview of the repository including technology summary, module dependencies and other components of the system.

Questions

For questions please use our community forum.

Translations

If you notice anything wrong with translations, or you want to add a new language to the ORS instructions, we have some instructions in our backend documentation about how you can submit an update. You can also look over at our maps client GitHub if you want to contribute the language to there as well (adding or editing the language in the openrouteservice GitHub repo only affects the instructions - any new language also needs adding to the client).

openrouteservice's People

Contributors

aoles avatar cbayerlein avatar dependabot[bot] avatar ecxod avatar gegeweb avatar hendrikleuschner avatar higa4 avatar jhaeu avatar jimbo8098 avatar jlink avatar joker234 avatar koebi avatar marq24 avatar matkoniecz avatar michaelsjp avatar nilsnolde avatar rabidllama avatar redfrexx avatar robot8a avatar rtroilo avatar rungee avatar samcrawford avatar sfendrich avatar snyk-bot avatar star-pirate avatar takb avatar thegreatrefrigerator avatar timmccauley avatar tumluliu avatar wzy19840102 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openrouteservice's Issues

Detour_factor not working

Accurate of isochrone service.

Hi ORS team,

I have a question about the results of isochrone service. I created an isochrone of 300meters by this api:
http://35.197.231.53:8080/ors/isochrones?format=json&locations=6.7750371,51.2122639&interval=300&profile=driving-car&range=300&range_type=distance

Then I calculate the distance between the center and the points in polygon:

http://35.197.231.53:8080/ors/routes?coordinates=6.7750371,51.2122639|6.772056,51.210703&profile=driving-car
http://35.197.231.53:8080/ors/routes?coordinates=6.7750371,51.2122639|6.773549,51.20887&profile=driving-car
http://35.197.231.53:8080/ors/routes?coordinates=6.7750371,51.2122639|6.774529,51.208534&profile=driving-car
http://35.197.231.53:8080/ors/routes?coordinates=6.7750371,51.2122639|6.775116,51.208332&profile=driving-car
http://35.197.231.53:8080/ors/routes?coordinates=6.7750371,51.2122639|6.776894,51.20898&profile=driving-car
http://35.197.231.53:8080/ors/routes?coordinates=6.7750371,51.2122639|6.77966,51.210609&profile=driving-car
http://35.197.231.53:8080/ors/routes?coordinates=6.7750371,51.2122639|6.780431,51.211671&profile=driving-car
http://35.197.231.53:8080/ors/routes?coordinates=6.7750371,51.2122639|6.780444,51.212103&profile=driving-car
http://35.197.231.53:8080/ors/routes?coordinates=6.7750371,51.2122639|6.779679,51.214209&profile=driving-car
http://35.197.231.53:8080/ors/routes?coordinates=6.7750371,51.2122639|6.777318,51.215769&profile=driving-car
http://35.197.231.53:8080/ors/routes?coordinates=6.7750371,51.2122639|6.776942,51.215769&profile=driving-car
http://35.197.231.53:8080/ors/routes?coordinates=6.7750371,51.2122639|6.776746,51.215768&profile=driving-car
http://35.197.231.53:8080/ors/routes?coordinates=6.7750371,51.2122639|6.776206,51.215768&profile=driving-car
http://35.197.231.53:8080/ors/routes?coordinates=6.7750371,51.2122639|6.774259,51.21577&profile=driving-car
http://35.197.231.53:8080/ors/routes?coordinates=6.7750371,51.2122639|6.773846,51.215769&profile=driving-car
http://35.197.231.53:8080/ors/routes?coordinates=6.7750371,51.2122639|6.77384,51.215769&profile=driving-car
http://35.197.231.53:8080/ors/routes?coordinates=6.7750371,51.2122639|6.773427,51.21577&profile=driving-car
http://35.197.231.53:8080/ors/routes?coordinates=6.7750371,51.2122639|6.772079,51.21088&profile=driving-car
http://35.197.231.53:8080/ors/routes?coordinates=6.7750371,51.2122639|6.772056,51.210703&profile=driving-car

The distance results are:
[393, 477.4, 425.6, 634.4, 1239.2, 493.1, 673, 721, 834.5, 1049.7, 831.8, 831.5, 864, 1002.1, 1030.6, 1030.9, 1181, 399.8, 393]

Why does this happen?

Thank you

No answer from certain queries for isochrones

When I query for isochrones at lat lon 40.87668, -97.09879 context here:

http://www.openstreetmap.org/search?query=40.87668%2C-97.09879#map=17/40.87668/-97.09879

which is in the middle of a building, not very far from the nearest road, I get no answer from the web and the API version.

Is this a known issue?

When I moved the lat lon to the nearest road it works fine.

I can wrap my queries in a shim that finds the nearest road segment via OSM and retries but it seems that would be better handled for reasonable cases server side.

Other queries that give the same null answer:

37.04076, -76.37905
44.82852, -93.16191
42.01283, -87.71914

Extend routing response with bearing for roundabout exits

image

For the image above, the expected list of bearings will be [248,141,62].

The step element in routing instructions will have the following format:

{
    "distance": 203.6,
    "duration": 23.6,
    "type": 7,
    "instruction": "Enter the roundabout and take the 2nd exit onto <b>Stralsunder Ring</b>",
    "name": "Stralsunder Ring",
    "exit_number": 2,
    "exit_bearings": [248, 141, 62],
    "way_points": [3, 21]
}

Routing through permitted streets

Car and bike profile routes through vehicle=destination

Message:Es wird immer noch durch vehicle=destination geroutet, egal ob für Autos oder Fahrradfahrer. Durch solche Straßen darf man nicht durchfahren! OpenRouteService ist damit unbrauchbar! Der Bug muss endlich behoben werden!

bike profile routes through vehicle=no

Message:OpenRouteService routet Fahrradrouten durch vehicle=no . Dort dürfen keine Fahrräder fahren! Der Bug muss sofort behoben werden, OpenRouteService ist damit unbrauchbar!

ORS ignores access=customers with streets

Message:Die Software ignoriert access=customers bei Straßen. Dieser Fehler muss sofort behoben werden! Der Routenplaner ist unbrauchbar!

Adjust height Data for Tunnels

Currently the Height data in tunnels is taken from the surface above.

This might be solved by using the tunnel entry and exit as border values and assign mean height values for points in between depending on the distance.

tunnel

Live Navigation using Continue Forward

When using the Directions from ORS for live turn by turn directions, it is paramount to be able to allow the use of the user's current heading when coming up with directions. This prevents the user from needing to turn around because they went off the path which is a very jarring experience.

Preferably an input parameter would allow us to both specify the heading and the degrees of flexibility from this bearing we will accept in the new directions.

detourfactor consistency

currently the request parameter used is attributes=detourfactor,
while the response returns detour_factor: xx
we should make this consistent and also return detourfactor

Instructions for running with own OSM dataset

I followed the instructions for building with docker & own osm dataset at README.md and docker/README.md,

running docker logs ors-core results in this output :

22-Dec-2017 14:04:31.084 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.5.24
22-Dec-2017 14:04:31.087 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Nov 27 2017 13:05:30 UTC
22-Dec-2017 14:04:31.087 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.5.24.0
22-Dec-2017 14:04:31.087 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
22-Dec-2017 14:04:31.087 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            4.10.0-40-generic
22-Dec-2017 14:04:31.087 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
22-Dec-2017 14:04:31.087 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/lib/jvm/java-8-openjdk-amd64/jre
22-Dec-2017 14:04:31.087 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_151-8u151-b12-1~deb9u1-b12
22-Dec-2017 14:04:31.087 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
22-Dec-2017 14:04:31.087 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /usr/local/tomcat
22-Dec-2017 14:04:31.087 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /usr/local/tomcat
22-Dec-2017 14:04:31.088 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties
22-Dec-2017 14:04:31.088 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
22-Dec-2017 14:04:31.088 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.awt.headless=true
22-Dec-2017 14:04:31.088 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:TargetSurvivorRatio=75
22-Dec-2017 14:04:31.088 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:SurvivorRatio=64
22-Dec-2017 14:04:31.088 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:MaxTenuringThreshold=3
22-Dec-2017 14:04:31.088 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:+UseConcMarkSweepGC
22-Dec-2017 14:04:31.088 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:+UseParNewGC
22-Dec-2017 14:04:31.089 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:ParallelGCThreads=4
22-Dec-2017 14:04:31.089 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms1g
22-Dec-2017 14:04:31.089 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx2g
22-Dec-2017 14:04:31.089 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
22-Dec-2017 14:04:31.089 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
22-Dec-2017 14:04:31.090 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
22-Dec-2017 14:04:31.090 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/tomcat
22-Dec-2017 14:04:31.090 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/tomcat
22-Dec-2017 14:04:31.090 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat/temp
22-Dec-2017 14:04:31.090 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.16] using APR version [1.5.2].
22-Dec-2017 14:04:31.090 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
22-Dec-2017 14:04:31.090 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
22-Dec-2017 14:04:31.094 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.0f  25 May 2017]
22-Dec-2017 14:04:31.178 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
22-Dec-2017 14:04:31.189 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
22-Dec-2017 14:04:31.194 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
22-Dec-2017 14:04:31.195 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
22-Dec-2017 14:04:31.196 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 459 ms
22-Dec-2017 14:04:31.211 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
22-Dec-2017 14:04:31.212 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.24
22-Dec-2017 14:04:31.219 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
22-Dec-2017 14:04:31.245 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
22-Dec-2017 14:04:31.266 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 70 ms
22-Dec-2017 14:04:41.236 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/usr/local/tomcat/webapps/ors.war]
22-Dec-2017 14:04:42.568 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
22 Dec 14:04:42 INFO [routing.RoutingProfileManager] -  Total - 1019 MB, Free - 770.22 MB, Max: 2.00 GB, Used - 248.78 MB
22 Dec 14:04:42 INFO [routing.RoutingProfileManager] -       
22 Dec 14:04:42 INFO [routing.RoutingProfileManager] - ====> Initializing profiles from 'data/heidelberg.osm.gz' (2 threads) ...
22 Dec 14:04:42 INFO [routing.RoutingProfileManager] -                               
22-Dec-2017 14:04:42.746 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/usr/local/tomcat/webapps/ors.war] has finished in [1,509] ms
22 Dec 14:04:42 INFO [routing.RoutingProfileManager] -                
22 Dec 14:04:42 INFO [routing.RoutingProfileManager] - [1] Profiles: 'cycling-regular, cycling-mountain, cycling-road', location: 'data/graphs/bike'.
22 Dec 14:04:42 INFO [routing.RoutingProfileManager] - [2] Profiles: 'driving-car,driving-hgv', location: 'data/graphs/vehicles'.
22 Dec 14:04:42 ERROR [routing.RoutingProfileManager] - java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Your specified OSM file does not exist:/usr/local/tomcat/data/heidelberg.osm.gz
22 Dec 14:04:42 INFO [routing.RoutingProfileManager] - [3] Profiles: 'foot-walking,foot-hiking', location: 'data/graphs/pedestrian'.
22 Dec 14:04:42 INFO [routing.RoutingProfileManager] - [4] Profiles: 'cycling-safe,cycling-tour, cycling-electric', location: 'data/graphs/bike2'.
java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Your specified OSM file does not exist:/usr/local/tomcat/data/heidelberg.osm.gz
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.util.concurrent.FutureTask.get(FutureTask.java:192)
        at heigit.ors.routing.RoutingProfileManager.initialize(RoutingProfileManager.java:237)
        at heigit.ors.routing.RoutingProfileManager.getInstance(RoutingProfileManager.java:83)
        at heigit.ors.servlet.listeners.ORSInitContextListener.lambda$contextInitialized$0(ORSInitContextListener.java:43)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Your specified OSM file does not exist:/usr/local/tomcat/data/heidelberg.osm.gz
        at com.graphhopper.reader.osm.OSMReader.readGraph(OSMReader.java:151)
        at com.graphhopper.GraphHopper.importData(GraphHopper.java:704)
        at com.graphhopper.GraphHopper.process(GraphHopper.java:673)
        at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:648)
        at heigit.ors.routing.graphhopper.extensions.ORSGraphHopper.importOrLoad(ORSGraphHopper.java:91)
        at heigit.ors.routing.RoutingProfile.initGraphHopper(RoutingProfile.java:194)
        at heigit.ors.routing.RoutingProfile.<init>(RoutingProfile.java:137)
        at heigit.ors.routing.RoutingProfileLoader.call(RoutingProfileLoader.java:44)
        at heigit.ors.routing.RoutingProfileLoader.call(RoutingProfileLoader.java:28)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

He's still looking, for some reason I couldn't determine, for heidelberg.osm.gz, so the instructions must be missing some part to be complete.

Add minimum range parameter to isochrone API

I got asked a few times to please implement a minimum range parameter for isochrones, because of the backend interval limit of 10.

E.g. when you want to create isochrones with an interval of 1 min and a maximum range of 40 mins, one would have to perform a minimum of 30 requests. A minimum range parameter would partly solve this issue and bring it down to 4 requests, as e.g.
max range = 40
min range = 30
intervals = 1

Cheers
Nils

Allow the returning of fully GeoJSON compatable route object

Currently when requesting a route, you can tell the service to return the route geometry in GeoJSON format, but the response itself is not GeoJSON. It would be beneficial to be able to return the whole response as a GeoJSON object so that it can be directly used in other tools/services such as QGIS.

Possible bug isodistance - range in meters returning out of range

range=300 returns out of range, saying range=15 (different from the input). units=m, range_type=distance.

Bad request or a bug?

https://api.openrouteservice.org/isochrones?api_key=my_key&locations=-48.263390%2C-18.882508&profile=foot-walking&range_type=distance&range=300&interval=20&units=m&location_type=start&attributes=area&options=&intersections=&id=

{"error":{"code":304,"message":"Parameter 'range=15' is out of range. Maximum possible value is 10."},"info":{"engine":{"version":"4.4.0","build_date":"2017-11-19T14:55:19Z"},"timestamp":1512215972786}}

Difference in duration between ORS and Graphhopper/OSRM/..

Hi ORS team,

I've set up a local ORS using Germany pbf file, with all services (including Geocode by Nominatim) running. I did some comparison between the local service and your online ORS service, and the results are not the same.

Here are the test points:

localhost:8080/ors/routes?coordinates=13.392786,52.524078|13.411185,52.521321&elevation=true&extra_info=steepness|waytype|surface&geometry=true&geometry_format=geojson&instructions=true&preference=fastest&profile=driving-car&units=m

https://www.openrouteservice.org/directions?n1=52.522456&n2=13.401335&n3=16&a=52.524078,13.392786,52.521321,13.411185&b=0&c=0&k1=en-US&k2=km

This is the result of local ORS:
{"routes":[{"elevation":true,"summary":{"distance":1822.1,"duration":210,"ascent":18,"descent":14.3},"geometry_format":"geojson","geometry":{"type":"LineString","coordinates":[[13.392433,52.524147,38],[13.392549,52.524365,39.5],[13.392788,52.524806,40.4],[13.392821,52.524865,40.5],[13.392884,52.524984,40.6],[13.393062,52.524938,40.6],[13.393123,52.524923,40.6],[13.393509,52.52483,40.6],[13.394047,52.524695,40.5],[13.394634,52.524549,40.6],[13.394876,52.524491,40.7],[13.395219,52.524407,40.8],[13.395416,52.524355,40.8],[13.395591,52.524308,40.9],[13.396704,52.524011,40.5],[13.397627,52.52377,39.8],[13.397887,52.52366,39.5],[13.398205,52.523563,39.1],[13.398472,52.52346,38.7],[13.398642,52.523382,38.5],[13.398734,52.523336,38.4],[13.39879,52.523306,38.2],[13.398864,52.523264,38.1],[13.399023,52.523211,37.9],[13.399912,52.522878,37.9],[13.400042,52.522809,38.1],[13.400105,52.522745,38.2],[13.400166,52.522681,38.4],[13.400189,52.522622,38.5],[13.400268,52.522465,38.6],[13.400331,52.522358,38.7],[13.400344,52.522261,38.8],[13.400415,52.522127,38.9],[13.400437,52.52209,39],[13.400572,52.521936,39.1],[13.400595,52.521833,39.3],[13.400581,52.521645,39.1],[13.400651,52.521365,38.6],[13.400776,52.521068,37.9],[13.400865,52.520922,37.9],[13.40096,52.520787,37.5],[13.401004,52.520775,37.1],[13.401046,52.520781,36.7],[13.402863,52.521371,36.2],[13.403637,52.520792,39.4],[13.403686,52.520756,39.9],[13.404451,52.520176,42.9],[13.404628,52.520044,43.2],[13.404811,52.519918,43.6],[13.404987,52.520013,43.8],[13.405218,52.52014,44.6],[13.405246,52.520154,45],[13.405629,52.520343,46.2],[13.40612,52.520594,47.8],[13.408318,52.521707,45],[13.408721,52.521911,43.1],[13.409061,52.522084,41.6],[13.409315,52.522213,40.9],[13.409421,52.522267,40.6],[13.409511,52.52231,40.3],[13.40981,52.522451,39.9],[13.409941,52.522514,39.7],[13.409996,52.522539,39.7],[13.410091,52.522595,39.8],[13.410248,52.522508,39.9],[13.410755,52.522213,40.6],[13.411355,52.521842,41.7]]},"segments":[{"distance":1822.1,"duration":210,"ascent":18,"descent":14.3,"steps":[{"distance":98,"duration":7.8,"type":11,"instruction":"Head north on Tucholskystraße","name":"Tucholskystraße","way_points":[0,4]},{"distance":348.6,"duration":50.2,"type":1,"instruction":"Turn right onto Oranienburger Straße","name":"Oranienburger Straße","way_points":[4,15]},{"distance":212.7,"duration":30.6,"type":5,"instruction":"Turn slight right onto Monbijouplatz","name":"Monbijouplatz","way_points":[15,27]},{"distance":37.7,"duration":5.4,"type":5,"instruction":"Turn slight right onto Kleine Präsidentenstraße","name":"Kleine Präsidentenstraße","way_points":[27,30]},{"distance":184.1,"duration":26.5,"type":5,"instruction":"Turn slight right onto Burgstraße","name":"Burgstraße","way_points":[30,40]},{"distance":145.7,"duration":21,"type":4,"instruction":"Turn slight left onto Anna-Louisa-Karsch-Straße","name":"Anna-Louisa-Karsch-Straße","way_points":[40,43]},{"distance":208.7,"duration":16.7,"type":1,"instruction":"Turn right onto Spandauer Straße","name":"Spandauer Straße","way_points":[43,48]},{"distance":466.7,"duration":37.3,"type":0,"instruction":"Turn left onto Karl-Liebknecht-Straße, B 2, B 5","name":"Karl-Liebknecht-Straße, B 2, B 5","way_points":[48,63]},{"distance":119.9,"duration":14.4,"type":1,"instruction":"Turn right onto Dircksenstraße","name":"Dircksenstraße","way_points":[63,66]},{"distance":0,"duration":0,"type":10,"instruction":"Arrive at Dircksenstraße, on the right","name":"","way_points":[66,66]}]}],"way_points":[0,66],"extras":{"surface":{"values":[[0,66,3]],"summary":[{"value":3,"distance":1822.1,"amount":100}]},"waytypes":{"values":[[0,15,2],[15,43,3],[43,48,2],[48,63,1],[63,66,3]],"summary":[{"value":3,"distance":700.1,"amount":38.42},{"value":2,"distance":655.3,"amount":35.96},{"value":1,"distance":466.7,"amount":25.62}]},"steepness":{"values":[[0,66,0]],"summary":[{"value":0,"distance":1822.1,"amount":100}]}},"bbox":[13.392433,52.519918,13.411355,52.524984]}],"bbox":[13.392433,52.519918,13.411355,52.524984],"info":{"attribution":"openrouteservice.org, OpenStreetMap contributors, tmc - BASt","engine":{"version":"4.4.0","build_date":"2017-11-19T21:30:48Z"},"service":"routing","timestamp":1511254898877,"query":{"profile":"driving-car","preference":"fastest","coordinates":[[13.392786,52.524078,0],[13.411185,52.521321,0]],"language":"en","units":"m","geometry":true,"geometry_format":"geojson","geometry_simplify":false,"instructions_format":"text","instructions":true,"elevation":true}}}

The distance is 1.8km, while online ORS (and google maps) returns 1.7km.

Are there any config/settings to be set before deploying ORS?

Thank you

Elevation = true parameter causes wrong route result

I recognized, that the elevation = true parameter kills the routing result.
Sometimes tha last coord of the decoded polyline is [<good_value>, NaN].

My post config:

api_key: xxx
profile:driving-car
preference:fastest
language:hu
elevation:true
coordinates:20.1811515,46.2697751|20.14525,46.2738
options:{"avoid_features":"highways|tollways"}

Add rest stops

A new feature that could be added would be to allow the user to define a duration/distance of travelling before the require a break in travel. For example, in many countries HGV drivers are only allowed to drive for s certain time before by law they have to take a break.

To accomplish this, the service would need to generate a route between the start and end locations and the find features with either highway=services or highway=rest_area tags near the points on the route that occur at the specified timing (i.e. after 4 hours driving). The original route should then be modified to add that location as a via point, and then repeat the process for each further duration.

If someone says they need a break after 2 hours:

  1. Generate route from a to b
  2. Find a services/rest_area location near the point on the route that would be reached after two hours (it may need to be that it is time-10 minutes to ensure that the deviation made doesn't go over the limit)
  3. Add the location as a via point to the route and regenerate.
  4. Repeat steps 2 and 3 for each additional 2 hours, each time using the newest generated route and adding the location as a via to the route.

Potential matrix issues

I'm relatively certain that they are some bugs but I'm not 100% sure as I have integrated the code differently using an unmodified GraphHopper.

You can try to reproduce them if you run a few (5000) matrix request with 2 or 5 points over berlin area via comparing with single 1 to 1 requests.

RPHASTAlgorithm.calcPaths

 for (int i = 0; i < sourceIds.length; i++) {
  int sourceNode = sourceIds[i];
  if (sourceNode == -1)
     continue;

  // BUG FIX 1
  MultiTreeSPEntry existing = _bestWeightMapFrom.get(sourceNode);
  if (existing != null) {
     existing.getItem(i).weight = 0.0001;
     continue;
  }

  ...
}

and

// BUG FIX 2: if query node is directly part of the subgraph (no virtual node) it could be higher than a leaf from the highest node and not reachable in runDownwardSearch
// TODO write test where query node is 6763 and shortest is over 6763->35469->47681 but only 6763-5422-47681 is returned without the fix as 6763 is not reached from 5422
//         .-> 5422 ------
// 6763 <-/               \
//    \------> 35469 <-\   \
//                      -- 47681
for (int i = 0; i < sourceIds.length; i++) {
     int sourceNode = sourceIds[i];
     MultiTreeSPEntry mspTree = _bestWeightMapFrom.get(sourceNode);
     mspTree.getItem(i).update = true;
      _prioQueue.add(mspTree);
}

 _outEdgeExplorer = _targetGraph.createExplorer();
runDownwardSearch();

And finally a more tricky one in RPHASTAlgorithm.fillEdgesDownward where update=false is hindering a necessary update of a better path - I've just commented out the continue, which only slightly decreases query speed. Currently unsure why the upward search "continue" does not lead to problems.

// BUG FIX 3: this optimization leads to suboptimal routes in rare cases of bigger matrices (berlin, measurement.count=30 measurement.points_per_query=5)
// if (_msptItem.update == false) {
//    continue;
// }

I highly recommend to build some minor unit tests and creating or extend a measurement suite like we have in core GH to run real requests over a bigger area and do performance judgements.

Unable to find appropriate routing profile

I'm playing with the examples in the documentation, but I can't get the one for matrix to work: the URL https://api.openrouteservice.org/matrix?profile=foot-walking&locations=9.970093%2C48.477473|9.207916%2C49.153868|37.573242%2C55.801281&metrics=distance&resolve_locations=false&units=m&optimized=true&api_key=XXX (generated by the docs) yields

{
  "error": {
    "code": 699,
    "message": "Unable to find an appropriate routing profile."
  },
  "info": {
    "engine": {
      "version": "4.3.0",
      "build_date": "2017-10-05T19:36:11Z"
    },
    "timestamp": 1507484237075
  }
}

The return code is 500, so that's either a documentation or a code issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.