Skip to content

Instantly share code, notes, and snippets.

@vgrem
Created November 18, 2017 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vgrem/325eb1ad0773958d007e419cfa1de628 to your computer and use it in GitHub Desktop.
Save vgrem/325eb1ad0773958d007e419cfa1de628 to your computer and use it in GitHub Desktop.
A place on Earth, represented by a latitude/longitude pair.
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