public class CADRG extends Cylindrical implements EqualArc
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CADRGName
The CADRG name.
|
static double |
epsilon |
half_world, world
DATELINE, mercator, NORTH_POLE, NUM_DEFAULT_CIRCLE_VERTS, NUM_DEFAULT_GREAT_SEGS, pixelsPerMeter, planetPixelCircumference, planetPixelRadius, planetRadius, scaled_radius, SOUTH_POLE, XSCALE_THRESHOLD, XTHRESHOLD
Constructor and Description |
---|
CADRG(LatLonPoint center,
float scale,
int width,
int height)
Construct a CADRG projection.
|
Modifier and Type | Method and Description |
---|---|
protected void |
computeParameters()
Called when some fundamental parameters change.
|
static CADRG |
convertProjection(Projection proj) |
java.awt.geom.Point2D |
forward(double lat,
double lon,
java.awt.geom.Point2D ret_val,
boolean isRadians)
Forward projects lat,lon into XY space and returns a Point2D.
|
double |
getLowerZoneExtent(int zone)
Returns the lower zone extent for the given zone at the current scale.
|
java.lang.String |
getName()
Get the name string of the projection.
|
double |
getPlanetPixelCircumference()
Get the planet pixel circumference.
|
static int |
getProjZone(char asciiZone)
Given a letter for a zone, return the CADRG zone equivalent,
|
float |
getScale(java.awt.geom.Point2D ll1,
java.awt.geom.Point2D ll2,
java.awt.geom.Point2D point1,
java.awt.geom.Point2D point2)
Given a couple of points representing a bounding box, find out what the
scale should be in order to make those points appear at the corners of
the projection.
|
double |
getUpperZoneExtent(int zone)
Returns the upper zone extent for the given zone at the current scale.
|
double |
getXPixConstant()
Returns the x pixel constant of the projection.
|
double |
getYPixConstant()
Returns the y pixel constant of the projection.
|
int |
getZone()
Returns the current zone of the projection.
|
protected int |
getZone(double lat,
double y_pix_constant)
Returns the zone based on the y_pix_constant and a latitude.
|
<T extends java.awt.geom.Point2D> |
inverse(double x,
double y,
T ret_val)
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.
|
int |
numHorizontalFrames()
Return the number of horizontal frame files that will fit around the
world in the current zone.
|
int |
numVerticalFrames()
Return the number of vertical frame files that will fit within the
current zone, overlaps included.
|
java.lang.String |
toString()
Return stringified description of this projection.
|
_forwardPoly, _forwardPoly, dumpPoly, dumpPoly, forwardRaw, forwardRaw, getLowerRight, getUpperLeft, init, pan
assertLatLonPoint, clone, doPolyDispatch, doPolyDispatch, forward, forward, forward, forward, forwardArc, forwardArc, forwardArc, forwardCircle, forwardCircle, forwardCircle, forwardGreatPoly, forwardGreatPoly, forwardLine, forwardLine, forwardLLPoly, forwardPoly, forwardPoly, forwardRect, forwardRect, forwardRect, forwardRhumbPoly, forwardRhumbPoly, getCenter, getCenter, getGCTForProjection, getPlanetPixelRadius, getPlanetRadius, getPPM, getReferenceLon, getUcuom, inverse, inverse, isComplicatedLineType, isPlotable, normalize_latitude, normalizeLatitude, pan, setCenter, setCenter, setCenter, setPlanetRadius, setPPM, setUcuom, wrap_longitude, wrapLongitude, wrapLongitude, wrapLongitudeDeg
drawBackground, drawBackground, equals, forward, forward, forward, forwardLine, forwardPoly, forwardPoly, forwardRect, forwardShape, getHeight, getMaxScale, getMinScale, getProjectionID, getScale, getWidth, hashCode, inverse, isPlotable, makeClone, panE, panE, panN, panN, panNE, panNE, panNW, panNW, panS, panS, panSE, panSE, panSW, panSW, panW, panW, setCenter, setHeight, setMaxScale, setMinScale, setParms, setProjectionID, setScale, setWidth
finalize, getClass, notify, notifyAll, wait, wait, wait
forward, forward, forward, forward, forward, forward, forwardLine, forwardPoly, forwardPoly, forwardRaw, forwardRaw, forwardRect, forwardShape, getCenter, getCenter, getHeight, getLowerRight, getMaxScale, getMinScale, getProjectionID, getScale, getUcuom, getUpperLeft, getWidth, inverse, inverse, inverse, isPlotable, isPlotable, makeClone, pan, pan
public static final transient java.lang.String CADRGName
public static final transient double epsilon
public CADRG(LatLonPoint center, float scale, int width, int height)
center
- LatLonPoint center of projectionscale
- float scale of projectionwidth
- width of screenheight
- height of screenpublic double normalizeLatitude(double lat)
normalizeLatitude
in class GeoProj
lat
- float latitude in radianspublic java.lang.String toString()
toString
in class Cylindrical
Projection.getProjectionID()
public int getZone()
public static int getProjZone(char asciiZone)
public double getPlanetPixelCircumference()
getPlanetPixelCircumference
in class GeoProj
protected int getZone(double lat, double y_pix_constant)
HACK: latitude in decimal degrees DO THE CONSTANTS DEPEND ON THIS?!!
lat
- latitudey_pix_constant
- pixel constantpublic double getXPixConstant()
getXPixConstant
in interface EqualArc
public double getYPixConstant()
getYPixConstant
in interface EqualArc
public double getUpperZoneExtent(int zone)
public double getLowerZoneExtent(int zone)
public int numHorizontalFrames()
public int numVerticalFrames()
public boolean isPlotable(double lat, double lon)
A point is plot-able in the CADRG projection if it is within the North and South zone limits.
isPlotable
in interface Projection
lat
- float latitude in decimal degreeslon
- float longitude in decimal degreespublic java.awt.geom.Point2D forward(double lat, double lon, java.awt.geom.Point2D ret_val, boolean isRadians)
public <T extends java.awt.geom.Point2D> T inverse(double x, double y, T ret_val)
inverse
in interface Projection
inverse
in class Proj
x
- integer x coordinatey
- integer y coordinateret_val
- LatLonPointProj.inverse(Point2D)
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 java.lang.String getName()
getName
in interface Projection
getName
in class Cylindrical
public float getScale(java.awt.geom.Point2D ll1, java.awt.geom.Point2D ll2, java.awt.geom.Point2D point1, java.awt.geom.Point2D point2)
getScale
in interface Projection
getScale
in class GeoProj
ll1
- the upper left coordinates of the bounding box.ll2
- the lower right coordinates of the bounding box.point1
- a Point2D reflecting a pixel spot on the projection that
matches the ll1 coordinate, the upper left corner of the area of
interest.point2
- a Point2D reflecting a pixel spot on the projection that
matches the ll2 coordinate, usually the lower right corner of the
area of interest.public static CADRG convertProjection(Projection proj)
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details