public class DatumShiftProjection extends GeoProj
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.
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 |
---|
DatumShiftProjection(GeoProj proj,
DatumShiftGCT datum) |
Modifier and Type | Method and Description |
---|---|
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.
|
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, getPlanetPixelCircumference, getPlanetPixelRadius, getPlanetRadius, getPPM, getReferenceLon, getUcuom, init, inverse, inverse, isComplicatedLineType, isPlotable, normalize_latitude, normalizeLatitude, pan, setCenter, setCenter, setPlanetRadius, setPPM, setUcuom, toString, wrap_longitude, wrapLongitude, wrapLongitude, wrapLongitudeDeg
equals, forward, forward, forward, forwardLine, forwardPoly, forwardPoly, forwardRaw, forwardRect, forwardShape, getHeight, getMaxScale, getMinScale, getName, getProjectionID, getScale, getWidth, hashCode, inverse, isPlotable, makeClone, pan, panE, panE, panN, panN, panNE, panNE, panNW, panNW, panS, panS, panSE, panSE, panSW, panSW, panW, panW, setCenter, setHeight, setMaxScale, setMinScale, setParms, setProjectionID, setScale, setWidth
public DatumShiftProjection(GeoProj proj, DatumShiftGCT datum)
public void setCenter(double lat, double lon)
GeoProj
public 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
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).
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.Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details