← Toutes les opérations
POST/v1/match

Snap a GPS trace to the road graph

Takes a raw GPS trace (noisy, possibly off-road) and returns the most likely sequence of road segments. Used post-trip for fare calculation and analytics.

Corps de la requête

Schéma : MatchRequest

JSONExemple
{
  "shape": [
    {
      "lat": 5.3197,
      "lng": -4.0167,
      "time": 1712000000
    },
    {
      "lat": 5.3223,
      "lng": -4.0142,
      "time": 1712000030
    },
    {
      "lat": 5.326,
      "lng": -4.011,
      "time": 1712000060
    }
  ],
  "mode": "auto"
}

Réponses

  • 200Matched trace.

Exemples de code

curl -X POST https://api.afrimap.ci/v1/match \
  -H "X-AfriMap-Key: $AFM_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "shape": [
      {"lat":5.3197,"lng":-4.0167,"time":1712000000},
      {"lat":5.3223,"lng":-4.0142,"time":1712000030},
      {"lat":5.3260,"lng":-4.0110,"time":1712000060}
    ],
    "mode": "auto"
  }'