visad.georef
Class MapProjection
- java.lang.Object
-
- visad.CoordinateSystem
-
- visad.georef.NavigatedCoordinateSystem
-
- visad.georef.MapProjection
-
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- AREACoordinateSystem, EASECoordinateSystem, GRIBCoordinateSystem, GRIDCoordinateSystem, HRITCoordinateSystem, LongitudeLatitudeInterpCS, TrivialMapProjection, Vis5DCoordinateSystem
public abstract class MapProjection extends NavigatedCoordinateSystem
Abstract class for coordinate systems that support (lat,lon) <-> (x,y) with a reference coordinate system of (lat, lon) or (lon, lat).- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description MapProjection(RealTupleType reference, Unit[] units)Constructs from the type of the reference coordinate system and units for values in this coordinate system.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description LatLonPointgetCenterLatLon()Get the center lat/lon point for this MapProjection.abstract java.awt.geom.Rectangle2DgetDefaultMapArea()Get a reasonable bounding box in this coordinate system.LatLonPointgetLatLon(double[][] xy)Get the lat/lon point for the given xy pairs.intgetXIndex()Get the X indexintgetYIndex()Get the Y indexbooleanisLatLonOrder()Determine if the fromReference and toReference expect the to get the output and input values to be row/col ordered orbooleanisXYOrder()Determine if the input to the toReference and output from the fromReference is (x,y) or (y,x).java.lang.StringtoString()Print out a string representation of this MapProjection-
Methods inherited from class visad.georef.NavigatedCoordinateSystem
getLatitudeIndex, getLongitudeIndex
-
Methods inherited from class visad.CoordinateSystem
canConvert, equals, fromReference, fromReference, fromReference, fromReference, getCoordinateSystemUnits, getDimension, getReference, getReferenceUnits, toReference, toReference, toReference, toReference, transformCoordinates, transformCoordinates, transformCoordinates, transformCoordinates, transformCoordinatesFreeUnits, transformCoordinatesFreeUnits
-
-
-
-
Constructor Detail
-
MapProjection
public MapProjection(RealTupleType reference, Unit[] units) throws VisADException
Constructs from the type of the reference coordinate system and units for values in this coordinate system. The reference coordinate system must contain RealType.Latitude and RealType.Longitude only.- Parameters:
reference- The type of the reference coordinate system. The reference must contain RealType.Latitude and RealType.Longitude. Values in the reference coordinate system shall be in units of reference.getDefaultUnits() unless specified otherwise.units- The default units for this coordinate system. Numeric values in this coordinate system shall be in units of units unless specified otherwise. May be null or an array of null-s.- Throws:
VisADException- Couldn't create necessary VisAD object or reference does not contain RealType.Latitude and/or RealType.Longitude or the reference dimension is greater than 2.
-
-
Method Detail
-
getDefaultMapArea
public abstract java.awt.geom.Rectangle2D getDefaultMapArea()
Get a reasonable bounding box in this coordinate system. MapProjections are typically specific to an area of the world; there's no bounding box that works for all projections so each subclass must implement this method. For example, the bounding box for a satellite image MapProjection might have an upper left corner of (0,0) and the width and height of the Rectangle2D would be the number of elements and lines, respectively.- Returns:
- the bounding box of the MapProjection
-
isXYOrder
public boolean isXYOrder()
Determine if the input to the toReference and output from the fromReference is (x,y) or (y,x). Subclasses should override if (y,x).- Returns:
- true if (x,y)
-
isLatLonOrder
public boolean isLatLonOrder()
Determine if the fromReference and toReference expect the to get the output and input values to be row/col ordered or
-
getCenterLatLon
public LatLonPoint getCenterLatLon() throws VisADException
Get the center lat/lon point for this MapProjection.- Returns:
- the lat/lon point at the center of the projection.
- Throws:
VisADException
-
getXIndex
public int getXIndex()
Get the X index- Returns:
- the index
-
getYIndex
public int getYIndex()
Get the Y index- Returns:
- the index
-
getLatLon
public LatLonPoint getLatLon(double[][] xy) throws VisADException
Get the lat/lon point for the given xy pairs. this method will flip the order of the xy if it is not in xyorder- Returns:
- the lat/lon point for the given xy pairs
- Throws:
VisADException
-
toString
public java.lang.String toString()
Print out a string representation of this MapProjection- Overrides:
toStringin classjava.lang.Object
-
-
DMelt 3.0 © DataMelt by jWork.ORG