public class AVGeoPoint extends Object
AVGeoPoint represents a latitude / longitude point that may be associated with a key in a AVObject or used as a reference point for geo queries. This allows proximity based queries on the key.
Only one key in a class may contain a GeoPoint.
Example:
AVGeoPoint point = new AVGeoPoint(30.0, -20.0);
AVObject object = new AVObject("PlaceObject");
object.put("location", point);
object.save();
| Constructor and Description |
|---|
AVGeoPoint()
Creates a new default point with latitude and longitude set to 0.0.
|
AVGeoPoint(double latitude,
double longitude)
Creates a new point with the specified latitude and longitude.
|
| Modifier and Type | Method and Description |
|---|---|
double |
distanceInKilometersTo(AVGeoPoint point)
Get distance between this point and another geopoint in kilometers.
|
double |
distanceInMilesTo(AVGeoPoint point)
Get distance between this point and another geopoint in miles.
|
double |
distanceInRadiansTo(AVGeoPoint point)
Get distance in radians between this point and another GeoPoint.
|
double |
getLatitude()
Get latitude.
|
double |
getLongitude()
Get longitude.
|
void |
setLatitude(double l)
Set latitude.
|
void |
setLongitude(double l)
Set longitude.
|
public AVGeoPoint()
public AVGeoPoint(double latitude,
double longitude)
latitude - The point's latitude.longitude - The point's longitude.public double distanceInKilometersTo(AVGeoPoint point)
point - GeoPoint describing the other point being measured against.public double distanceInMilesTo(AVGeoPoint point)
point - GeoPoint describing the other point being measured against.public double distanceInRadiansTo(AVGeoPoint point)
point - GeoPoint describing the other point being measured against.public double getLatitude()
public void setLatitude(double l)
l - The point's latitude.public double getLongitude()
public void setLongitude(double l)
l - The point's longitude.Copyright © 2017. All rights reserved.