|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.me.parabola.imgfmt.app.Coord
public class Coord
A point coordinate in unshifted map-units. A map unit is 360/2^24 degrees. In some places shifted coordinates are used, which means that they are divided by some power of two to save space in the file. You can create one of these with lat/long by calling the constructor with double args. This is an immutable class.
Constructor Summary | |
---|---|
Coord(double latitude,
double longitude)
Construct from regular latitude and longitude. |
|
Coord(int latitude,
int longitude)
Construct from co-ordinates that are already in map-units. |
Method Summary | |
---|---|
double |
bearingTo(Coord point)
|
int |
compareTo(Coord other)
Sort lexicographically by longitude, then latitude. |
double |
distance(Coord other)
Distance to other point in meters. |
double |
distanceInDegreesSquared(Coord other)
|
boolean |
equals(java.lang.Object obj)
|
int |
getHighwayCount()
|
long |
getId()
|
int |
getLatitude()
|
int |
getLongitude()
|
boolean |
getOnBoundary()
|
int |
hashCode()
|
void |
incHighwayCount()
|
Coord |
makeBetweenPoint(Coord other,
double fraction)
|
boolean |
preserved()
|
void |
preserved(boolean preserved)
|
double |
quickDistance(Coord other)
|
void |
setOnBoundary(boolean onBoundary)
|
protected double |
slowDistance(Coord other)
|
java.lang.String |
toDegreeString()
|
java.lang.String |
toOSMURL()
|
protected java.lang.String |
toOSMURL(int zoom)
|
java.lang.String |
toString()
Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Coord(int latitude, int longitude)
latitude
- The latitude in map units.longitude
- The longitude in map units.public Coord(double latitude, double longitude)
latitude
- The latitude in degrees.longitude
- The longitude in degrees.Method Detail |
---|
public int getLatitude()
public int getLongitude()
public long getId()
public int getHighwayCount()
public void incHighwayCount()
public boolean getOnBoundary()
public void setOnBoundary(boolean onBoundary)
public boolean preserved()
public void preserved(boolean preserved)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public double distance(Coord other)
protected double slowDistance(Coord other)
public double quickDistance(Coord other)
public double distanceInDegreesSquared(Coord other)
public Coord makeBetweenPoint(Coord other, double fraction)
public double bearingTo(Coord point)
public int compareTo(Coord other)
compareTo
in interface java.lang.Comparable<Coord>
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toDegreeString()
protected java.lang.String toOSMURL(int zoom)
public java.lang.String toOSMURL()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |