How can I sort of geoPoint by distance?

Hello,

  1. Yes, you should recreate a new column.
  2. To return data in “closest to furthest” please use this query in request:
query.whereClause = "distanceOnSphere(location,'POINT(-96.77 32.79)')<=1000'";
query.addProperties( "distanceOnSphere(location,'POINT(-96.77 32.79)') as dist" );
query.setSortBy( "dist" );

Regards,
Olha

2 Likes