public class WorldCoordinate
A latitude/longitude pair.
Constructor and Description |
---|
WorldCoordinate(double latitude,
double longitude)
A latitude/longitude pair.
|
Modifier and Type | Method and Description |
---|---|
double |
component1() |
double |
component2() |
WorldCoordinate |
copy(double latitude,
double longitude)
A latitude/longitude pair.
|
boolean |
equals(java.lang.Object p) |
double |
getLatitude() |
double |
getLongitude() |
int |
hashCode() |
kotlin.Pair<java.lang.Double,java.lang.Double> |
project(double screenWidth,
double screenHeight,
double topLatitude,
double bottomLatitude,
double leftLongitude,
double rightLongitude)
Convert to screen coordinates using the Mercator projection. You should have a world map image that
you know the precise extents of for this function to work.
|
java.lang.String |
toString() |
public WorldCoordinate(double latitude, double longitude)
A latitude/longitude pair.
public kotlin.Pair<java.lang.Double,java.lang.Double> project(double screenWidth, double screenHeight, double topLatitude, double bottomLatitude, double leftLongitude, double rightLongitude)
Convert to screen coordinates using the Mercator projection. You should have a world map image that you know the precise extents of for this function to work.
Note that no world map ever has latitude extents of -90 to 90 because at these extremes the mapping tends to infinity. Google Maps, for example, uses a square map image, and square maps yield latitude extents of 85.0511 to -85.0511 = arctan(sinh(π)).
public double getLatitude()
public double getLongitude()
public double component1()
public double component2()
public WorldCoordinate copy(double latitude, double longitude)
A latitude/longitude pair.
public java.lang.String toString()
public int hashCode()
public boolean equals(java.lang.Object p)