Directions Api returns differnt elevation values for same point on reverse route

I noticed that the elevation data differs on a route along a single street depending on wether I use the forward or the backwards route. Down below I included an example of a single street in Monaco. As you can see the first coordinate in the forward case is the same as the last in the backwards case (7.435213, 43.750089) but in the one request the elevation is given with 96.1 and in the other request with 107.2.
Is this expected behaviour and I simple miss something?

Forward Case:

curl -X POST -H "Content-Type: application/json" -H 'Authorization: xxx' -d '{"coordinates": [[7.4352131,43.7500887],[7.434852,43.7508702]],"elevation": true,"extra_info": ["steepness"]}}' https://api.openrouteservice.org/v2/directions/driving-car/geojson | jq 

{
  "type": "FeatureCollection",
  "features": [
    {
      "bbox": [
        7.434755,
        43.749975,
        96.14,
        7.435286,
        43.750878,
        107.75
      ],
      "type": "Feature",
      "properties": {
        "ascent": 11.6,
        "descent": 0,
        "segments": [
          {
            "distance": 239.3,
            "duration": 57.4,
            "steps": [
              {
                "distance": 239.3,
                "duration": 57.4,
                "type": 11,
                "instruction": "Head southwest on Avenue Delphine",
                "name": "Avenue Delphine",
                "way_points": [
                  0,
                  19
                ]
              },
              {
                "distance": 0,
                "duration": 0,
                "type": 10,
                "instruction": "Arrive at Avenue Delphine, straight ahead",
                "name": "-",
                "way_points": [
                  19,
                  19
                ]
              }
            ],
            "ascent": 11.631523068745949,
            "descent": 0.045075352986671646
          }
        ],
        "extras": {
          "steepness": {
            "values": [
              [
                0,
                19,
                2
              ]
            ],
            "summary": [
              {
                "value": 2,
                "distance": 239.3,
                "amount": 100
              }
            ]
          }
        },
        "way_points": [
          0,
          19
        ],
        "summary": {
          "distance": 239.3,
          "duration": 57.4
        }
      },
      "geometry": {
        "coordinates": [
          [
            7.435213,
            43.750089,
            96.1
          ],
          [
            7.435213,
            43.750089,
            102.6
          ],
          [
            7.435019,
            43.749975,
            105.4
          ],
          [
            7.43497,
            43.749986,
            105.9
          ],
          [
            7.43497,
            43.750043,
            106.2
          ],
          [
            7.435253,
            43.750232,
            106.9
          ],
          [
            7.435262,
            43.750266,
            107
          ],
          [
            7.4352,
            43.750382,
            107.1
          ],
          [
            7.435286,
            43.750537,
            107.1
          ],
          [
            7.435261,
            43.750568,
            107.1
          ],
          [
            7.435212,
            43.750549,
            107.1
          ],
          [
            7.434969,
            43.750326,
            107.2
          ],
          [
            7.434894,
            43.750289,
            107.2
          ],
          [
            7.434798,
            43.750285,
            107.2
          ],
          [
            7.434755,
            43.750347,
            107.2
          ],
          [
            7.434867,
            43.750564,
            107.8
          ],
          [
            7.43493,
            43.750841,
            107.7
          ],
          [
            7.434924,
            43.750864,
            107.7
          ],
          [
            7.434881,
            43.750878,
            107.7
          ],
          [
            7.434852,
            43.75087,
            107.7
          ]
        ],
        "type": "LineString"
      }
    }
  ],
  "bbox": [
    7.434755,
    43.749975,
    96.14,
    7.435286,
    43.750878,
    107.75
  ],
  "metadata": {
    "attribution": "openrouteservice.org | OpenStreetMap contributors",
    "service": "routing",
    "timestamp": 1647620483537,
    "query": {
      "coordinates": [
        [
          7.4352131,
          43.7500887
        ],
        [
          7.434852,
          43.7508702
        ]
      ],
      "profile": "driving-car",
      "format": "geojson",
      "elevation": true,
      "extra_info": [
        "steepness"
      ]
    },
    "engine": {
      "version": "6.7.0",
      "build_date": "2022-02-18T19:37:41Z",
      "graph_date": "2022-02-21T14:34:17Z"
    }
  }
}

Backward case:

curl -X POST -H "Content-Type: application/json" -H 'Authorization: xxx' -d '{"coordinates": [[7.434852,43.7508702],[7.4352131,43.7500887]],"elevation": true,"extra_info": ["steepness"]}}' https://api.openrouteservice.org/v2/directions/driving-car/geojson | jq

{
  "type": "FeatureCollection",
  "features": [
    {
      "bbox": [
        7.434755,
        43.749975,
        107.24,
        7.435286,
        43.750878,
        108.48
      ],
      "type": "Feature",
      "properties": {
        "ascent": 0.2,
        "descent": 1.4,
        "segments": [
          {
            "distance": 239.3,
            "duration": 57.4,
            "steps": [
              {
                "distance": 239.3,
                "duration": 57.4,
                "type": 11,
                "instruction": "Head east on Avenue Delphine",
                "name": "Avenue Delphine",
                "way_points": [
                  0,
                  19
                ]
              },
              {
                "distance": 0,
                "duration": 0,
                "type": 10,
                "instruction": "Arrive at Avenue Delphine, straight ahead",
                "name": "-",
                "way_points": [
                  19,
                  19
                ]
              }
            ],
            "ascent": 0.17026644314036332,
            "descent": 1.4161145266364628
          }
        ],
        "extras": {
          "steepness": {
            "values": [
              [
                0,
                19,
                0
              ]
            ],
            "summary": [
              {
                "value": 0,
                "distance": 239.3,
                "amount": 100
              }
            ]
          }
        },
        "way_points": [
          0,
          19
        ],
        "summary": {
          "distance": 239.3,
          "duration": 57.4
        }
      },
      "geometry": {
        "coordinates": [
          [
            7.434852,
            43.75087,
            108.5
          ],
          [
            7.434881,
            43.750878,
            108.2
          ],
          [
            7.434924,
            43.750864,
            108.1
          ],
          [
            7.43493,
            43.750841,
            108.1
          ],
          [
            7.434867,
            43.750564,
            108
          ],
          [
            7.434755,
            43.750347,
            107.9
          ],
          [
            7.434798,
            43.750285,
            107.9
          ],
          [
            7.434894,
            43.750289,
            107.8
          ],
          [
            7.434969,
            43.750326,
            107.8
          ],
          [
            7.435212,
            43.750549,
            107.7
          ],
          [
            7.435261,
            43.750568,
            107.7
          ],
          [
            7.435286,
            43.750537,
            107.7
          ],
          [
            7.4352,
            43.750382,
            107.7
          ],
          [
            7.435262,
            43.750266,
            107.7
          ],
          [
            7.435253,
            43.750232,
            107.7
          ],
          [
            7.43497,
            43.750043,
            107.7
          ],
          [
            7.43497,
            43.749986,
            107.7
          ],
          [
            7.435019,
            43.749975,
            107.7
          ],
          [
            7.435213,
            43.750089,
            107.8
          ],
          [
            7.435213,
            43.750089,
            107.2
          ]
        ],
        "type": "LineString"
      }
    }
  ],
  "bbox": [
    7.434755,
    43.749975,
    107.24,
    7.435286,
    43.750878,
    108.48
  ],
  "metadata": {
    "attribution": "openrouteservice.org | OpenStreetMap contributors",
    "service": "routing",
    "timestamp": 1647619800778,
    "query": {
      "coordinates": [
        [
          7.434852,
          43.7508702
        ],
        [
          7.4352131,
          43.7500887
        ]
      ],
      "profile": "driving-car",
      "format": "geojson",
      "elevation": true,
      "extra_info": [
        "steepness"
      ]
    },
    "engine": {
      "version": "6.7.0",
      "build_date": "2022-02-18T19:37:41Z",
      "graph_date": "2022-02-21T14:34:17Z"
    }
  }
}

Hey,

No, you’re not missing something and this is not expected behaviour.
However, this is a known issue.
Thanks for adding another example :slight_smile:

Best regards

1 Like

Ah ok.
Thank you for your response.

Best

1 Like