gis-ops / docker-valhalla

This is our flexible Docker repository for the Valhalla routing engine
MIT License
249 stars 71 forks source link

Input and output locations are same!!! #72

Closed saman-oz closed 2 years ago

saman-oz commented 2 years ago

Hello... I have a strange issue with running the docker image Input and output locations are same!!! input:

{
    "locations":[
        {"lat": 35.7639, "lon": 51.30281},
        {"lat": 35.7639, "lon": 51.30281},
        {"lat": 35.767372, "lon": 51.31054},
        {"lat": 35.76738, "lon": 51.31053},
        {"lat": 35.76361, "lon": 51.3018},
        {"lat": 35.76361, "lon": 51.30153},
        {"lat": 35.76361, "lon": 51.301804},
        {"lat": 35.76362, "lon": 51.30154},
        {"lat": 35.76398, "lon": 51.30343},
        {"lat": 35.76397, "lon": 51.30344},
        {"lat": 35.76496, "lon": 51.30559},
        {"lat": 35.76495, "lon": 51.30559},
        {"lat": 35.76478, "lon": 51.3052},
        {"lat": 35.76526, "lon": 51.306377},
        {"lat": 35.76495, "lon": 51.30559},
        {"lat": 35.76478, "lon": 51.3052}
    ],
    "costing":"auto",
    "directions_options":{
        "units":"meters"
    }
}
nilsnolde commented 2 years ago

can you please elaborate? I don't understand what the problem is supposed to be..

saman-oz commented 2 years ago

Let me ask another way... How can I get the JSON{or another type} file of map matched path? because I need it to visualize the path of the specified user

nilsnolde commented 2 years ago

you mean https://github.com/valhalla/valhalla/blob/master/docs/api/map-matching/api-reference.md#trace-route-action?

I'm really not sure what your input is and what you expect as output? input: user locations as e.g. gps trace (similar to your code above), output: map-matched route? then /trace_route should be what you want.

atrinalaei commented 2 years ago

Hi @nilsnolde. I am Saman's teammate. our in put is a set of gps trace data. As output of /trace_route (as you said) we expect a set of points identifying the correct link on which a vehicle or user is travelling and to determine the precise vehicle position on that link OR we expect a line string which are the route of the user that make us able to visual the route of user on map. BUT we get following Jason file as output that it is not supposed to be what we expect or we can not access the values we want. Capture

nilsnolde commented 2 years ago

you should spend some time reading the documentation of the free software you're using: https://github.com/valhalla/valhalla/blob/master/docs/api/map-matching/api-reference.md#outputs-of-trace_route leads you to https://github.com/valhalla/valhalla/blob/master/docs/api/turn-by-turn/api-reference.md#trip-legs-and-maneuvers