|
||||||||||
| 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.GeoProj
com.bbn.openmap.proj.AspectRatioProjection
public class AspectRatioProjection
A Projection that wraps another projection, but stretch the image to another aspect ratio.
The motivation for this projection is to support the following clause in wms 1.1.1.
OGC 01-068r3 (wms 1.1.1) 7.2.3.8. "In the case where the aspect ratio of the BBOX and the ratio width/height are different, the WMS shall stretch the returned map so that the resulting pixels could themselves be rendered in the aspect ratio of the BBOX"
| 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 | |
|---|---|
AspectRatioProjection(GeoProj proj,
int w,
int h)
Constructor that takes a projection and the new width/height. |
|
| Method Summary | |
|---|---|
protected 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. |
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)
Project the point into view space. |
java.awt.geom.Point2D |
forward(double lat,
double lon,
java.awt.geom.Point2D pt,
boolean isRadian)
Project the point into view space. |
java.awt.geom.Point2D |
forward(java.awt.geom.Point2D llp,
java.awt.geom.Point2D pt)
Forward project a point. |
boolean |
forwardRaw(float[] rawllpts,
int rawoff,
float[] xcoords,
float[] ycoords,
boolean[] visible,
int copyoff,
int copylen)
Forward project a raw array of points. |
java.awt.geom.Point2D |
getLowerRight()
Get the world coordinate of the lower right corner of the map. |
java.awt.geom.Point2D |
getUpperLeft()
Get the world coordinate of the upper left corner of the map. |
java.awt.geom.Point2D |
inverse(double x,
double y,
java.awt.geom.Point2D llpt)
Inverse project x,y coordinates into world coordinates. |
java.awt.geom.Point2D |
inverse(java.awt.geom.Point2D point,
java.awt.geom.Point2D llpt)
Inverse project a Point2D from map x/y space into world coordinates. |
boolean |
isPlotable(double lat,
double lon)
Checks if a location is plot-able. |
double |
normalizeLatitude(double lat)
|
| 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, 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 AspectRatioProjection(GeoProj proj,
int w,
int h)
proj - a projection to wrapw - a int with the new widthh - a int with the new height| Method Detail |
|---|
protected java.util.ArrayList<float[]> _forwardPoly(float[] rawllpts,
int ltype,
int nsegs,
boolean isFilled)
GeoProj
_forwardPoly in class GeoProjrawllpts - 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()
ProjEach 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 Projg - Graphics2Dp - java.awt.Paint to use for the backgroundpublic void drawBackground(java.awt.Graphics g)
Proj
drawBackground in class Projg - Graphicspublic double normalizeLatitude(double lat)
normalizeLatitude in class GeoProj
public java.awt.geom.Point2D forward(java.awt.geom.Point2D llp,
java.awt.geom.Point2D pt)
GeoProj
forward in interface Projectionforward in class GeoProjllp - LatLonPoint to be projectedpt - Resulting XY Point2D
public java.awt.geom.Point2D forward(double lat,
double lon,
java.awt.geom.Point2D pt)
GeoProj
forward in interface Projectionforward in class GeoProjlat - latitude in decimal degrees.lon - longitue in decimal degrees.pt - A Point2D object to load the result into, a new Point2D object
will be created if this is null.
public boolean forwardRaw(float[] rawllpts,
int rawoff,
float[] xcoords,
float[] ycoords,
boolean[] visible,
int copyoff,
int copylen)
ProjIt does populate a visible array indicating whether the points are visible on the projected view of the world.
forwardRaw in interface ProjectionforwardRaw in class Projrawllpts - 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 java.awt.geom.Point2D getLowerRight()
Proj
getLowerRight in interface ProjectiongetLowerRight in class Projpublic java.awt.geom.Point2D getUpperLeft()
Proj
getUpperLeft in interface ProjectiongetUpperLeft in class Proj
public java.awt.geom.Point2D inverse(java.awt.geom.Point2D point,
java.awt.geom.Point2D llpt)
Projection
inverse in interface Projectioninverse in class Projpoint - XY Point2Dllpt - resulting Point2D object to load the result into, a new
Point2D object will be created if this is null.
protected java.util.ArrayList<float[]> _forwardPoly(double[] rawllpts,
int ltype,
int nsegs,
boolean isFilled)
GeoProj
_forwardPoly in class GeoProjrawllpts - 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 java.awt.geom.Point2D forward(double lat,
double lon,
java.awt.geom.Point2D pt,
boolean isRadian)
GeoProj
forward in class GeoProjlat - latitudelon - longitudept - return pointisRadian - true if lat/lon are radians instead of decimal degrees
public java.awt.geom.Point2D inverse(double x,
double y,
java.awt.geom.Point2D llpt)
Projection
inverse in interface Projectioninverse in class Projx - integer x coordinatey - integer y coordinatellpt - 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)
ProjectionCall 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 ProjectionisPlotable in class Projlat - vertical location component (units depend on the projection
implementation).lon - horizontal location component (units depend on the projection
implementation).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||