REST API PATCH GeoPoint not working correctly

Hi,

I’m trying to update existing GeoPoint.

After request









curl -H "Host: api.backendless.com" -H "application-id: CCD7530E-CD7B-3B6E-FF2E-B153FE232B00" -H "application-type: REST" -H "secret-key: <secret_key>" -X PATCH -v https://api.backendless.com/v1/geo/points/90868CC5-2030-FF0F-FF10-C66E18C12B00?lat=10&lon=30

only latitude gets updated.

After request

curl -H "Host: api.backendless.com" -H "application-id: CCD7530E-CD7B-3B6E-FF2E-B153FE232B00" -H "application-type: REST" -H "secret-key: <secret_key>" -X PATCH -v https://api.backendless.com/v1/geo/points/90868CC5-2030-FF0F-FF10-C66E18C12B00?lon=30&lat=10

only longitude gets updated.

Am I doing something wrong?

What’s more:

    The first requests returns error {"code":4002,"message":"Unable to search/add geo points. Invalid coordinates."} when for example lat in the url is 100 The same requests but PUT instead of PATCH always returns error

    {“code”:4002,“message”:“Unable to search/add geo points. Invalid coordinates.”}

I'm trying to create similar requests as provided in the documentation https://backendless.com/documentation/geo/rest/geo_updating_a_geo_point.htm

How to properly update GeoPoints?

Best,
Matt

Hi Matt,

I was able to reproduce the problem, it looks like a bug. A ticket was assigned to a developer.

Internal ticket number is BKNDLSS-12586

Regards,
Mark

Hi, Matt.

Latitude of 100 is out of valid range for coordinates:
Longitude: [-180; 180]
Latitude: [-90; 90]

Here the sample REST request:

curl \
-H 'Host: api.backendless.com' \
-H 'application-id : C667A849-B8F3-FCB4-FF3A-34F68CF58C00' \
-H 'secret-key : 6B7D9CC1-1293-5F0D-FF3D-281A8FAAD700' \
-H 'application-type : REST' \
-X PATCH \
-v 'https://api.backendless.com/v1/geo/points/0058FA4B-B04A-054C-FF50-8F0E5F872C00?lat=70&lon=70'

It updates both latitude and longitude values. You can try to wrap the url in double quotes if you get only the first field updated.

Thanks!