|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bbn.openmap.proj.Proj
com.bbn.openmap.proj.DatumShiftProjection
public class DatumShiftProjection
This projection wraps an other projection and adds datum handling. The motivation for this projection is to be able to serve wms clients requesting maps in a datum different from wgs84.
The underlying data is supposed to be wgs4. The given DatumShiftGCT
convert this to another datum before using the wrapped projection to
calculate the screen coordinates.
LatLonPoint
as input or output of any of the methods in this class is
in wgs84. Internally, each method will convert datums as needed.
A user (like wms) of this projection will use a
CoordinateReferenceSystem
to convert coordinates to wgs84 before
using this method.
Field Summary |
---|
Fields inherited from class com.bbn.openmap.proj.Proj |
---|
ctrLat, ctrLon, DATELINE, height, maxscale, mercator, MIN_HEIGHT, MIN_WIDTH, minscale, NORTH_POLE, NUM_DEFAULT_CIRCLE_VERTS, NUM_DEFAULT_GREAT_SEGS, pixelsPerMeter, planetPixelCircumference, planetPixelRadius, planetRadius, projID, scale, scaled_radius, SOUTH_POLE, type, width, XSCALE_THRESHOLD, XTHRESHOLD |
Constructor Summary | |
---|---|
DatumShiftProjection(Proj proj,
DatumShiftGCT datum)
|
Method Summary | |
---|---|
protected java.util.ArrayList |
_forwardPoly(float[] rawllpts,
int ltype,
int nsegs,
boolean isFilled)
Forward project a lat/lon Poly. |
protected void |
computeParameters()
Called when some fundamental parameters change. |
void |
drawBackground(java.awt.Graphics g)
Assume that the Graphics has been set with the Paint/Color needed, just render the shape of the background. |
void |
drawBackground(java.awt.Graphics2D g,
java.awt.Paint p)
Draw the background for the projection. |
java.awt.Point |
forward(float lat,
float lon,
java.awt.Point pt)
Forward projects lat,lon coordinates into XY space and returns a Point. |
java.awt.Point |
forward(float lat,
float lon,
java.awt.Point pt,
boolean isRadian)
Forward projects lat,lon coordinates into XY space and returns a Point. |
java.awt.Point |
forward(LatLonPoint llp,
java.awt.Point pt)
Forward projects a LatLonPoint into XY space and return a Point. |
boolean |
forwardRaw(float[] rawllpts,
int rawoff,
int[] xcoords,
int[] ycoords,
boolean[] visible,
int copyoff,
int copylen)
Forward project a raw array of radian points. |
LatLonPoint |
getLowerRight()
Get the lower right (southeast) point of the projection. |
float |
getScale(LatLonPoint ll1,
LatLonPoint ll2,
java.awt.Point point1,
java.awt.Point 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. |
LatLonPoint |
getUpperLeft()
Get the upper left (northwest) point of the projection. |
LatLonPoint |
inverse(int x,
int y,
LatLonPoint llpt)
Inverse project x,y coordinates into a LatLonPoint. |
LatLonPoint |
inverse(java.awt.Point point,
LatLonPoint llpt)
Inverse project a point with llpt. |
boolean |
isPlotable(float lat,
float lon)
Checks if a LatLonPoint is plot-able. |
float |
normalize_latitude(float lat)
Sets radian latitude to something sane. |
void |
setCenter(float lat,
float lon)
Set center point of projection. |
Methods inherited from class com.bbn.openmap.proj.Proj |
---|
clone, doPolyDispatch, equals, forward, forward, forwardArc, forwardArc, forwardArc, forwardCircle, forwardCircle, forwardCircle, forwardGreatPoly, forwardLine, forwardLine, forwardPoly, forwardPoly, forwardRaster, forwardRect, forwardRect, forwardRect, forwardRhumbPoly, getCenter, getHeight, getMaxScale, getMinScale, getName, getPlanetPixelCircumference, getPlanetPixelRadius, getPlanetRadius, getPPM, getProjectionID, getProjectionType, getScale, getWidth, hashCode, init, inverse, inverse, isComplicatedLineType, isPlotable, makeClone, pan, pan, panE, panE, panN, panN, panNE, panNE, panNW, panNW, panS, panS, panSE, panSE, panSW, panSW, panW, panW, setCenter, setHeight, setMaxScale, setMinScale, setParms, setPlanetRadius, setPPM, setProjectionID, setScale, setWidth, toString, wrap_longitude |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DatumShiftProjection(Proj proj, DatumShiftGCT datum)
Method Detail |
---|
public void setCenter(float lat, float lon)
Proj
setCenter
in class Proj
lat
- float latitude in decimal degreeslon
- float longitude in decimal degreesprotected java.util.ArrayList _forwardPoly(float[] rawllpts, int ltype, int nsegs, boolean isFilled)
Proj
_forwardPoly
in class Proj
rawllpts
- float[] of lat,lon,lat,lon,... in RADIANS!ltype
- line type (straight, rhumbline, greatcircle)nsegs
- number of segment points (only for greatcircle or rhumbline
line types, and if < 1, this value is generated internally)isFilled
- filled poly?
protected void computeParameters()
Proj
Each projection will decide how to respond to this change. For instance, they may need to recalculate "constant" paramters used in the forward() and inverse() calls.
computeParameters
in class Proj
public void drawBackground(java.awt.Graphics2D g, java.awt.Paint p)
Proj
drawBackground
in class Proj
g
- Graphics2Dp
- Paint to use for the backgroundpublic void drawBackground(java.awt.Graphics g)
Proj
drawBackground
in class Proj
public float normalize_latitude(float lat)
Proj
Normalizes the latitude according to the particular projection.
normalize_latitude
in class Proj
lat
- float latitude in radians
ProjMath.normalize_latitude(float, float)
,
LatLonPoint.normalize_latitude(float)
public java.awt.Point forward(LatLonPoint llp, java.awt.Point pt)
Projection
llp
- LatLonPoint to be projectedpt
- Resulting XY Point
public java.awt.Point forward(float lat, float lon, java.awt.Point pt)
Projection
lat
- float latitude in decimal degreeslon
- float longitude in decimal degreespt
- Resulting XY Point
public java.awt.Point forward(float lat, float lon, java.awt.Point pt, boolean isRadian)
Projection
lat
- float latitude in radianslon
- float longitude in radianspt
- Resulting XY PointisRadian
- placeholder argument indicating that lat,lon
arguments are in radians (can be true or false)
Projection.forward(float,float,Point)
public boolean forwardRaw(float[] rawllpts, int rawoff, int[] xcoords, int[] ycoords, boolean[] visible, int copyoff, int copylen)
Projection
It does populate a visible array indicating whether the points are visible on the projected view of the world.
rawllpts
- array of lat,lon,... in RADIANS!rawoff
- offset into rawllptsxcoords
- x coordinatesycoords
- y coordinatesvisible
- coordinates visible?copyoff
- offset into x,y,visible arrayscopylen
- number of coordinates (coordinate arrays should
be at least this long, rawllpts should be at least twice
as long).
public LatLonPoint getLowerRight()
Projection
Returns the lower right point (or closest equivalent) of the projection based on the center point and height and width of screen.
This is trivial for most cylindrical projections, but much more complicated for azimuthal projections.
public LatLonPoint getUpperLeft()
Projection
Returns the upper left point (or closest equivalent) of the projection based on the center point and height and width of screen.
This is trivial for most cylindrical projections, but much more complicated for azimuthal projections.
public LatLonPoint inverse(java.awt.Point point, LatLonPoint llpt)
Projection
point
- x,y Pointllpt
- resulting LatLonPoint
public LatLonPoint inverse(int x, int y, LatLonPoint llpt)
Projection
x
- integer x coordinatey
- integer y coordinatellpt
- LatLonPoint
Proj.inverse(Point)
public boolean isPlotable(float lat, float lon)
Projection
Call this to check and see if a LatLonPoint can be plotted. This is meant to be used for checking before projecting and rendering Point objects (bitmaps or text objects tacked at a LatLonPoint for instance).
lat
- float latitude in decimal degreeslon
- float longitude in decimal degrees
public float getScale(LatLonPoint ll1, LatLonPoint ll2, java.awt.Point point1, java.awt.Point point2)
Proj
getScale
in interface Projection
getScale
in class Proj
ll1
- the upper left coordinates of the bounding box.ll2
- the lower right coordinates of the bounding box.point1
- a java.awt.Point reflecting a pixel spot on the projection
that matches the ll1 coordinate, the upper left corner of the area
of interest.point2
- a java.awt.Point reflecting a pixel spot on the projection
that matches the ll2 coordinate, usually the lower right corner of
the area of interest.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |