DEM.Net icon indicating copy to clipboard operation
DEM.Net copied to clipboard

Bad Request if all points have same latitude or longitude values at elevation request

Open Brakebein opened this issue 6 months ago • 1 comments

Describe the bug I am using the API to request the elevation of multiple points (https://api.elevationapi.com/api/elevation/points). In certain cases where the set of points all feature either the same latitude or the same longitude, the request returns 400 Bad Request with "Invalid coordinates, check if lat/long are not inverted".

To Reproduce POST request to https://api.elevationapi.com/api/elevation/points with JSON body:

{
    "points": {
        "type": "MultiPoint",
        "coordinates": [
            [13.618584, 51.084439],
            [13.618584, 51.084450],
            [13.618584, 51.084460]
        ]
    },
    "dataSetName": "FABDEM"
}

Notice that all longitude values are the same.

Expected behavior No Bad Request, but getting the points enhanced with the elevation.

Additional context As soon some additional point is added that breaks the row of same latitude/longitude values, it works fine.

{
    "points": {
        "type": "MultiPoint",
        "coordinates": [
            [13.618584, 51.084439],
            [13.618584, 51.084450],
            [13.618584, 51.084460],
            [13.610859, 51.098051]
        ]
    },
    "dataSetName": "FABDEM"
}

You also get 400 Bad Request, if only one point is defined.

{
    "points": {
        "type": "MultiPoint",
        "coordinates": [
            [13.618584, 51.084439]
        ]
    },
    "dataSetName": "FABDEM"
}

Brakebein avatar Jul 15 '25 16:07 Brakebein

Hi @Brakebein thanks for reporting this. Will have a look, this is a bug. Thanks for providing test data

xfischer avatar Jul 15 '25 16:07 xfischer