public class ProjectionTransverseMercator extends AbstractGeographicProjection
setWidth(gov.nasa.worldwind.geom.Angle)
method, but the projection may fail for large widths.
The projection limits are modified to reflect the central meridian and the width, however the projection limits are clamped to a minimum of -180 degrees and a maximum of +180 degrees. It's therefore not possible to display a band whose central meridian is plus or minus 180.
Modifier and Type | Field and Description |
---|---|
protected Angle |
centralLatitude |
protected Angle |
centralMeridian |
protected static Angle |
DEFAULT_CENTRAL_LATITUDE |
protected static Angle |
DEFAULT_CENTRAL_MERIDIAN |
protected static Angle |
DEFAULT_WIDTH |
protected Angle |
width |
projectionLimits
Constructor and Description |
---|
ProjectionTransverseMercator()
Creates a projection whose central meridian is the Prime Meridian and central latitude is 0.
|
ProjectionTransverseMercator(Angle centralMeridian)
Creates a projection with a specified central meridian and a central latitude of 0.
|
ProjectionTransverseMercator(Angle centralMeridian,
Angle centralLatitude)
Creates a projection with a specified central meridian and central latitude.
|
Modifier and Type | Method and Description |
---|---|
Position |
cartesianToGeographic(Globe globe,
Vec4 cart,
Vec4 offset)
Converts a Cartesian point in meters to a geographic position.
|
boolean |
equals(java.lang.Object o) |
Vec4 |
geographicToCartesian(Globe globe,
Angle latitude,
Angle longitude,
double metersElevation,
Vec4 offset)
Converts a geographic position to meters in Cartesian coordinates.
|
void |
geographicToCartesian(Globe globe,
Sector sector,
int numLat,
int numLon,
double[] metersElevation,
Vec4 offset,
Vec4[] out)
Converts a grid of geographic positions to a grid of points in Cartesian coordinates.
|
Angle |
getCentralLatitude()
Indicates this projection's central latitude.
|
Angle |
getCentralMeridian()
Indicates this projection's central meridian.
|
java.lang.String |
getName()
Returns the projection name.
|
protected double |
getScale() |
Angle |
getWidth()
Indicates the region in which positions are mapped.
|
int |
hashCode() |
boolean |
isContinuous()
Indicates whether it makes sense to treat this projection as contiguous with itself.
|
protected static Sector |
makeProjectionLimits(Angle centralMeridian,
Angle width) |
Vec4 |
northPointingTangent(Globe globe,
Angle latitude,
Angle longitude)
Computes a Cartesian vector that points north and is tangent to the meridian at the specified geographic
location.
|
void |
setCentralLatitude(Angle centralLatitude)
Set this projection's central latitude.
|
void |
setCentralMeridian(Angle centralMeridian)
Specifies this projections central meridian.
|
void |
setWidth(Angle width)
Specifies the region in which positions are mapped.
|
getProjectionLimits, setProjectionLimits
protected Angle centralLatitude
protected Angle centralMeridian
protected static Angle DEFAULT_CENTRAL_LATITUDE
protected static Angle DEFAULT_CENTRAL_MERIDIAN
protected static Angle DEFAULT_WIDTH
protected Angle width
public ProjectionTransverseMercator()
public ProjectionTransverseMercator(Angle centralMeridian)
centralMeridian
- The projection's central meridian.public ProjectionTransverseMercator(Angle centralMeridian, Angle centralLatitude)
centralMeridian
- The projection's central meridian.centralLatitude
- The projection's central latitude.public Position cartesianToGeographic(Globe globe, Vec4 cart, Vec4 offset)
GeographicProjection
Note: The input arguments are not checked for null
prior to being used. The caller, typically a
Globe2D
implementation, is expected do perform that check prior to calling this method.
globe
- The globe this projection is applied to.cart
- The Cartesian point, in meters.offset
- An optional offset to be applied to the Cartesian input prior to converting it. Typically only
projections that are continuous (see GeographicProjection.isContinuous()
apply this offset. Others ignore it.
May be null.GeographicProjection.geographicToCartesian(Globe, gov.nasa.worldwind.geom.Angle, gov.nasa.worldwind.geom.Angle, double,
gov.nasa.worldwind.geom.Vec4)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public Vec4 geographicToCartesian(Globe globe, Angle latitude, Angle longitude, double metersElevation, Vec4 offset)
GeographicProjection
Note: The input arguments are not checked for null
prior to being used. The caller, typically a
Globe2D
implementation, is expected do perform that check prior to calling this method.
globe
- The globe this projection is applied to.latitude
- The latitude of the position.longitude
- The longitude of the position.metersElevation
- The elevation of the position, in meters.offset
- An optional offset to be applied to the Cartesian output. Typically only projections that
are continuous (see GeographicProjection.isContinuous()
apply this offset. Others ignore it. May be
null.GeographicProjection.cartesianToGeographic(Globe, gov.nasa.worldwind.geom.Vec4, gov.nasa.worldwind.geom.Vec4)
public void geographicToCartesian(Globe globe, Sector sector, int numLat, int numLon, double[] metersElevation, Vec4 offset, Vec4[] out)
GeographicProjection
This method provides an interface for efficient generation of a grid of cartesian points within a sector. The
grid is constructed by dividing the sector into numLon x numLat
evenly separated points in
geographic coordinates. The first and last points in latitude and longitude are placed at the sector's minimum
and maximum boundary, and the remaining points are spaced evenly between those boundary points.
For each grid point within the sector, an elevation value is specified via an array of elevations. The calculation at each position incorporates the associated elevation.
globe
- The globe this projection is applied to.sector
- The sector over which to generate the points.numLat
- The number of points to generate latitudinally.numLon
- The number of points to generate longitudinally.metersElevation
- An array of elevations to incorporate in the point calculations. There must be one
elevation value in the array for each generated point, so the array must have a length of
at least numLon x numLat
. Elevations are read from this array in row major
order, beginning with the row of minimum latitude.offset
- An optional offset to be applied to the Cartesian output. Typically only projections that
are continuous (see GeographicProjection.isContinuous()
apply this offset. Others ignore it. May be
null.out
- An array to hold the computed cartesian points. It must have a length of at least
numLon x numLat
. Points are written to this array in row major order,
beginning with the row of minimum latitude.public Angle getCentralLatitude()
public Angle getCentralMeridian()
public java.lang.String getName()
GeographicProjection
protected double getScale()
public Angle getWidth()
public int hashCode()
hashCode
in class java.lang.Object
public boolean isContinuous()
GeographicProjection
true
if it makes sense to treat this projection as continuous, otherwise
false
.protected static Sector makeProjectionLimits(Angle centralMeridian, Angle width)
public Vec4 northPointingTangent(Globe globe, Angle latitude, Angle longitude)
GeographicProjection
globe
- The globe this projection is applied to.latitude
- The latitude of the location.longitude
- The longitude of the location.public void setCentralLatitude(Angle centralLatitude)
centralLatitude
- This projection's central latitude. The default is 0.public void setCentralMeridian(Angle centralMeridian)
centralMeridian
- This projection's central meridian. The default is 0.public void setWidth(Angle width)
width
- This projection's width.