Skip to content

Instantly share code, notes, and snippets.

@galex
Created October 18, 2010 07:59
Show Gist options
  • Save galex/631894 to your computer and use it in GitHub Desktop.
Save galex/631894 to your computer and use it in GitHub Desktop.
geographical point
package be.agherschon.moveinbxl.maps;
/**
* Represents a geographical point.
* As it is used with Google Maps, it has two more getters, which returns the values in x^E6.
* @author Alexandre Gherschon
*/
public class Point {
private double latitude ;
private double longitude;
public Point(double latitude, double longitude) {
super();
this.latitude = latitude;
this.longitude = longitude;
}
public void setLongitude(double longitude) {
this.longitude = longitude;
}
public double getLongitude() {
return longitude;
}
public void setLatitude(double latitude) {
this.latitude = latitude;
}
public double getLatitude() {
return latitude;
}
/**
* Google Maps API likes to get the latitude in x^E6
* @return latitude^E6
*/
public double getLatitudeE6() {
return (latitude * 1000000) ;
}
/**
* Google Maps API likes to get the longitude in x^E6
* @return longitude^E6
*/
public double getLongitudeE6() {
return (longitude * 1000000) ;
}
public String toString(){
return this.getLatitude() + " , " + this.getLongitude();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment