|
||||||||||
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.LambertConformal
public class LambertConformal
Implements the LambertConformalConic projection.
NOTE: This implementation only works for the northern hemisphere.
Needs to be modified for use in the southern hemisphere.
See http://www.epsg.org/guides/docs/G7-2.pdf
Field Summary | |
---|---|
static double |
EPS10
A small number 10^(-10) This number can be re-factored into MoreMath |
static java.lang.String |
LambertConformalName
The LambertCC name. |
protected java.awt.geom.Point2D |
plotablePoint
|
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 | |
---|---|
protected |
LambertConformal(LatLonPoint center,
float scale,
int width,
int height)
Construct a Lambert projection. |
|
LambertConformal(LatLonPoint center,
float scale,
int width,
int height,
double centralMeridian,
double sp_one,
double sp_two,
double reference_latitude,
double falseEasting,
double falseNorthing,
Ellipsoid ellps)
Constructor for the lambert conformal projection. |
protected |
LambertConformal(LatLonPoint center,
float scale,
int width,
int height,
float centralMeridian,
float sp_one,
float sp_two,
Ellipsoid ellps)
Constructor for the lambert conformal projection. |
Method Summary | ||
---|---|---|
protected double |
_forward(double lat,
double lon,
java.awt.geom.Point2D p,
boolean isRadian)
|
|
java.util.ArrayList<float[]> |
_forwardPoly(double[] rawllpts,
int ltype,
int nsegs,
boolean isFilled)
Forward project a lat/lon Poly. |
|
protected java.util.ArrayList<float[]> |
_forwardPoly(float[] rawllpts,
int ltype,
int nsegs,
boolean isFilled)
Forward project a lat/lon Poly. |
|
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 paint)
Draw the background for the projection. |
|
java.awt.geom.Point2D |
forward(double lat,
double lon,
java.awt.geom.Point2D p,
boolean isRadian)
Forward projects lat,lon into XY space and sets the results in the p provided. |
|
boolean |
forwardRaw(double[] rawllpts,
int rawoff,
float[] xcoords,
float[] ycoords,
boolean[] visible,
int copyoff,
int copylen)
Forward project a raw array of points. |
|
boolean |
forwardRaw(float[] rawllpts,
int rawoff,
float[] xcoords,
float[] 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. |
|
java.lang.String |
getName()
Get the name string of the projection. |
|
double |
getReferenceLon()
|
|
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 upper left (northwest) point of the projection. |
|
|
inverse(double x,
double y,
T llp)
Inverse project x,y coordinates into a LatLonPoint. |
|
boolean |
isPlotable(double lat,
double lon)
Determine if the location is plotable on the screen. |
|
boolean |
isPlotable(LatLonPoint llpoint)
Determine if the location is plotable |
|
static double |
lambMsfn(double sinphi,
double cosphi,
double e)
Special function m = cos(phi) / sqrt(1.0 - (e*sin(phi))**2) |
|
static double |
lambTsfn(double phi,
double sinphi,
double e)
Special function t = tan(PI/4-phi/2) / pow((1-sinphi)/(1+sinphi), .5*e) |
|
double |
LLToPixel(double lat,
double lon,
java.awt.geom.Point2D p)
|
|
java.awt.geom.Point2D |
LLToWorld(double lat,
double lon,
java.awt.geom.Point2D lp)
|
|
protected double |
LLToWorldReturningLon(double lat,
double lon,
java.awt.geom.Point2D lp)
LLToWorld that returns normalized longitude in radians, to be used for more calculations in some methods. |
|
static void |
main(java.lang.String[] argv)
test method |
|
double |
normalizeLatitude(double lat)
Sets radian latitude to something sane. |
|
java.awt.geom.Point2D |
pixelToLL(double xabs,
double yabs,
java.awt.geom.Point2D llp)
|
|
java.awt.geom.Point2D |
pixelToWorld(java.awt.Point p,
java.awt.geom.Point2D lp)
|
|
java.awt.geom.Point2D |
worldToLL(double x,
double y,
java.awt.geom.Point2D llp)
|
|
java.awt.Point |
worldToPixel(java.awt.geom.Point2D lp,
java.awt.Point p)
|
Methods inherited from class com.bbn.openmap.proj.Proj |
---|
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 LambertConformalName
public static final double EPS10
protected java.awt.geom.Point2D plotablePoint
Constructor Detail |
---|
protected LambertConformal(LatLonPoint center, float scale, int width, int height)
center
- LatLonPoint center of projectionscale
- float scale of projectionwidth
- width of screenheight
- height of screenprotected LambertConformal(LatLonPoint center, float scale, int width, int height, float centralMeridian, float sp_one, float sp_two, Ellipsoid ellps)
center
- center location for projectionsscale
- scale of projectionwidth
- width of projectionheight
- height of projectioncentralMeridian
- the Central Meridian in degrees.sp_one
- Standard Parallel One in degrees.sp_two
- Standard Parallel Two in degrees.public LambertConformal(LatLonPoint center, float scale, int width, int height, double centralMeridian, double sp_one, double sp_two, double reference_latitude, double falseEasting, double falseNorthing, Ellipsoid ellps)
center
- center location for projectionsscale
- scale of projectionwidth
- width of projectionheight
- height of projectioncentralMeridian
- the Central Meridian in degrees.sp_one
- Standard Parallel One in degrees.sp_two
- Standard Parallel Two in degrees.reference_latitude
- the latitude for the origin of the projectionfalseEasting
- number of meters added as buffer to origin E/W.falseNorthing
- number of meters added as buffer to origin for N/S.ellps
- the Ellipsoid
used for the projectionMethod Detail |
---|
public 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 Proj
public double normalizeLatitude(double lat)
normalizeLatitude
in class GeoProj
lat
- float latitude in radians
public java.awt.geom.Point2D LLToWorld(double lat, double lon, java.awt.geom.Point2D lp)
protected double LLToWorldReturningLon(double lat, double lon, java.awt.geom.Point2D lp)
lat
- latitude in degreeslon
- longitude in degrees.lp
- world coordinates are provided back in this object, make sure
it's not null if you care about them.
public double LLToPixel(double lat, double lon, java.awt.geom.Point2D p)
public java.awt.Point worldToPixel(java.awt.geom.Point2D lp, java.awt.Point p)
public java.awt.geom.Point2D pixelToWorld(java.awt.Point p, java.awt.geom.Point2D lp)
public java.awt.geom.Point2D worldToLL(double x, double y, java.awt.geom.Point2D llp)
public java.awt.geom.Point2D pixelToLL(double xabs, double yabs, java.awt.geom.Point2D llp)
public boolean isPlotable(double lat, double lon)
isPlotable
in interface Projection
isPlotable
in class Proj
lat
- latitude in degreeslon
- longitude in degrees
public boolean isPlotable(LatLonPoint llpoint)
llpoint
- location to check
public java.awt.geom.Point2D forward(double lat, double lon, java.awt.geom.Point2D p, boolean isRadian)
forward
in class GeoProj
lat
- latitudelon
- longitudep
- Resulting XY Point2DisRadian
- indicates that lat,lon arguments are in radians
protected double _forward(double lat, double lon, java.awt.geom.Point2D p, boolean isRadian)
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)
public LatLonPoint getUpperLeft()
Returns the upper left point (or closest equivalent) of the projection based on the center point and height and width of screen.
getUpperLeft
in interface Projection
getUpperLeft
in class Proj
public LatLonPoint getLowerRight()
Returns the lower right point (or closest equivalent) of the projection based on the center point and height and width of screen.
getLowerRight
in interface Projection
getLowerRight
in class Proj
public double getReferenceLon()
getReferenceLon
in class GeoProj
public java.lang.String getName()
getName
in interface Projection
getName
in class Proj
public boolean forwardRaw(float[] rawllpts, int rawoff, float[] xcoords, float[] ycoords, boolean[] visible, int copyoff, int copylen)
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 lat,lon,... in radiansrawoff
- 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 boolean forwardRaw(double[] 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).
protected java.util.ArrayList<float[]> _forwardPoly(float[] rawllpts, int ltype, int nsegs, boolean isFilled)
_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? this is currently ignored for cylindrical
projections.
public 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?
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 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.public void drawBackground(java.awt.Graphics2D g, java.awt.Paint paint)
drawBackground
in class Proj
g
- Graphics2Dpaint
- java.awt.Paint to use for the backgroundpublic void drawBackground(java.awt.Graphics g)
drawBackground
in class Proj
g
- Graphicspublic static double lambMsfn(double sinphi, double cosphi, double e)
sinphi
- doublecosphi
- doublee
- double
public static double lambTsfn(double phi, double sinphi, double e)
phi
- doublesinphi
- doublee
- double
public static void main(java.lang.String[] argv)
argv
- command line parameters
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |