|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.geoloc.ProjectionImpl
public abstract class ProjectionImpl
Superclass for our implementations of geoloc.Projection.
All subclasses must:
Note on "false_easting" and "fale_northing" projection parameters:
Projection,
Serialized Form| Field Summary | |
|---|---|
static java.lang.String |
ATTR_NAME
Projection Name |
protected java.util.List<Parameter> |
atts
list of attributes |
protected ProjectionRect |
defaultMapArea
default map area |
static double |
EARTH_RADIUS
Earth radius in kilometers |
static int |
INDEX_LAT
Latitude index |
static int |
INDEX_LON
Longitude index |
static int |
INDEX_X
X index |
static int |
INDEX_Y
Y index |
protected boolean |
isLatLon
flag for latlon |
protected java.lang.String |
name
name of this projection |
static double |
PI
PI |
static double |
PI_OVER_2
PI/2 |
static double |
PI_OVER_4
PI/4 |
protected static double |
TOLERANCE
tolerence for checks |
| Constructor Summary | |
|---|---|
ProjectionImpl()
|
|
| Method Summary | |
|---|---|
protected void |
addParameter(Parameter p)
Add an attribute to this projection |
protected void |
addParameter(java.lang.String name,
double value)
Add an attribute to this projection |
protected void |
addParameter(java.lang.String name,
java.lang.String value)
Add an attribute to this projection |
java.lang.Object |
clone()
Clone this projection |
abstract ProjectionImpl |
constructCopy()
copy constructor - avoid clone !! |
abstract boolean |
crossSeam(ProjectionPoint pt1,
ProjectionPoint pt2)
Does the line between these two points cross the projection "seam". |
abstract boolean |
equals(java.lang.Object proj)
Returns true if this represents the same Projection as proj. |
java.lang.String |
getClassName()
Get the name of the type of the projection. |
ProjectionRect |
getDefaultMapArea()
Get a reasonable bounding box for this projection. |
LatLonRect |
getDefaultMapAreaLL()
Get the bounding box in lat/lon. |
static java.lang.String |
getHeader()
Get a header for display. |
LatLonRect |
getLatLonBoundingBox(ProjectionRect bb)
From GridCoordSys. |
java.lang.String |
getName()
Get the name of this specific projection (also see getClassName) |
java.util.List<Parameter> |
getProjectionParameters()
Get parameters as list of ucar.unidata.util.Parameter |
java.lang.String |
getProjectionTypeLabel()
Get the label to be used in the gui for this type of projection. |
boolean |
isLatLon()
Is this the lat/lon Projection ? |
double[][] |
latLonToProj(double[][] from)
Convert lat/lon coordinates to projection coordinates. |
double[][] |
latLonToProj(double[][] from,
double[][] to)
Convert lat/lon coordinates to projection coordinates. |
double[][] |
latLonToProj(double[][] from,
double[][] to,
int latIndex,
int lonIndex)
Convert lat/lon coordinates to projection coordinates. |
double[][] |
latLonToProj(double[][] from,
int latIndex,
int lonIndex)
Convert lat/lon coordinates to projection coordinates. |
ProjectionPointImpl |
latLonToProj(double lat,
double lon)
Convert a LatLonPoint to projection coordinates Note: a new object is now created on each call for the return value, as of 4.0.46 |
float[][] |
latLonToProj(float[][] from)
Convert lat/lon coordinates to projection coordinates. |
float[][] |
latLonToProj(float[][] from,
float[][] to)
Convert lat/lon coordinates to projection coordinates. |
float[][] |
latLonToProj(float[][] from,
float[][] to,
int latIndex,
int lonIndex)
Convert lat/lon coordinates to projection coordinates. |
float[][] |
latLonToProj(float[][] from,
int latIndex,
int lonIndex)
Convert lat/lon coordinates to projection coordinates. |
ProjectionPoint |
latLonToProj(LatLonPoint latLon)
Convert a LatLonPoint to projection coordinates Note: a new object is now created on each call for the return value, as of 4.0.46 |
abstract ProjectionPoint |
latLonToProj(LatLonPoint latlon,
ProjectionPointImpl destPoint)
Convert a LatLonPoint to projection coordinates |
ProjectionRect |
latLonToProjBB(LatLonRect latlonRect)
Convert a lat/lon bounding box to a world coordinate bounding box, by finding the minimum enclosing box. |
abstract java.lang.String |
paramsToString()
Get a string representation of the projection parameters |
double[][] |
projToLatLon(double[][] from)
Convert projection coordinates to lat/lon coordinates. |
double[][] |
projToLatLon(double[][] from,
double[][] to)
Convert projection coordinates to lat/lon coordinate. |
LatLonPointImpl |
projToLatLon(double x,
double y)
Convert a projection coordinate to a LatLonPoint Note: a new object is now created on each call for the return value, as of 4.0.46 |
float[][] |
projToLatLon(float[][] from)
Convert projection coordinates to lat/lon coordinates. |
float[][] |
projToLatLon(float[][] from,
float[][] to)
Convert projection coordinates to lat/lon coordinate. |
LatLonPoint |
projToLatLon(ProjectionPoint ppt)
Convert projection coordinates to a LatLonPoint Note: a new object is now created on each call for the return value, as of 4.0.46 |
abstract LatLonPoint |
projToLatLon(ProjectionPoint ppt,
LatLonPointImpl destPoint)
Convert projection coordinates to a LatLonPoint Note: a new object is not created on each call for the return value. |
LatLonRect |
projToLatLonBB(ProjectionRect world)
Convert a world coordinate bounding box to a lat/lon bounding box, by finding the minimum enclosing box. |
void |
setDefaultMapArea(ProjectionRect bb)
Set a reasonable bounding box for this specific projection. |
void |
setName(java.lang.String name)
Set the name of this specific projection. |
java.lang.String |
toString()
Get a String representation of this projection. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ATTR_NAME
public static final double EARTH_RADIUS
public static final int INDEX_LAT
public static final int INDEX_LON
public static final int INDEX_X
public static final int INDEX_Y
protected static final double TOLERANCE
public static final double PI
public static final double PI_OVER_2
public static final double PI_OVER_4
protected java.lang.String name
protected boolean isLatLon
protected java.util.List<Parameter> atts
protected ProjectionRect defaultMapArea
| Constructor Detail |
|---|
public ProjectionImpl()
| Method Detail |
|---|
public abstract ProjectionImpl constructCopy()
public java.lang.String getClassName()
getClassName in interface Projectionpublic abstract java.lang.String paramsToString()
paramsToString in interface Projectionpublic java.lang.String getProjectionTypeLabel()
public abstract ProjectionPoint latLonToProj(LatLonPoint latlon,
ProjectionPointImpl destPoint)
latLonToProj in interface Projectionlatlon - convert from these lat, lon coordinatesdestPoint - the object to write to
public abstract LatLonPoint projToLatLon(ProjectionPoint ppt,
LatLonPointImpl destPoint)
projToLatLon in interface Projectionppt - convert from these projection coordinatesdestPoint - the object to write to
public ProjectionPoint latLonToProj(LatLonPoint latLon)
latLon - convert from these lat, lon coordinates
public LatLonPoint projToLatLon(ProjectionPoint ppt)
ppt - convert from these projection coordinates
public abstract boolean crossSeam(ProjectionPoint pt1,
ProjectionPoint pt2)
crossSeam in interface Projectionpt1 - the line goes between these two pointspt2 - the line goes between these two points
public abstract boolean equals(java.lang.Object proj)
equals in interface Projectionequals in class java.lang.Objectproj - projection in question
public java.lang.String getName()
getName in interface Projectionpublic void setName(java.lang.String name)
name - name for this projectionpublic java.util.List<Parameter> getProjectionParameters()
getProjectionParameters in interface Projection
protected void addParameter(java.lang.String name,
java.lang.String value)
name - name of the attributevalue - attribute value as a string
protected void addParameter(java.lang.String name,
double value)
name - name of the attributevalue - attribute value as a doubleprotected void addParameter(Parameter p)
p - specify as a Parameterpublic boolean isLatLon()
public static java.lang.String getHeader()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.Object clone()
clone in class java.lang.Objectpublic ProjectionRect getDefaultMapArea()
getDefaultMapArea in interface Projectionpublic LatLonRect getDefaultMapAreaLL()
public void setDefaultMapArea(ProjectionRect bb)
bb - bounding box
public ProjectionPointImpl latLonToProj(double lat,
double lon)
lat - latitude of point to convertlon - longitude of point to convert
public LatLonPointImpl projToLatLon(double x,
double y)
x - x value to converty - y value to convert
public double[][] projToLatLon(double[][] from)
from - array of projection coordinates: from[2][n],
where from[0][i], from[1][i] is the x, y coordinate
of the ith point
public double[][] projToLatLon(double[][] from,
double[][] to)
from - array of projection coordinates: from[2][n], where
(from[0][i], from[1][i]) is the (x, y) coordinate
of the ith pointto - resulting array of lat/lon coordinates: to[2][n] where
(to[0][i], to[1][i]) is the (lat, lon) coordinate of
the ith point
public float[][] projToLatLon(float[][] from)
from - array of projection coordinates: from[2][n],
where from[0][i], from[1][i] is the x, y coordinate
of the ith point
public float[][] projToLatLon(float[][] from,
float[][] to)
from - array of projection coordinates: from[2][n], where
(from[0][i], from[1][i]) is the (x, y) coordinate
of the ith pointto - resulting array of lat/lon coordinates: to[2][n] where
(to[0][i], to[1][i]) is the (lat, lon) coordinate of
the ith point
public double[][] latLonToProj(double[][] from)
from - array of lat/lon coordinates: from[2][n],
where from[0][i], from[1][i] is the (lat,lon)
coordinate of the ith point
public double[][] latLonToProj(double[][] from,
double[][] to)
from - array of lat/lon coordinates: from[2][n], where
(from[0][i], from[1][i]) is the (lat,lon) coordinate
of the ith pointto - resulting array of projection coordinates: to[2][n]
where (to[0][i], to[1][i]) is the (x,y) coordinate
of the ith point
public double[][] latLonToProj(double[][] from,
int latIndex,
int lonIndex)
from - array of lat/lon coordinates: from[2][n], where
(from[latIndex][i], from[lonIndex][i]) is the (lat,lon)
coordinate of the ith pointlatIndex - index of lat coordinate; must be 0 or 1lonIndex - index of lon coordinate; must be 0 or 1
public double[][] latLonToProj(double[][] from,
double[][] to,
int latIndex,
int lonIndex)
from - array of lat/lon coordinates: from[2][n], where
(from[latIndex][i], from[lonIndex][i]) is the (lat,lon)
coordinate of the ith pointto - resulting array of projection coordinates: to[2][n]
where (to[0][i], to[1][i]) is the (x,y) coordinate of
the ith pointlatIndex - index of lat coordinate; must be 0 or 1lonIndex - index of lon coordinate; must be 0 or 1
public float[][] latLonToProj(float[][] from)
from - array of lat/lon coordinates: from[2][n],
where from[0][i], from[1][i] is the (lat,lon)
coordinate of the ith point
public float[][] latLonToProj(float[][] from,
float[][] to)
from - array of lat/lon coordinates: from[2][n], where
(from[0][i], from[1][i]) is the (lat,lon) coordinate
of the ith pointto - resulting array of projection coordinates: to[2][n]
where (to[0][i], to[1][i]) is the (x,y) coordinate
of the ith point
public float[][] latLonToProj(float[][] from,
int latIndex,
int lonIndex)
from - array of lat/lon coordinates: from[2][n], where
(from[latIndex][i], from[lonIndex][i]) is the (lat,lon)
coordinate of the ith pointlatIndex - index of lat coordinate; must be 0 or 1lonIndex - index of lon coordinate; must be 0 or 1
public float[][] latLonToProj(float[][] from,
float[][] to,
int latIndex,
int lonIndex)
from - array of lat/lon coordinates: from[2][n], where
(from[latIndex][i], from[lonIndex][i]) is the (lat,lon)
coordinate of the ith pointto - resulting array of projection coordinates: to[2][n]
where (to[0][i], to[1][i]) is the (x,y) coordinate of
the ith pointlatIndex - index of lat coordinate; must be 0 or 1lonIndex - index of lon coordinate; must be 0 or 1
public ProjectionRect latLonToProjBB(LatLonRect latlonRect)
latlonRect - input lat,lon bounding box
public LatLonRect projToLatLonBB(ProjectionRect world)
world - input world coordinate bounding box
public LatLonRect getLatLonBoundingBox(ProjectionRect bb)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||