Created
November 18, 2017 17:09
-
-
Save vgrem/325eb1ad0773958d007e419cfa1de628 to your computer and use it in GitHub Desktop.
A place on Earth, represented by a latitude/longitude pair.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.vgrem.geotools; | |
import java.util.Locale; | |
/** | |
* A place on Earth, represented by a latitude/longitude pair. | |
*/ | |
public class LatLng | |
{ | |
/** | |
* Constructs a location with a latitude/longitude pair. | |
* | |
* @param lat The latitude of this location. | |
* @param lng The longitude of this location. | |
*/ | |
public LatLng(double lat, double lng) { | |
this.lat = lat; | |
this.lng = lng; | |
} | |
@Override | |
public String toString() { | |
return String.format(Locale.ENGLISH, "%.8f,%.8f", lat, lng); | |
} | |
/** The latitude of this location. */ | |
public double lat; | |
/** The longitude of this location. */ | |
public double lng; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment