Backendless Support
 
Solved

REST API PATCH GeoPoint not working correctly

Hi,

I'm trying to update existing GeoPoint.

After request

  1. 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

  1. 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:

  1. 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
  2. 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

Leave a Comment

Comments (3)

photo
1

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

photo
1

Hi, Matt.

Latitude of 100 is out of valid range for coordinates:

Longitude: [-180; 180]

Latitude: [-90; 90]

Here the sample REST request:

  1. curl \
  2. -H 'Host: api.backendless.com' \
  3. -H 'application-id : C667A849-B8F3-FCB4-FF3A-34F68CF58C00' \
  4. -H 'secret-key : 6B7D9CC1-1293-5F0D-FF3D-281A8FAAD700' \
  5. -H 'application-type : REST' \
  6. -X PATCH \
  7. -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.

photo
1

Thanks!

photo