Coder Social home page Coder Social logo

Comments (11)

rCarto avatar rCarto commented on June 22, 2024

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.

asitemade4u avatar asitemade4u commented on June 22, 2024

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.

rCarto avatar rCarto commented on June 22, 2024

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.

asitemade4u avatar asitemade4u commented on June 22, 2024

from osrm.

asitemade4u avatar asitemade4u commented on June 22, 2024

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.

rCarto avatar rCarto commented on June 22, 2024

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.

floswald avatar floswald commented on June 22, 2024

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.

floswald avatar floswald commented on June 22, 2024

oh no, just realised that the API is returning zero distance all the time! so that's the problem here...

from osrm.

floswald avatar floswald commented on June 22, 2024

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.

rCarto avatar rCarto commented on June 22, 2024

Hi @asitemade4u ,
Have you solved the problem?

from osrm.

Related Issues (20)

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.