I want to search a table that has a Point Column. I want results within x miles radius from my searching position.
I saw the example below, but GeoPoint is deprecated. And I don’t understand what “coordinates.latitude,coordinates.longitude” represents
String whereClause = "distance( 30.26715, -97.74306, " +
“coordinates.latitude, coordinates.longitude ) < mi(200)”;
DataQueryBuilder queryBuilder = DataQueryBuilder.create();
queryBuilder.setWhereClause( whereClause ).setRelationsDepth( 1 );
List friends = Backendless.Data.of( “Friend” ).find( queryBuilder );
String format = “%s lives at %f, %f tagged as ‘%s’”;
for( Map friend : friends )
{
GeoPoint coordinates = (GeoPoint) friend.get( “coordinates” );
Log.i( “MYAPP”, String.format( format, friend.get( “name” ),
coordinates.getLatitude(),
coordinates.getLongitude(),
(String) coordinates.getMetadata( “description” ) ) );
}