M
M
morfair2019-10-08 16:05:52
OpenStreetMap
morfair, 2019-10-08 16:05:52

How to understand the output of OSRM match?

I have a set of raw data from GPS trackers, but if you directly display them on a map, there is often a marriage in the form of cut corners and bends.
I want to tie the track to the roads. Found an OSRM product ( https://github.com/Project-OSRM/osrm-backend) with a match map function. But something I do not understand what to do with his output.
Source GeoJSON:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [
            40.96777081489563,
            57.014261542961314
          ],
          [
            40.96928358078003,
            57.01361317487102
          ],
          [
            40.96896171569824,
            57.012404025803264
          ],
          [
            40.97000241279602,
            57.01218205213829
          ],
          [
            40.97169756889343,
            57.011434341624685
          ],
          [
            40.97221255302429,
            57.009816197876354
          ],
          [
            40.97302794456482,
            57.00985124866738
          ]
        ]
      }
    }
  ]
}

Request:
/match/v1/driving/40.96777081489563,57.014261542961314;40.96928358078003,57.01361317487102;40.96896171569824,57.012404025803264;40.97000241279602,57.01218205213829;40.97169756889343,57.011434341624685;40.97221255302429,57.009816197876354;40.97302794456482,57.00985124866738?steps=false&annotations=false&geometries=geojson&overview=false

Result:
{
  'code': 'Ok',
  'matchings': [
    {
      'confidence': 0,
      'legs': [
        {
          'steps': [
            
          ],
          'distance': 132.1,
          'duration': 32,
          'summary': '',
          'weight': 32
        },
        {
          'steps': [
            
          ],
          'distance': 138.4,
          'duration': 21.6,
          'summary': '',
          'weight': 21.6
        },
        {
          'steps': [
            
          ],
          'distance': 98.1,
          'duration': 25.9,
          'summary': '',
          'weight': 25.9
        },
        {
          'steps': [
            
          ],
          'distance': 174.7,
          'duration': 43.8,
          'summary': '',
          'weight': 43.8
        },
        {
          'steps': [
            
          ],
          'distance': 402.3,
          'duration': 44,
          'summary': '',
          'weight': 45.9
        },
        {
          'steps': [
            
          ],
          'distance': 50.9,
          'duration': 16.2,
          'summary': '',
          'weight': 20.4
        }
      ],
      'distance': 996.5,
      'duration': 183.5,
      'weight_name': 'routability',
      'weight': 189.6
    }
  ],
  'tracepoints': [
    {
      'alternatives_count': 0,
      'waypoint_index': 0,
      'matchings_index': 0,
      'location': [
        40.967772,
        57.014263
      ],
      'name': '',
      'distance': 0.126847,
      'hint': 'R3g4gEl4OAA8AAAAtgAAAAAAAAAAAAAAkJfKQXJTl0IAAAAAAAAAADwAAAC2AAAAAAAAAAAAAAD4AQAAXB5xAvf3ZQNbHnEC9vdlAwAADwfM-Vyn'
    },
    {
      'alternatives_count': 0,
      'waypoint_index': 1,
      'matchings_index': 0,
      'location': [
        40.969276,
        57.013603
      ],
      'name': 'улица Шестернина',
      'distance': 1.214997,
      'hint': 'PHg4AE54OIAFAAAAEwAAAAAAAAAHAAAAxKZiQG9FVEEAAAAAMaWfQAUAAAATAAAAAAAAAAcAAAD4AQAAPCRxAmP1ZQNEJHECbfVlAwAAPxLM-Vyn'
    },
    {
      'alternatives_count': 0,
      'waypoint_index': 2,
      'matchings_index': 0,
      'location': [
        40.968977,
        57.012403
      ],
      'name': 'улица Жиделева',
      'distance': 0.917787,
      'hint': 'Ong4gFp4OAB5AAAAGgAAAEkAAAAaAAAAtzGpQqdlikGxw0lCILmRQXkAAAAaAAAASQAAABoAAAD4AQAAESNxArPwZQMCI3ECtPBlAwEAfwvM-Vyn'
    },
    {
      'alternatives_count': 0,
      'waypoint_index': 3,
      'matchings_index': 0,
      'location': [
        40.970006,
        57.012166
      ],
      'name': '',
      'distance': 1.798277,
      'hint': 'XHg4gF54OACWAAAAagAAAAAAAAAWAAAAtyB7QiaIMUIAAAAAekwUQZYAAABqAAAAAAAAABYAAAD4AQAAFidxAsbvZQMSJ3EC1u9lAwAAHwXM-Vyn'
    },
    {
      'alternatives_count': 0,
      'waypoint_index': 4,
      'matchings_index': 0,
      'location': [
        40.971605,
        57.011396
      ],
      'name': '',
      'distance': 7.05764,
      'hint': 'XXg4gIp4OAAgAAAAAAAAAAMBAAAAAAAA_5FWQQAAAACADNhCAAAAACAAAAAAAAAAAwEAAAAAAAD4AQAAVS1xAsTsZQOyLXEC6uxlAwIA3wTM-Vyn'
    },
    {
      'alternatives_count': 0,
      'waypoint_index': 5,
      'matchings_index': 0,
      'location': [
        40.972258,
        57.009812
      ],
      'name': 'проспект Ленина',
      'distance': 2.769079,
      'hint': 'AOUDgP___38jAAAAIwAAAAAAAAAAAAAAvBk9QgAAAAAAAAAAAAAAACMAAAAjAAAAAAAAAAAAAAD4AQAA4i9xApTmZQO1L3ECmOZlAwAADxbM-Vyn'
    },
    {
      'alternatives_count': 1,
      'waypoint_index': 6,
      'matchings_index': 0,
      'location': [
        40.973035,
        57.009828
      ],
      'name': '',
      'distance': 2.596368,
      'hint': 'vXQ4AAR1OIAVAAAARgAAAAAAAAAOAAAA9_aRQGVnZ0EAAAAApcQ6QAsAAAAjAAAAAAAAAAcAAAD4AQAA6zJxAqTmZQPkMnECu-ZlAwAATxDM-Vyn'
    }
  ]
}

Well, now how to get a beautiful GeoJSON?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2019-10-08
@morfair

Is your request malformed? it was necessary to
And read the Documentation
more carefully: The overview parameter is responsible for displaying the track geometry in the result, and you have it false

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question