|
||||||||||
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.DatumShiftProjection
public class DatumShiftProjection
This projection wraps another 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.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 | |
---|---|
DatumShiftProjection(GeoProj proj,
DatumShiftGCT datum)
|
Method Summary | |
---|---|
protected java.util.ArrayList<float[]> |
_forwardPoly(double[] rawllpts,
int ltype,
int nsegs,
boolean isFilled)
Forward project a lat/lon Poly. |
java.util.ArrayList<float[]> |
_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)
Draw the background for the projection. |
void |
drawBackground(java.awt.Graphics2D g,
java.awt.Paint p)
Draw the background for the projection. |
java.awt.geom.Point2D |
forward(double lat,
double lon,
java.awt.geom.Point2D pt,
boolean isRadian)
Project the point into view space. |
boolean |
forwardRaw(float[] rawllpts,
int rawoff,
float[] xcoords,
float[] ycoords,
boolean[] visible,
int copyoff,
int copylen)
Forward project a raw array of points. |
LatLonPoint |
getLowerRight()
Get the world coordinate of the lower right corner of the map. |
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. |
LatLonPoint |
getUpperLeft()
Get the world coordinate of the upper left corner of the map. |
LatLonPoint |
inverse(double x,
double y,
java.awt.geom.Point2D pt)
Inverse project x,y coordinates into world coordinates. |
boolean |
isPlotable(double lat,
double lon)
Checks if a location is plot-able. |
double |
normalizeLatitude(double lat)
|
void |
setCenter(double lat,
double lon)
Set center point of projection. |
Methods inherited from class com.bbn.openmap.proj.Proj |
---|
equals, forward, forward, forward, forwardLine, forwardPoly, forwardPoly, forwardRaw, forwardRect, forwardShape, getHeight, getMaxScale, getMinScale, getName, 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 |
Constructor Detail |
---|
public DatumShiftProjection(GeoProj proj, DatumShiftGCT datum)
Method Detail |
---|
public void setCenter(double lat, double lon)
GeoProj
setCenter
in class GeoProj
lat
- double latitude in decimal degreeslon
- double longitude in decimal degreespublic java.util.ArrayList<float[]> _forwardPoly(float[] rawllpts, int ltype, int nsegs, boolean isFilled)
GeoProj
_forwardPoly
in class GeoProj
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 java.util.ArrayList<float[]> _forwardPoly(double[] rawllpts, int ltype, int nsegs, boolean isFilled)
GeoProj
_forwardPoly
in class GeoProj
rawllpts
- double[] 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" parameters 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
- java.awt.Paint to use for the backgroundpublic void drawBackground(java.awt.Graphics g)
Proj
drawBackground
in class Proj
g
- Graphicspublic double normalizeLatitude(double lat)
normalizeLatitude
in class GeoProj
public java.awt.geom.Point2D forward(double lat, double lon, java.awt.geom.Point2D pt, boolean isRadian)
GeoProj
forward
in class GeoProj
lat
- latitudelon
- longitudept
- return pointisRadian
- true if lat/lon are radians instead of decimal degrees
public boolean forwardRaw(float[] rawllpts, int rawoff, float[] xcoords, float[] ycoords, boolean[] visible, int copyoff, int copylen)
Proj
It does populate a visible array indicating whether the points are visible on the projected view of the world.
forwardRaw
in interface Projection
forwardRaw
in class Proj
rawllpts
- array of y, x world coordinates.rawoff
- offset into rawllpts.xcoords
- x projected horizontal map coordinates.ycoords
- y projected vertical map coordinates.visible
- coordinates visible?copyoff
- offset into x,y visible arrays.copylen
- number of coordinates (coordinate arrays should be at
least this long, rawllpts should be at least twice as long).
public LatLonPoint getLowerRight()
Proj
getLowerRight
in interface Projection
getLowerRight
in class Proj
public LatLonPoint getUpperLeft()
Proj
getUpperLeft
in interface Projection
getUpperLeft
in class Proj
public LatLonPoint inverse(double x, double y, java.awt.geom.Point2D pt)
Projection
inverse
in interface Projection
inverse
in class Proj
x
- integer x coordinatey
- integer y coordinatept
- Point2D to be loaded with the result. A new Point2D object
will be created if this is null.
Proj.inverse(Point2D)
public boolean isPlotable(double lat, double lon)
Projection
Call this to check and see if a location can be plotted. This is meant to be used for checking before projecting and rendering Point2D objects (bitmaps or text objects tacked at a location, for instance).
isPlotable
in interface Projection
isPlotable
in class Proj
lat
- vertical location component (units depend on the projection
implementation).lon
- horizontal location component (units depend on the projection
implementation).
public float getScale(java.awt.geom.Point2D ll1, java.awt.geom.Point2D ll2, java.awt.geom.Point2D point1, java.awt.geom.Point2D point2)
GeoProj
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 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 |