Backendless Support
 
Solved

can't search by distance in geoPoint object

hello,

I try to search a users by a distance use the geoPoint column named "location".

my code is:

DateOfBirth before '07.15.1993' and DateOfBirth after '07.15.1936' and distance( 32,809029, 35,001259, location.latitude, location.longitude ) < km(83)

the search throw my to 'on foult' with the massage:

"Invalid where clause: Possible to use only number value or 'latitude' or 'longitude' in distance function"

are you now what is the problem? before with some code it work.. and now it throw this massage..

Leave a Comment

Comments (4)

photo
1

Hello,

You need to use points instead of commas here:

"32.809029, 35.001259"

Mark

photo
1

great, thanks.

I do before "%f, %f, location.lat, location.lon", latValue, lonValue

and it convert it with commas and no with points.

after your answer I do "%s, %s, location.lat,location.lon", String.valueOf(latValue),String.valueOf(lonValue)

and now it work.

thanks!

photo
1

now if you don't mind maybe you can help me with another problem:

I need to get a few result from many (it can by more than handred), and I need the most clause of theme..

the automatic sort sort it from the most fer to the clause, so if I start from offset 0 I get the far of theme.

and I need the lest of theme-the clauser. but I can't now the number of result for do:

set offset (size-pageSize).. so how I can get the most clause results?

photo
1

Please post a separate topic for each new question/problem. It helps us keep the support forum more organized.