|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jhlabs.map.proj.Projection
public abstract class Projection
The superclass for all map projections Changes by Bernhard Jenny 18 May 2010: Added Serializable interface, added abstract keyword, added binarySearchInverse, added transform and inverseTransform with lon/lat as doubles. 25 October 2010: Made all setters and getters dealing with degrees final and calling the versions using radians. Derived classes now only need to overwrite a single getter or setter (if overwriting is at all necessary).
Field Summary | |
---|---|
protected double |
a
The equator radius |
protected static double |
DTR
|
protected double |
e
The eccentricity |
protected Ellipsoid |
ellipsoid
The ellipsoid used by this projection |
protected static double |
EPS10
|
protected double |
es
The eccentricity squared |
protected double |
falseEasting
The false Easting of this projection |
protected double |
falseNorthing
The false Northing of this projection |
protected double |
fromMetres
Conversion factor from metres to whatever units the projection uses. |
protected boolean |
geocentric
True if this projection is geocentric |
protected double |
maxLatitude
The maximum latitude of the bounds of this projection |
protected double |
maxLongitude
The maximum longitude of the bounds of this projection. |
protected double |
minLatitude
The minimum latitude of the bounds of this projection |
protected double |
minLongitude
The minimum longitude of the bounds of this projection. |
protected String |
name
The name of this projection |
protected double |
one_es
1-(eccentricity squared) |
protected double |
projectionLatitude
The latitude of the centre of projection |
protected double |
projectionLongitude
The longitude of the centre of projection |
protected double |
rone_es
1/(1-(eccentricity squared)) |
protected static double |
RTD
|
protected double |
scaleFactor
The projection scale factor |
protected boolean |
spherical
True if this projection is using a sphere (es == 0) |
protected double |
trueScaleLatitude
The latitude of true scale. |
Constructor Summary | |
---|---|
protected |
Projection()
|
Method Summary | |
---|---|
protected void |
binarySearchInverse(double x,
double y,
double lon,
double lat,
Point2D.Double lp)
Compute the inverse projection by a binary search. |
protected void |
binarySearchInverse(double x,
double y,
Point2D.Double lp)
Compute the inverse projection by a binary search. |
Object |
clone()
|
Ellipsoid |
getEllipsoid()
|
int |
getEPSGCode()
Returns the ESPG code for this projection, or 0 if unknown. |
double |
getEquatorRadius()
|
double |
getFalseEasting()
|
double |
getFalseNorthing()
|
double |
getFromMetres()
|
double |
getMaxLatitude()
|
double |
getMaxLatitudeDegrees()
|
double |
getMaxLongitude()
|
double |
getMaxLongitudeDegrees()
|
double |
getMinLatitude()
|
double |
getMinLatitudeDegrees()
|
double |
getMinLongitude()
|
double |
getMinLongitudeDegrees()
|
String |
getName()
|
String |
getPROJ4Description()
Get a string which describes this projection in PROJ.4 format. |
String |
getProjectionDescription()
Returns a human readable description of this projection in telegram style. |
double |
getProjectionLatitude()
|
double |
getProjectionLatitudeDegrees()
|
double |
getProjectionLongitude()
|
double |
getProjectionLongitudeDegrees()
|
double |
getScaleFactor()
|
double |
getTrueScaleLatitude()
|
double |
getTrueScaleLatitudeDegrees()
|
boolean |
hasInverse()
Returns true if this projection has an inverse |
void |
initialize()
Initialize the projection. |
boolean |
inside(double lon,
double lat)
Returns true if the given lat/lon point is visible in this projection. |
void |
inverseTransform(double[] srcPoints,
int srcOffset,
double[] dstPoints,
int dstOffset,
int numPoints)
Inverse-project a number of points (in metres), producing a lat/long result in degrees |
Point2D.Double |
inverseTransform(Point2D.Double src,
Point2D.Double dst)
Inverse-project a point (in metres), producing a lat/long result in degrees |
Rectangle2D |
inverseTransform(Rectangle2D r)
Finds the smallest lat/long rectangle wholly inside the given view rectangle. |
void |
inverseTransformRadians(double[] srcPoints,
int srcOffset,
double[] dstPoints,
int dstOffset,
int numPoints)
Inverse-project a number of points (in metres), producing a lat/long result in radians |
void |
inverseTransformRadians(double srcX,
double srcY,
Point2D.Double dst)
Inverse-project a point (in meters), producing a lat/long result in radians. |
Point2D.Double |
inverseTransformRadians(Point2D.Double src,
Point2D.Double dst)
Inverse-project a point (in metres), producing a lat/long result in radians |
boolean |
isConformal()
Returns true if this projection is conformal |
boolean |
isEqualArea()
Returns true if this projection is equal area |
boolean |
isRectilinear()
Returns true if lat/long lines form a rectangular grid for this projection. |
static void |
main(String[] args)
|
boolean |
parallelsAreParallel()
Returns true if latitude lines are parallel for this projection |
Point2D.Double |
project(double x,
double y,
Point2D.Double dst)
The method which actually does the projection. |
Point2D.Double |
projectInverse(double x,
double y,
Point2D.Double dst)
The method which actually does the inverse projection. |
void |
setEllipsoid(Ellipsoid ellipsoid)
|
void |
setFalseEasting(double falseEasting)
Set the false Easting in projected units. |
void |
setFalseNorthing(double falseNorthing)
Set the false Northing in projected units. |
void |
setFromMetres(double fromMetres)
Set the conversion factor from metres to projected units. |
void |
setMaxLatitude(double maxLatitude)
Set the maximum latitude. |
void |
setMaxLongitude(double maxLongitude)
|
void |
setMaxLongitudeDegrees(double maxLongitude)
|
void |
setMinLatitude(double minLatitude)
Set the minimum latitude. |
void |
setMinLongitude(double minLongitude)
|
void |
setMinLongitudeDegrees(double minLongitude)
|
void |
setName(String name)
Set the name of this projection. |
void |
setProjectionLatitude(double projectionLatitude)
Set the projection latitude in radians. |
void |
setProjectionLatitudeDegrees(double projectionLatitude)
Set the projection latitude in degrees. |
void |
setProjectionLongitude(double projectionLongitude)
Set the projection longitude in radians. |
void |
setProjectionLongitudeDegrees(double projectionLongitude)
Set the projection longitude in degrees. |
void |
setScaleFactor(double scaleFactor)
Set the projection scale factor. |
void |
setTrueScaleLatitude(double trueScaleLatitude)
Set the latitude of true scale in radians. |
void |
setTrueScaleLatitudeDegrees(double trueScaleLatitude)
Set the latitude of true scale in degrees. |
void |
testBinarySearchInverse()
|
String |
toString()
|
void |
transform(double[] srcPoints,
int srcOffset,
double[] dstPoints,
int dstOffset,
int numPoints)
Project a number of lat/long points (in degrees), producing a result in metres |
Point2D.Double |
transform(double lon,
double lat,
Point2D.Double dst)
Project a lon/lat point (in degrees), producing a result in metres. |
Point2D.Double |
transform(Point2D.Double src,
Point2D.Double dst)
Project a lat/long point (in degrees), producing a result in metres |
Rectangle2D |
transform(Rectangle2D r)
Transform a bounding box. |
void |
transformRadians(double[] srcPoints,
int srcOffset,
double[] dstPoints,
int dstOffset,
int numPoints)
Project a number of lat/long points (in radians), producing a result in metres |
Point2D.Double |
transformRadians(double lon,
double lat,
Point2D.Double dst)
Project a lon/lat point (in degrees), producing a result in metres. |
Point2D.Double |
transformRadians(Point2D.Double src,
Point2D.Double dst)
Project a lat/long point, producing a result in metres |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected double minLatitude
protected double minLongitude
protected double maxLatitude
protected double maxLongitude
protected double projectionLatitude
protected double projectionLongitude
protected double scaleFactor
protected double falseEasting
protected double falseNorthing
protected double trueScaleLatitude
protected double a
protected double e
protected double es
protected double one_es
protected double rone_es
protected Ellipsoid ellipsoid
protected boolean spherical
protected boolean geocentric
protected String name
protected double fromMetres
protected static final double EPS10
protected static final double RTD
protected static final double DTR
Constructor Detail |
---|
protected Projection()
Method Detail |
---|
public Object clone()
clone
in class Object
public Point2D.Double transform(Point2D.Double src, Point2D.Double dst)
public final Point2D.Double transform(double lon, double lat, Point2D.Double dst)
public Point2D.Double transformRadians(Point2D.Double src, Point2D.Double dst)
public final Point2D.Double transformRadians(double lon, double lat, Point2D.Double dst)
public Point2D.Double project(double x, double y, Point2D.Double dst)
x
- Longitude in radians.y
- Latitude in radians.dst
- The projected point.
public void transform(double[] srcPoints, int srcOffset, double[] dstPoints, int dstOffset, int numPoints)
public void transformRadians(double[] srcPoints, int srcOffset, double[] dstPoints, int dstOffset, int numPoints)
public Point2D.Double inverseTransform(Point2D.Double src, Point2D.Double dst)
public Point2D.Double inverseTransformRadians(Point2D.Double src, Point2D.Double dst)
public void inverseTransformRadians(double srcX, double srcY, Point2D.Double dst)
public Point2D.Double projectInverse(double x, double y, Point2D.Double dst)
public void inverseTransform(double[] srcPoints, int srcOffset, double[] dstPoints, int dstOffset, int numPoints)
public void inverseTransformRadians(double[] srcPoints, int srcOffset, double[] dstPoints, int dstOffset, int numPoints)
public Rectangle2D inverseTransform(Rectangle2D r)
public static void main(String[] args)
public void testBinarySearchInverse()
protected void binarySearchInverse(double x, double y, Point2D.Double lp)
x
- The projected x coordinate relative to the unary sphere.y
- The projected y coordinate relative to the unary sphere.lp
- A point that will receive the result.protected void binarySearchInverse(double x, double y, double lon, double lat, Point2D.Double lp)
x
- The projected x coordinate relative to the unary sphere.y
- The projected y coordinate relative to the unary sphere.lon
- An approximation of the longitude in radians.lat
- An approximation of the latitude in radians.lp
- A point that will receive the result.public Rectangle2D transform(Rectangle2D r)
public boolean isConformal()
public boolean isEqualArea()
public boolean hasInverse()
public boolean isRectilinear()
public boolean parallelsAreParallel()
public boolean inside(double lon, double lat)
x
- longitude in degrees.y
- latitude in degrees.
public void setName(String name)
public String getName()
public String getProjectionDescription()
public String getPROJ4Description()
public String toString()
toString
in class Object
public void setMinLatitude(double minLatitude)
public double getMinLatitude()
public void setMaxLatitude(double maxLatitude)
public double getMaxLatitude()
public final double getMaxLatitudeDegrees()
public final double getMinLatitudeDegrees()
public void setMinLongitude(double minLongitude)
public double getMinLongitude()
public final void setMinLongitudeDegrees(double minLongitude)
public final double getMinLongitudeDegrees()
public void setMaxLongitude(double maxLongitude)
public double getMaxLongitude()
public final void setMaxLongitudeDegrees(double maxLongitude)
public final double getMaxLongitudeDegrees()
public void setProjectionLatitude(double projectionLatitude)
public double getProjectionLatitude()
public final void setProjectionLatitudeDegrees(double projectionLatitude)
public final double getProjectionLatitudeDegrees()
public void setProjectionLongitude(double projectionLongitude)
public double getProjectionLongitude()
public final void setProjectionLongitudeDegrees(double projectionLongitude)
public double getProjectionLongitudeDegrees()
public void setTrueScaleLatitude(double trueScaleLatitude)
public double getTrueScaleLatitude()
public final void setTrueScaleLatitudeDegrees(double trueScaleLatitude)
public final double getTrueScaleLatitudeDegrees()
public void setFalseNorthing(double falseNorthing)
public double getFalseNorthing()
public void setFalseEasting(double falseEasting)
public double getFalseEasting()
public void setScaleFactor(double scaleFactor)
public double getScaleFactor()
public double getEquatorRadius()
public void setFromMetres(double fromMetres)
public double getFromMetres()
public void setEllipsoid(Ellipsoid ellipsoid)
public Ellipsoid getEllipsoid()
public int getEPSGCode()
public void initialize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |