Package ucar.unidata.geoloc
Class ProjectionImpl
- java.lang.Object
-
- ucar.unidata.geoloc.ProjectionImpl
-
- All Implemented Interfaces:
Serializable,Projection
- Direct Known Subclasses:
AlbersEqualArea,AlbersEqualAreaEllipse,CylindricalEqualAreaProjection,EquidistantAzimuthalProjection,FlatEarth,Geostationary,LambertAzimuthalEqualArea,LambertConformal,LambertConformalConicEllipse,LatLonProjection,Mercator,MSGnavigation,Orthographic,PolyconicProjection,ProjectionAdapter,RotatedLatLon,RotatedPole,Sinusoidal,Stereographic,StereographicAzimuthalProjection,TransverseMercator,TransverseMercatorProjection,UtmProjection,VerticalPerspectiveView
@Deprecated public abstract class ProjectionImpl extends Object implements Projection, Serializable
Deprecated.only use Projection interface in 6; will not implement Serializable in ver6Superclass for our implementations of geoloc.Projection.All subclasses must:
- override equals() and return true when all parameters are equal
- create "atts" list of parameters as string-valued Attribute pairs
- implement abstract methods
Note on "false_easting" and "fale_northing" projection parameters:
- false_easting(northing) = The value added to all x (y) values in the rectangular coordinates for a map projection. This value frequently is assigned to eliminate negative numbers. Expressed in the unit of measure identified in Planar Coordinate Units.
- We dont currently use, assuming that the x and y are just fine as negative numbers.
- See Also:
Projection, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected List<Parameter>attsDeprecated.list of attributesprotected ProjectionRectdefaultMapAreaDeprecated.default map areaprotected StringdefaultUnitsDeprecated.name of the default units for this projectionstatic doubleEARTH_RADIUSDeprecated.not public.static intINDEX_LATDeprecated.not public.static intINDEX_LONDeprecated.not public.static intINDEX_XDeprecated.not public.static intINDEX_YDeprecated.not public.protected booleanisLatLonDeprecated.flag for latlonprotected StringnameDeprecated.name of this projection.static doublePIDeprecated.use Math.PIstatic doublePI_OVER_2Deprecated.use Math.PI/2static doublePI_OVER_4Deprecated.use Math.PI/4protected static doubleTOLERANCEDeprecated.not public.
-
Constructor Summary
Constructors Modifier Constructor Description protectedProjectionImpl(String name, boolean isLatLon)Deprecated.protectedProjectionImpl(String name, String defaultUnits, boolean isLatLon)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidaddParameter(String name, double value)Deprecated.Add an attribute to this projectionprotected voidaddParameter(String name, String value)Deprecated.Add an attribute to this projectionprotected voidaddParameter(Parameter p)Deprecated.Add an attribute to this projectionabstract ProjectionImplconstructCopy()Deprecated.copy constructor - avoid clone !!abstract booleancrossSeam(ProjectionPoint pt1, ProjectionPoint pt2)Deprecated.Does the line between these two points cross the projection "seam".abstract booleanequals(Object proj)Deprecated.Returns true if this represents the same Projection as proj.ParameterfindProjectionParameter(String want)Deprecated.do not useStringgetClassName()Deprecated.Get the name of the type of the projection.ProjectionRectgetDefaultMapArea()Deprecated.Get a reasonable bounding box for this projection.LatLonRectgetDefaultMapAreaLL()Deprecated.Get the bounding box in lat/lon.StringgetDefaultUnits()Deprecated.Get the name of the default units for this projectionstatic StringgetHeader()Deprecated.Get a header for display.StringgetName()Deprecated.Get the name of this specific projection (also see getClassName)List<Parameter>getProjectionParameters()Deprecated.Get parameters as list of ucar.unidata.util.ParameterStringgetProjectionTypeLabel()Deprecated.Get the label to be used in the gui for this type of projection.booleanisLatLon()Deprecated.Is this the lat/lon Projection ?double[][]latLonToProj(double[][] from)Deprecated.use Projections.latLonToProj(Projection proj, ...)double[][]latLonToProj(double[][] from, double[][] to)Deprecated.use Projections.latLonToProj(Projection proj, ...)double[][]latLonToProj(double[][] from, double[][] to, int latIndex, int lonIndex)Deprecated.use Projections.latLonToProj(Projection proj, ...)double[][]latLonToProj(double[][] from, int latIndex, int lonIndex)Deprecated.use Projections.latLonToProj(Projection proj, ...)float[][]latLonToProj(float[][] from)Deprecated.use Projections.latLonToProj(Projection proj, ...)float[][]latLonToProj(float[][] from, float[][] to)Deprecated.use Projections.latLonToProj(Projection proj, ...)float[][]latLonToProj(float[][] from, float[][] to, int latIndex, int lonIndex)Deprecated.use Projections.latLonToProj(Projection proj, ...)float[][]latLonToProj(float[][] from, int latIndex, int lonIndex)Deprecated.use Projections.latLonToProj(Projection proj, ...)ProjectionPointlatLonToProj(LatLonPoint latLon)Deprecated.Convert a LatLonPoint to projection coordinates Note: a new object is now created on each call for the return value, as of 4.0.46abstract ProjectionPointlatLonToProj(LatLonPoint latlon, ProjectionPointImpl destPoint)Deprecated.use latLonToProj(LatLonPoint latLon)ProjectionRectlatLonToProjBB(LatLonRect latlonRect)Deprecated.Convert a lat/lon bounding box to a world coordinate bounding box, by finding the minimum enclosing box.abstract StringparamsToString()Deprecated.Get a string representation of the projection parametersdouble[][]projToLatLon(double[][] from)Deprecated.use Projections.latLonToProj(Projection proj, ...)double[][]projToLatLon(double[][] from, double[][] to)Deprecated.use Projections.latLonToProj(Projection proj, ...)float[][]projToLatLon(float[][] from)Deprecated.use Projections.latLonToProj(Projection proj, ...)float[][]projToLatLon(float[][] from, float[][] to)Deprecated.use Projections.latLonToProj(Projection proj, ...)LatLonPointprojToLatLon(ProjectionPoint ppt)Deprecated.Convert projection coordinates to a LatLonPoint Note: a new object is now created on each call for the return value, as of 4.0.46abstract LatLonPointprojToLatLon(ProjectionPoint ppt, LatLonPointImpl destPoint)Deprecated.use projToLatLon(ProjectionPoint ppt)LatLonRectprojToLatLonBB(ProjectionRect bb)Deprecated.Compute lat/lon bounding box from projection bounding box.LatLonRectprojToLatLonBBold(ProjectionRect world)Deprecated.do not usevoidsetDefaultMapArea(ProjectionRect bb)Deprecated.use buildervoidsetName(String name)Deprecated.use builderStringtoString()Deprecated.Get a String representation of this projection.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ucar.unidata.geoloc.Projection
latLonToProj, projToLatLon
-
-
-
-
Field Detail
-
EARTH_RADIUS
public static final double EARTH_RADIUS
Deprecated.not public.- See Also:
- Constant Field Values
-
INDEX_LAT
public static final int INDEX_LAT
Deprecated.not public.- See Also:
- Constant Field Values
-
INDEX_LON
public static final int INDEX_LON
Deprecated.not public.- See Also:
- Constant Field Values
-
INDEX_X
public static final int INDEX_X
Deprecated.not public.- See Also:
- Constant Field Values
-
INDEX_Y
public static final int INDEX_Y
Deprecated.not public.- See Also:
- Constant Field Values
-
TOLERANCE
protected static final double TOLERANCE
Deprecated.not public.- See Also:
- Constant Field Values
-
PI
public static final double PI
Deprecated.use Math.PI- See Also:
- Constant Field Values
-
PI_OVER_2
public static final double PI_OVER_2
Deprecated.use Math.PI/2- See Also:
- Constant Field Values
-
PI_OVER_4
public static final double PI_OVER_4
Deprecated.use Math.PI/4- See Also:
- Constant Field Values
-
name
protected String name
Deprecated.name of this projection.
-
defaultUnits
protected String defaultUnits
Deprecated.name of the default units for this projection
-
isLatLon
protected final boolean isLatLon
Deprecated.flag for latlon
-
defaultMapArea
protected ProjectionRect defaultMapArea
Deprecated.default map area
-
-
Method Detail
-
constructCopy
public abstract ProjectionImpl constructCopy()
Deprecated.copy constructor - avoid clone !!- Returns:
- a copy of this Projection. TODO return Projection in ver6
-
getClassName
public String getClassName()
Deprecated.Get the name of the type of the projection.- Specified by:
getClassNamein interfaceProjection- Returns:
- the class name
-
paramsToString
public abstract String paramsToString()
Deprecated.Get a string representation of the projection parameters- Specified by:
paramsToStringin interfaceProjection- Returns:
- string representation of the projection parameters
-
getProjectionTypeLabel
public String getProjectionTypeLabel()
Deprecated.Get the label to be used in the gui for this type of projection. This defaults to call getClassName- Returns:
- Type label
-
latLonToProj
@Deprecated public abstract ProjectionPoint latLonToProj(LatLonPoint latlon, ProjectionPointImpl destPoint)
Deprecated.use latLonToProj(LatLonPoint latLon)Convert a LatLonPoint to projection coordinates- Specified by:
latLonToProjin interfaceProjection- Parameters:
latlon- convert from these lat, lon coordinatesdestPoint- the object to write to- Returns:
- the given destPoint
-
latLonToProj
public ProjectionPoint latLonToProj(LatLonPoint latLon)
Deprecated.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- Specified by:
latLonToProjin interfaceProjection- Parameters:
latLon- convert from these lat, lon coordinates- Returns:
- ProjectionPoint convert to these projection coordinates
-
projToLatLon
@Deprecated public abstract LatLonPoint projToLatLon(ProjectionPoint ppt, LatLonPointImpl destPoint)
Deprecated.use projToLatLon(ProjectionPoint ppt)Convert projection coordinates to a LatLonPoint Note: a new object is not created on each call for the return value.- Specified by:
projToLatLonin interfaceProjection- Parameters:
ppt- convert from these projection coordinatesdestPoint- the object to write to- Returns:
- LatLonPoint convert to these lat/lon coordinates
-
projToLatLon
public LatLonPoint projToLatLon(ProjectionPoint ppt)
Deprecated.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- Specified by:
projToLatLonin interfaceProjection- Parameters:
ppt- convert from these projection coordinates- Returns:
- LatLonPoint convert to these lat/lon coordinates
-
crossSeam
public abstract boolean crossSeam(ProjectionPoint pt1, ProjectionPoint pt2)
Deprecated.Does the line between these two points cross the projection "seam".- Specified by:
crossSeamin interfaceProjection- Parameters:
pt1- the line goes between these two pointspt2- the line goes between these two points- Returns:
- false if there is no seam
-
equals
public abstract boolean equals(Object proj)
Deprecated.Returns true if this represents the same Projection as proj.- Specified by:
equalsin interfaceProjection- Overrides:
equalsin classObject- Parameters:
proj- projection in question- Returns:
- true if this represents the same Projection as proj.
-
getName
public String getName()
Deprecated.Get the name of this specific projection (also see getClassName)- Specified by:
getNamein interfaceProjection- Returns:
- name of the projection
-
setName
@Deprecated public void setName(String name)
Deprecated.use builder
-
getDefaultUnits
public String getDefaultUnits()
Deprecated.Get the name of the default units for this projection- Returns:
- the name of the default units
-
getProjectionParameters
public List<Parameter> getProjectionParameters()
Deprecated.Get parameters as list of ucar.unidata.util.Parameter- Specified by:
getProjectionParametersin interfaceProjection- Returns:
- List of parameters
-
findProjectionParameter
@Deprecated public Parameter findProjectionParameter(String want)
Deprecated.do not use
-
addParameter
protected void addParameter(String name, String value)
Deprecated.Add an attribute to this projection- Parameters:
name- name of the attributevalue- attribute value as a string
-
addParameter
protected void addParameter(String name, double value)
Deprecated.Add an attribute to this projection- Parameters:
name- name of the attributevalue- attribute value as a double
-
addParameter
protected void addParameter(Parameter p)
Deprecated.Add an attribute to this projection- Parameters:
p- specify as a Parameter
-
isLatLon
public boolean isLatLon()
Deprecated.Is this the lat/lon Projection ?- Specified by:
isLatLonin interfaceProjection- Returns:
- true if it is the lat/lon Projection
-
getHeader
public static String getHeader()
Deprecated.Get a header for display.- Returns:
- human readable header for display
-
toString
public String toString()
Deprecated.Get a String representation of this projection.
-
getDefaultMapArea
public ProjectionRect getDefaultMapArea()
Deprecated.Get a reasonable bounding box for this projection.- Specified by:
getDefaultMapAreain interfaceProjection- Returns:
- reasonable bounding box
-
getDefaultMapAreaLL
public LatLonRect getDefaultMapAreaLL()
Deprecated.Get the bounding box in lat/lon.- Returns:
- the LatLonRectangle for the bounding box
-
setDefaultMapArea
@Deprecated public void setDefaultMapArea(ProjectionRect bb)
Deprecated.use builderSet a reasonable bounding box for this specific projection. Projections are typically specific to an area of the world; theres no bounding box that works for all projections.- Parameters:
bb- bounding box
-
projToLatLon
@Deprecated public double[][] projToLatLon(double[][] from)
Deprecated.use Projections.latLonToProj(Projection proj, ...)Convert projection coordinates to lat/lon coordinates.- Parameters:
from- array of projection coordinates: from[2][n], where from[0][i], from[1][i] is the x, y coordinate of the ith point- Returns:
- resulting array of lat/lon coordinates, where to[0][i], to[1][i] is the lat,lon coordinate of the ith point
-
projToLatLon
@Deprecated public double[][] projToLatLon(double[][] from, double[][] to)
Deprecated.use Projections.latLonToProj(Projection proj, ...)Convert projection coordinates to lat/lon coordinate.- Parameters:
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- Returns:
- the "to" array
-
projToLatLon
@Deprecated public float[][] projToLatLon(float[][] from)
Deprecated.use Projections.latLonToProj(Projection proj, ...)Convert projection coordinates to lat/lon coordinates.- Parameters:
from- array of projection coordinates: from[2][n], where from[0][i], from[1][i] is the x, y coordinate of the ith point- Returns:
- resulting array of lat/lon coordinates, where to[0][i], to[1][i] is the lat,lon coordinate of the ith point
-
projToLatLon
@Deprecated public float[][] projToLatLon(float[][] from, float[][] to)
Deprecated.use Projections.latLonToProj(Projection proj, ...)Convert projection coordinates to lat/lon coordinate.- Parameters:
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- Returns:
- the "to" array
-
latLonToProj
@Deprecated public double[][] latLonToProj(double[][] from)
Deprecated.use Projections.latLonToProj(Projection proj, ...)Convert lat/lon coordinates to projection coordinates.- Parameters:
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- Returns:
- resulting array of projection coordinates, where to[0][i], to[1][i] is the (x,y) coordinate of the ith point
-
latLonToProj
@Deprecated public double[][] latLonToProj(double[][] from, double[][] to)
Deprecated.use Projections.latLonToProj(Projection proj, ...)Convert lat/lon coordinates to projection coordinates.- Parameters:
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- Returns:
- the "to" array
-
latLonToProj
@Deprecated public double[][] latLonToProj(double[][] from, int latIndex, int lonIndex)
Deprecated.use Projections.latLonToProj(Projection proj, ...)Convert lat/lon coordinates to projection coordinates.- Parameters:
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- Returns:
- resulting array of projection coordinates: to[2][n] where (to[0][i], to[1][i]) is the (x,y) coordinate of the ith point
-
latLonToProj
@Deprecated public double[][] latLonToProj(double[][] from, double[][] to, int latIndex, int lonIndex)
Deprecated.use Projections.latLonToProj(Projection proj, ...)Convert lat/lon coordinates to projection coordinates.- Parameters:
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- Returns:
- the "to" array
-
latLonToProj
@Deprecated public float[][] latLonToProj(float[][] from)
Deprecated.use Projections.latLonToProj(Projection proj, ...)Convert lat/lon coordinates to projection coordinates.- Parameters:
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- Returns:
- resulting array of projection coordinates, where to[0][i], to[1][i] is the (x,y) coordinate of the ith point
-
latLonToProj
@Deprecated public float[][] latLonToProj(float[][] from, float[][] to)
Deprecated.use Projections.latLonToProj(Projection proj, ...)Convert lat/lon coordinates to projection coordinates.- Parameters:
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- Returns:
- the "to" array
-
latLonToProj
@Deprecated public float[][] latLonToProj(float[][] from, int latIndex, int lonIndex)
Deprecated.use Projections.latLonToProj(Projection proj, ...)Convert lat/lon coordinates to projection coordinates.- Parameters:
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- Returns:
- resulting array of projection coordinates: to[2][n] where (to[0][i], to[1][i]) is the (x,y) coordinate of the ith point
-
latLonToProj
@Deprecated public float[][] latLonToProj(float[][] from, float[][] to, int latIndex, int lonIndex)
Deprecated.use Projections.latLonToProj(Projection proj, ...)Convert lat/lon coordinates to projection coordinates.- Parameters:
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- Returns:
- the "to" array
-
latLonToProjBB
public ProjectionRect latLonToProjBB(LatLonRect latlonRect)
Deprecated.Description copied from interface:ProjectionConvert a lat/lon bounding box to a world coordinate bounding box, by finding the minimum enclosing box. Handles lat/lon points that do not intersect the projection panel.- Specified by:
latLonToProjBBin interfaceProjection- Parameters:
latlonRect- input lat,lon bounding box- Returns:
- minimum enclosing box in world coordinates, or null if no part of the LatLonRect intersects the projection plane
-
projToLatLonBB
public LatLonRect projToLatLonBB(ProjectionRect bb)
Deprecated.Description copied from interface:ProjectionCompute lat/lon bounding box from projection bounding box.- Specified by:
projToLatLonBBin interfaceProjection- Parameters:
bb- projection bounding box- Returns:
- lat, lon bounding box.
-
projToLatLonBBold
@Deprecated public LatLonRect projToLatLonBBold(ProjectionRect world)
Deprecated.do not useConvert a world coordinate bounding box to a lat/lon bounding box, by finding the minimum enclosing box.- Parameters:
world- input world coordinate bounding box- Returns:
- minimum enclosing box in lat,lon coordinates.
-
-