|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.proj.Proj com.bbn.openmap.proj.GeoProj com.bbn.openmap.proj.Cylindrical com.bbn.openmap.proj.Mercator
public class Mercator
Implements the Mercator projection.
Field Summary | |
---|---|
protected double |
asinh_of_tanCtrLat
|
protected static double |
epsilon
|
protected double |
hy
|
protected static int |
MAX_RHUMB_SEGS
|
static java.lang.String |
MercatorName
The Mercator name. |
protected double |
tanCtrLat
|
protected double |
wx
|
Fields inherited from class com.bbn.openmap.proj.Cylindrical |
---|
half_world, world |
Fields inherited from class com.bbn.openmap.proj.GeoProj |
---|
DATELINE, mercator, NORTH_POLE, NUM_DEFAULT_CIRCLE_VERTS, NUM_DEFAULT_GREAT_SEGS, pixelsPerMeter, planetPixelCircumference, planetPixelRadius, planetRadius, scaled_radius, SOUTH_POLE, XSCALE_THRESHOLD, XTHRESHOLD |
Fields inherited from class com.bbn.openmap.proj.Proj |
---|
centerX, centerY, height, maxscale, MIN_HEIGHT, MIN_WIDTH, minscale, projID, rotationAngle, scale, ucuom, width |
Constructor Summary | |
---|---|
Mercator(LatLonPoint center,
float scale,
int width,
int height)
Construct a Mercator projection. |
Method Summary | ||
---|---|---|
protected void |
computeParameters()
Called when some fundamental parameters change. |
|
java.awt.geom.Point2D |
forward(double lat,
double lon,
java.awt.geom.Point2D p,
boolean isRadian)
Forward projects lat,lon into XY space and returns a Point2D. |
|
java.lang.String |
getName()
Get the name string of the projection. |
|
|
inverse(double x,
double y,
T llp)
Inverse project x,y coordinates into a LatLonPoint. |
|
boolean |
isPlotable(double lat,
double lon)
Checks if a LatLonPoint is plot-able. |
|
double |
normalizeLatitude(double lat)
Sets radian latitude to something sane. |
|
protected float[] |
rhumbProject(java.awt.geom.Point2D from,
java.awt.geom.Point2D to,
boolean include_last,
int nsegs)
Calculates the points along a rhumbline between two XY points. |
|
protected double[] |
rhumbProjectDouble(java.awt.geom.Point2D from,
java.awt.geom.Point2D to,
boolean include_last,
int nsegs)
Calculates the points along a rhumbline between two XY points. |
|
protected static int |
rhumbStep(java.awt.geom.Point2D pt1,
java.awt.geom.Point2D pt2)
Computes the best stepping factor for a rhumbline. |
|
java.lang.String |
toString()
Return stringified description of this projection. |
Methods inherited from class com.bbn.openmap.proj.Cylindrical |
---|
_forwardPoly, _forwardPoly, dumpPoly, dumpPoly, forwardRaw, forwardRaw, getLowerRight, getUpperLeft, init |
Methods inherited from class com.bbn.openmap.proj.Proj |
---|
drawBackground, drawBackground, equals, forward, forward, forward, forwardLine, forwardPoly, forwardPoly, forwardRect, forwardShape, getHeight, getMaxScale, getMinScale, getProjectionID, getRotationAngle, getScale, getWidth, hashCode, inverse, inverseShape, makeClone, panE, panE, panN, panN, panNE, panNE, panNW, panNW, panS, panS, panSE, panSE, panSW, panSW, panW, panW, setCenter, setHeight, setMaxScale, setMinScale, setParms, setProjectionID, setRotationAngle, setScale, setWidth |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final transient java.lang.String MercatorName
protected static final int MAX_RHUMB_SEGS
protected static double epsilon
protected transient double hy
protected transient double wx
protected transient double tanCtrLat
protected transient double asinh_of_tanCtrLat
Constructor Detail |
---|
public Mercator(LatLonPoint center, float scale, int width, int height)
center
- LatLonPoint center of projectionscale
- float scale of projectionwidth
- width of screenheight
- height of screenMethod Detail |
---|
public java.lang.String toString()
toString
in class Cylindrical
Projection.getProjectionID()
protected void computeParameters()
Each projection will decide how to respond to this change. For instance, they may need to recalculate "constant" parameters used in the forward() and inverse() calls.
computeParameters
in class Cylindrical
public double normalizeLatitude(double lat)
normalizeLatitude
in class GeoProj
lat
- float latitude in radians
public boolean isPlotable(double lat, double lon)
A point is always plot-able in the Mercator projection (even the North and South poles since we normalize latitude).
isPlotable
in interface Projection
isPlotable
in class Proj
lat
- double latitude in decimal degreeslon
- double longitude in decimal degrees
public java.awt.geom.Point2D forward(double lat, double lon, java.awt.geom.Point2D p, boolean isRadian)
forward
in class GeoProj
lat
- double latitude in radianslon
- double longitude in radiansp
- Resulting XY Point2DisRadian
- bogus argument indicating that lat,lon arguments are in
radians
public <T extends java.awt.geom.Point2D> T inverse(double x, double y, T llp)
inverse
in interface Projection
inverse
in class Proj
x
- integer x coordinatey
- integer y coordinatellp
- LatLonPoint
Proj.inverse(Point2D)
protected static final int rhumbStep(java.awt.geom.Point2D pt1, java.awt.geom.Point2D pt2)
Computes the best stepping factor between two x,y points in order to interpolate points on a rhumb line. (We calculate rhumb lines by forward projecting the line in the Mercator projection, and then calculating segments along the straight line between them.)
pt1
- Point2Dpt2
- Point2D
protected float[] rhumbProject(java.awt.geom.Point2D from, java.awt.geom.Point2D to, boolean include_last, int nsegs)
Loxodromes are straight in the Mercator projection. Calculate a bunch of extra points between the two points, inverse project back into LatLons and return all the vertices.
from
- Point2Dto
- Point2Dinclude_last
- include the very last point?nsegs
- number of segments
protected double[] rhumbProjectDouble(java.awt.geom.Point2D from, java.awt.geom.Point2D to, boolean include_last, int nsegs)
Loxodromes are straight in the Mercator projection. Calculate a bunch of extra points between the two points, inverse project back into LatLons and return all the vertices.
from
- Point2Dto
- Point2Dinclude_last
- include the very last point?nsegs
- number of segments
public java.lang.String getName()
getName
in interface Projection
getName
in class Cylindrical
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |