Comments (11)
Hello, I'm AFK right now, I'll have a look at it in early September.
Do other functions work (e.g. osrmRoute() or osrmTable())?
from osrm.
Hi,
Are you back to the keyboard?
And to answer your question belatedly, yes, I get results when I call OSRM from curl like so:
curl "<server-ip>:5111/route/v1/foot/40.6476940,-73.9803640;40.6551440,-74.0035490?steps=true"
Thank you for your help,
S.
from osrm.
Ok thanks,
Does this snippet work ?
library(osrm)
osrmRoute(src = c(-73.9803640, 40.6476940), dst = c(-74.0035490, 40.6551440),
osrm.server = "http://192.168.1.16:5111/",
osrm.profile = "foot")
from osrm.
from osrm.
That said, when I input http://192.168.1.16:5111/
in my browser, I get this error message from OSRM:
{"message":"URL string malformed close to position 1: \"\/\"","code":"InvalidUrl"}
And yet I am positive that is the address on which OSRM is published. Here is the docker-compose.yml
file:
version: "3"
services:
osrm-backend:
image: osrm/osrm-backend:latest
container_name: rte
restart: unless-stopped
command: "osrm-routed --algorithm mld /data/nyc.osrm"
volumes:
- "/mnt/sam/cch/rte:/data"
ports:
- 5111:5000
labels:
- com.centurylinklabs.watchtower.enable=true
And the container's log shows no error.
from osrm.
That said, when I input
http://192.168.1.16:5111/
in my browser, I get this error message from OSRM:{"message":"URL string malformed close to position 1: \"\/\"","code":"InvalidUrl"}
This message is returned by OSRM, so it's OK. OSRM is published and accessible at this address...
Anyway the problem does not seem to be linked specifically to osrmNearest()
. I'll change the label of the issue.
from osrm.
hey there,
i have exactly the same problem. when I run your example I get
> travel_time$durations[1:5,1:5]
1 2 3 4 5
1 0 0 0 0 0
2 0 0 0 0 0
3 0 0 0 0 0
4 0 0 0 0 0
5 0 0 0 0 0
each time. what's weird is this:
> travel_time$sources[1:5,]
lon lat
1 0.337306 51.54285
2 0.337306 51.54285
3 0.337306 51.54285
4 0.337306 51.54285
5 0.337306 51.54285
> travel_time$destinations[1:5,]
lon lat
1 0.337306 51.54285
2 0.337306 51.54285
3 0.337306 51.54285
4 0.337306 51.54285
5 0.337306 51.54285
when in reality those should be (when I use the online routing server)
> travel_time$sources
lon lat
1 13.43857 52.47726
2 13.57897 52.45815
3 13.49047 52.61726
4 13.51960 52.49760
5 13.45592 52.50109
6 13.33849 52.49470
similarly:
> osrmRoute(src = c(-73.9803640, 40.6476940), dst = c(-74.0035490, 40.6551440),
+ osrm.server = "http://127.0.0.1:5001/",
+ osrm.profile = "foot")
Simple feature collection with 1 feature and 4 fields
Geometry type: LINESTRING
Dimension: XY
Bounding box: xmin: -0.5152 ymin: 51.46248 xmax: -0.5152 ymax: 51.46248
Geodetic CRS: WGS 84
src dst duration distance geometry
src_dst src dst 0 0 LINESTRING (-0.5152 51.4624...
always returns zero distance.
the API seems to run correctly:
floswald@PTL11077 ~/D/r/B/D/shapefiles> curl "http://127.0.0.1:5001/route/v1/driving/51.462,-0.038;51.55,-0.097?steps=true" (base)
{"code":"Ok","routes":[{"geometry":"cb`xHqqQ??","legs":[{"steps":[{"geometry":"cb`xHqqQ??","maneuver":{"bearing_after":133,"bearing_before":0,"location":[0.09513,51.287537],"type":"depart"},"mode":"driving","driving_side":"right","name":"Hogtrough Hill","intersections":[{"out":0,"entry":[true],"bearings":[133],"location":[0.09513,51.287537]}],"weight":0,"duration":0,"distance":0},{"geometry":"cb`xHqqQ","maneuver":{"bearing_after":0,"bearing_before":133,"location":[0.09513,51.287537],"type":"arrive"},"mode":"driving","driving_side":"right","name":"Hogtrough Hill","intersections":[{"in":0,"entry":[true],"bearings":[313],"location":[0.09513,51.287537]}],"weight":0,"duration":0,"distance":0}],"summary":"Hogtrough Hill","weight":0,"duration":0,"distance":0}],"weight_name":"routability","weight":0,"duration":0,"distance":0}],"waypoints":[{"hint":"_GQCgCNlAoAJAAAAAAAAALEGAAAAAAAAVyxQQAAAAACuoxREAAAAAAUAAAAAAAAAVwMAAAAAAACbAQAAmnMBAPGVDgNwPxEDkGv__xMAXwiiZDlw","distance":7677559.389826364,"name":"Hogtrough Hill","location":[0.09513,51.287537]},{"hint":"_GQCgCNlAoAJAAAAAAAAALEGAAAAAAAAVyxQQAAAAACuoxREAAAAAAUAAAAAAAAAVwMAAAAAAACbAQAAmnMBAPGVDgMwlxIDGIX-_xMAXwiiZDlw","distance":7689755.214539866,"name":"Hogtrough Hill","location":[0.09513,51.287537]}]}⏎
from osrm.
oh no, just realised that the API is returning zero distance all the time! so that's the problem here...
from osrm.
nevermind, I reconfigured the package in a new location and on a new openstreetmap, now it works. strangely only the R package works, the curl calls always return zero distance...
from osrm.
Hi @asitemade4u ,
Have you solved the problem?
from osrm.
Related Issues (20)
- Difference between `osrmRoute` and `osrmTrip`
- Distance between multiple pairs of points? HOT 1
- How can I remove alternate routes when using osrm package in leaflet(r)? HOT 1
- Improve error handling osrmIsochrone(): out of bounds
- Improve error handling `osrmIsochrone()`: character vector of location HOT 1
- Improve error handling `osrmIsochrone()`: handle empty isochrones
- Improve documentation `osrmIsochrone()`: `breaks` argument
- Define "isometric" and "isodistance"
- Speed parameter HOT 3
- Stop osrm "connecting" to the network via certain types of roads HOT 6
- Problem with input data and osrmTrip() HOT 3
- curl::curl_fetch_memory(utils::URLencode(url) => connection was reset HOT 4
- osrmIsochrone(): 'loc' is too far from the OSRM network but loc is not too far... HOT 9
- Error in `osrmTrip()` when location coordinates are close to each other and/or not on roads HOT 2
- pairwise distance matrix from OSRM? HOT 2
- Using custom driving profiles HOT 2
- Curl Header Overflow for Large Distance Matrices HOT 4
- fix pkg level documentation
- Duration of trip in osrmRoute and time of the day/traffic HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from osrm.