Cannot find point with negatives cords

Hi,
i’m trying to get a basic route between two points in python, like this:

openrouteservice points

But in python and API playground page i always get this error message:
“Cannot find point 0: -56.138763,-34.75064; Cannot find point 1: -56.171722,-34.831841”

These points are from Montevideo, Uruguay. I don’t know what is wrong :frowning:

I use the example code:

import openrouteservice
from openrouteservice import convert
coords = ((-34.75064, -56.138763),(-34.831841, -56.171722))
client = openrouteservice.Client(key=‘myapi_key’)
geometry = client.directions(coords)[‘routes’][0][‘geometry’]
decoded = convert.decode_polyline(geometry)
print (decoded)

ORS (like any other sensible app;)) uses [lon, lat], not [lat, lon] for coordinates. Reverse the coords and it should work.

This is the correct answer.

When you click in the map it actually lets you copy both formats. However, if you want to search by coordinates, it’s true, it requires [lat, lon], but should be fixed in the next version.

You are correct, my bad. I just saw that and edited my post.

Hi,
I downloaded openrouteservice from GIT and the .osm file that represents the whole Italian territory (about 30GB) locally. Using the URL http: // localhost: 8080 / openrouteservice / v2 / directions / driving-car? Start = 14.2487826,40.8359336 & end = 14.7594542,40.6803601 which represents the Salerno-Naples route, returns me "Could not find point 0: 14.2487826 40.8359336 within a radius of 1000,0 meters. " Same problem also by inverting the coordinates.
How can I intervene?

Thank you

Hi @ocean,

Please make sure you follow the wiki when setting up ors.
It could be that you didn’t specify to use the new osm file.

If the following request works, it has build on the included heidelberg dataset
http://localhost:8080/v2/directions/driving-car?start=8.681495,49.41461&end=8.687872,49.420318

Best regards

Hi amandus,

Thanks for the reply. I took a look at the given instructions and was able to point him to a correct path to the .osm file downloaded for testing. Now it gives me a problem with the profile that I don’t quite understand:
“Unable to get an appropriate route profile for RoutePreference = driving-car”
In the “app.config” file for the “routing” I have this situation for the profiles:
“profiles”: {
“active”: [
“car”,
“hgv”,
“bike-regular”,
“bike-mountain”,
“bike-road”,
“bike-electric”,
“walking”,
“hiking”,
“wheelchair”
],

What’s the problem?

thank you

Hi @ocean,

Where did you change the .pbf path? This post might help you a bit.

Maybe also post your full app.config.

@adam or @takb could youtake a look at this?

This is my app.config:

{
  "ors": {
    "info": {
      "base_url": "https://openrouteservice.org/",
      "support_mail": "support@openrouteservice.org",
      "author_tag": "openrouteservice",
      "content_licence": "LGPL 3.0"
    },
    "services": {
      "matrix": {
        "enabled": true,
        "maximum_routes": 100,
        "maximum_routes_flexible": 25,
        "maximum_search_radius": 5000,
        "maximum_visited_nodes": 100000,
        "allow_resolve_locations": true,
        "attribution": "openrouteservice.org, OpenStreetMap contributors"
      },
      "isochrones": {
        "enabled": true,
        "maximum_range_distance": [
          { "profiles": "any", "value": 50000 },
          { "profiles": "driving-car, driving-hgv", "value": 100000 }
        ],
        "maximum_range_time": [
          { "profiles": "any", "value": 18000 },
          { "profiles": "driving-car, driving-hgv", "value": 3600 }
        ],
        "fastisochrones": {
          "maximum_range_distance": [
            { "profiles": "any", "value": 50000 },
            { "profiles": "driving-car, driving-hgv", "value": 500000 }
          ],
          "maximum_range_time": [
            { "profiles": "any", "value": 18000 },
            { "profiles": "driving-car, driving-hgv", "value": 10800 }
          ],
          "profiles": {
            "default_params": {
              "enabled": false,
              "threads": 12,
              "weightings": "recommended",
              "maxcellnodes": 5000
            },
            "profile-vehicles-hgv": {
              "enabled": true,
              "threads": 12,
              "weightings": "recommended, shortest",
              "maxcellnodes": 5000
            }
          }
        },
        "maximum_intervals": 10,
        "maximum_locations": 2,
        "allow_compute_area": true
      },
      "routing": {
        "enabled": true,
        "mode": "normal",
        "routing_description": "This is a routing file from openrouteservice",
        "routing_name": "openrouteservice routing",
        "sources": ["C:/Users/Ocean/Desktop/ITSVIL/ComuneSalerno/heidelberg.osm.gz"],
        "init_threads": 2,
        "attribution": "openrouteservice.org, OpenStreetMap contributors",
        "elevation_preprocessed": false,
        "profiles": {
          "active": [
            "car",
            "hgv",
            "bike-regular",
            "bike-mountain",
            "bike-road",
            "bike-electric",
            "walking",
            "hiking",
            "wheelchair"
          ],
          "default_params": {
            "encoder_flags_size": 8,
            "graphs_root_path": "C:/Users/Ocean/Desktop/ITSVIL/ComuneSalerno/graphs",
            "elevation_provider": "multi",
            "elevation_cache_path": "C:/Users/Ocean/Desktop/ITSVIL/ComuneSalerno/cgiar_provider",
            "elevation_cache_clear": false,
            "instructions": true,
            "maximum_distance": 100000,
            "maximum_distance_dynamic_weights": 100000,
            "maximum_distance_avoid_areas": 100000,
            "maximum_waypoints": 50,
            "maximum_snapping_radius": 400,
            "maximum_avoid_polygon_area": 200000000,
            "maximum_avoid_polygon_extent": 20000,
            "maximum_distance_alternative_routes": 100000,
            "maximum_alternative_routes": 3,
            "maximum_distance_round_trip_routes": 100000,
            "maximum_speed_lower_bound": 80,
            "preparation": {
              "min_network_size": 200,
              "min_one_way_network_size": 200,

              "methods": {
                "lm": {
                  "enabled": true,
                  "threads": 1,
                  "weightings": "recommended,shortest",
                  "landmarks": 16
                }
              }
            },
            "execution": {
              "methods": {
                "lm": {
                  "disabling_allowed": true,
                  "active_landmarks": 8
                }
              }
            }
          },
          "profile-car": {
            "profiles": "driving-car",
            "parameters": {
              "encoder_flags_size": 8,
              "encoder_options": "turn_costs=true|block_fords=false|use_acceleration=false",
              "maximum_distance": 100000,
              "elevation": true,
              "maximum_snapping_radius": 350,
              "preparation": {
                "min_network_size": 200,
                "min_one_way_network_size": 200,

                "methods": {
                  "ch": {
                    "enabled": true,
                    "threads": 1,
                    "weightings": "fastest"
                  },
                  "lm": {
                    "enabled": false,
                    "threads": 1,
                    "weightings": "fastest,shortest",
                    "landmarks": 16
                  },
                  "core": {
                      "enabled": true,
                      "threads": 1,
                      "weightings": "fastest,shortest",
                      "landmarks": 64,
                      "lmsets": "highways;allow_all"
                  }
                }
              },
              "execution": {
                "methods": {
                  "ch": {
                    "disabling_allowed": true
                  },
                  "lm": {
                    "disabling_allowed": true,
                    "active_landmarks": 6
                  },
                  "core": {
                    "disabling_allowed": true,
                    "active_landmarks": 6
                  }
                }
              },
              "ext_storages": {
                "WayCategory": {},
                "HeavyVehicle": {},
                "WaySurfaceType": {},
                "RoadAccessRestrictions": {
                  "use_for_warnings": true
                }
              }
            }
          },
          "profile-hgv": {
            "profiles": "driving-hgv",
            "parameters": {
              "encoder_flags_size": 8,
              "encoder_options": "turn_costs=true|block_fords=false|use_acceleration=false",
              "maximum_distance": 100000,
              "elevation": true,
              "preparation": {
                "min_network_size": 200,
                "min_one_way_network_size": 200,

                "methods": {
                  "ch": {
                    "enabled": true,
                    "threads": 1,
                    "weightings": "recommended"
                  },
                  "lm": {
                    "enabled": true,
                    "threads": 1,
                    "weightings": "recommended,shortest",
                    "landmarks": 16
                  },
                  "core": {
                    "enabled": true,
                    "threads": 1,
                    "weightings": "recommended,shortest",
                    "landmarks": 64,
                    "lmsets": "highways;allow_all"
                  }
                }
              },
              "execution": {
                "methods": {
                  "ch": {
                    "disabling_allowed": true
                  },
                  "lm": {
                    "disabling_allowed": true,
                    "active_landmarks": 6
                  },
                  "core": {
                    "disabling_allowed": true,
                    "active_landmarks": 6
                  }

                }
              },
              "ext_storages": {
                "WayCategory": {},
                "HeavyVehicle": {
                  "restrictions": true
                },
                "WaySurfaceType": {}
              }
            }
          },
          "profile-bike-regular": {
            "profiles": "cycling-regular",
            "parameters": {
              "encoder_options": "consider_elevation=true|turn_costs=true|block_fords=false",
              "elevation": true,
              "ext_storages": {
                "WayCategory": {},
                "WaySurfaceType": {},
                "HillIndex": {},
                "TrailDifficulty": {}
              }
            }
          },
          "profile-bike-mountain": {
            "profiles": "cycling-mountain",
            "parameters": {
              "encoder_options": "consider_elevation=true|turn_costs=true|block_fords=false",
              "elevation": true,
              "ext_storages": {
                "WayCategory": {},
                "WaySurfaceType": {},
                "HillIndex": {},
                "TrailDifficulty": {}
              }
            }
          },
          "profile-bike-road": {
            "profiles": "cycling-road",
            "parameters": {
              "encoder_options": "consider_elevation=true|turn_costs=true|block_fords=false",
              "elevation": true,
              "ext_storages": {
                "WayCategory": {},
                "WaySurfaceType": {},
                "HillIndex": {},
                "TrailDifficulty": {}
              }
            }
          },
          "profile-bike-electric": {
            "profiles": "cycling-electric",
            "parameters": {
              "encoder_options": "consider_elevation=true|turn_costs=true|block_fords=false",
              "elevation": true,
              "ext_storages": {
                "WayCategory": {},
                "WaySurfaceType": {},
                "HillIndex": {},
                "TrailDifficulty": {}
              }
            }
          },
          "profile-walking": {
            "profiles": "foot-walking",
            "parameters": {
              "encoder_options": "block_fords=false",
              "elevation": true,
              "ext_storages": {
                "WayCategory": {},
                "WaySurfaceType": {},
                "HillIndex": {},
                "TrailDifficulty": {}
              }
            }
          },
          "profile-hiking": {
            "profiles": "foot-hiking",
            "parameters": {
              "encoder_options": "block_fords=false",
              "elevation": true,
              "ext_storages": {
                "WayCategory": {},
                "WaySurfaceType": {},
                "HillIndex": {},
                "TrailDifficulty": {}
              }
            }
          },

          "profile-wheelchair": {
            "profiles": "wheelchair",
            "parameters": {
              "encoder_options": "block_fords=true",
              "elevation": true,
              "maximum_snapping_radius": 50,
              "ext_storages": {
                "WayCategory": {},
                "WaySurfaceType": {},
                "Wheelchair": {
                  "KerbsOnCrossings": "true"
                },
                "OsmId": {}
              }
            }
          }
        }
      }
    },
    "logging": {
      "enabled": true,
      "level_file": "DEBUG_LOGGING.json",
      "location": "/var/log/ors",
      "stdout": true
    },
    "system_message": [
        {
            "active": false,
            "text": "This message would be sent with every routing bike fastest request",
            "condition": {
                "request_service": "routing",
                "request_profile": "cycling-regular,cycling-mountain,cycling-road,cycling-electric",
                "request_preference": "fastest"
            }
        },
        {
            "active": false,
            "text": "This message would be sent with every request for geojson response",
            "condition": {
                "api_format": "geojson"
            }
        },
        {
            "active": false,
            "text": "This message would be sent with every request on API v1 from January 2020 until June 2050",
            "condition": {
                "api_version": 1,
                "time_after": "2020-01-01T00:00:00Z",
                "time_before": "2050-06-01T00:00:00Z"
            }
        },
        {
            "active": false,
            "text": "This message would be sent with every request"
        }
    ]
  }
}

The directories “graphs” and “cgiar_provider” are successfully created in the indicated paths but on startup gives me this error:

2020-09-15 11:17:24.342 ERROR 13536 --- [       ORS-Init] o.h.o.r.RoutingProfileManager            : Failed to initialize RoutingProfileManager instance.

java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:?]
	at java.util.concurrent.FutureTask.get(FutureTask.java:191) ~[?:?]
	at org.heigit.ors.routing.RoutingProfileManager.initialize(RoutingProfileManager.java:161) ~[classes/:?]
	at org.heigit.ors.routing.RoutingProfileManager.getInstance(RoutingProfileManager.java:56) ~[classes/:?]
	at org.heigit.ors.servlet.listeners.ORSInitContextListener.lambda$0(ORSInitContextListener.java:40) ~[classes/:?]
	at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at org.heigit.ors.routing.graphhopper.extensions.core.CoreAlgoFactoryDecorator.prepare(CoreAlgoFactoryDecorator.java:306) ~[classes/:?]
	at org.heigit.ors.routing.graphhopper.extensions.ORSGraphHopper.prepareCore(ORSGraphHopper.java:717) ~[classes/:?]
	at org.heigit.ors.routing.graphhopper.extensions.ORSGraphHopper.postProcessing(ORSGraphHopper.java:637) ~[classes/:?]
	at com.graphhopper.GraphHopper.process(GraphHopper.java:703) ~[graphhopper-core-v0.13.5.jar:?]
	at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:680) ~[graphhopper-core-v0.13.5.jar:?]
	at org.heigit.ors.routing.graphhopper.extensions.ORSGraphHopper.importOrLoad(ORSGraphHopper.java:158) ~[classes/:?]
	at org.heigit.ors.routing.RoutingProfile.initGraphHopper(RoutingProfile.java:186) ~[classes/:?]
	at org.heigit.ors.routing.RoutingProfile.<init>(RoutingProfile.java:132) ~[classes/:?]
	at org.heigit.ors.routing.RoutingProfileLoader.call(RoutingProfileLoader.java:35) ~[classes/:?]
	at org.heigit.ors.routing.RoutingProfileLoader.call(RoutingProfileLoader.java:1) ~[classes/:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
	... 1 more
Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:?]
	at java.util.concurrent.FutureTask.get(FutureTask.java:191) ~[?:?]
	at org.heigit.ors.routing.graphhopper.extensions.core.CoreAlgoFactoryDecorator.prepare(CoreAlgoFactoryDecorator.java:302) ~[classes/:?]
	at org.heigit.ors.routing.graphhopper.extensions.ORSGraphHopper.prepareCore(ORSGraphHopper.java:717) ~[classes/:?]
	at org.heigit.ors.routing.graphhopper.extensions.ORSGraphHopper.postProcessing(ORSGraphHopper.java:637) ~[classes/:?]
	at com.graphhopper.GraphHopper.process(GraphHopper.java:703) ~[graphhopper-core-v0.13.5.jar:?]
	at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:680) ~[graphhopper-core-v0.13.5.jar:?]
	at org.heigit.ors.routing.graphhopper.extensions.ORSGraphHopper.importOrLoad(ORSGraphHopper.java:158) ~[classes/:?]
	at org.heigit.ors.routing.RoutingProfile.initGraphHopper(RoutingProfile.java:186) ~[classes/:?]
	at org.heigit.ors.routing.RoutingProfile.<init>(RoutingProfile.java:132) ~[classes/:?]
	at org.heigit.ors.routing.RoutingProfileLoader.call(RoutingProfileLoader.java:35) ~[classes/:?]
	at org.heigit.ors.routing.RoutingProfileLoader.call(RoutingProfileLoader.java:1) ~[classes/:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
	... 1 more
Caused by: java.lang.NullPointerException
	at org.heigit.ors.routing.graphhopper.extensions.edgefilters.core.AvoidFeaturesCoreEdgeFilter.accept(AvoidFeaturesCoreEdgeFilter.java:45) ~[classes/:?]
	at org.heigit.ors.routing.graphhopper.extensions.edgefilters.EdgeFilterSequence.accept(EdgeFilterSequence.java:29) ~[classes/:?]
	at org.heigit.ors.routing.graphhopper.extensions.core.PrepareCore.calculatePriority(PrepareCore.java:413) ~[classes/:?]
	at org.heigit.ors.routing.graphhopper.extensions.core.PrepareCore.prepareNodes(PrepareCore.java:180) ~[classes/:?]
	at org.heigit.ors.routing.graphhopper.extensions.core.PrepareCore.doSpecificWork(PrepareCore.java:168) ~[classes/:?]
	at com.graphhopper.routing.util.AbstractAlgoPreparation.doWork(AbstractAlgoPreparation.java:30) ~[graphhopper-core-v0.13.5.jar:?]
	at org.heigit.ors.routing.graphhopper.extensions.core.CoreAlgoFactoryDecorator.lambda$0(CoreAlgoFactoryDecorator.java:292) ~[classes/:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
	... 1 more

Thanks

I tried building with your config and everything worked as expected with no errors. What I would suggest is to delete the graphs folder and then just to try rebuilding again and seeing if the same error comes up. It could just be that the first time it built it didn’t do it properly, and then if you restart it with graphs still in the folder it will try to reload those rather than rebuilding.

Also, are you running this through Docker, or through Tomcat/Maven?

Running this through Tomcat 9.

I also tried to delete both the “graph” directory and the “cgiar_provider” directory before rebooting but the problem is the same. Really weird …

I always wanted to know why is this different than say Google maps, its kind of a congnitive load. thankyou for the amazing job at this!!