jwo.landserf.process.proj
Class Projection

java.lang.Object
  extended by jwo.landserf.process.proj.Projection
All Implemented Interfaces:
Serializable

public class Projection
extends Object
implements Serializable

Stores information about a map projection. Includes projection type, zone (where relevant) and ellipsoid used.

Version:
2.3, 10th February, 2009.
Author:
Jo Wood
See Also:
Serialized Form

Field Summary
static int BC_ALBERS
          British Columbia Albers Standard map projection.
static int FRENCH_NTF
          French NTF map projection (Lambert conformal conic).
static int LAT_LONG
          Indicates lat/long coordinate system.
static int OSGB
          Indicates Ordnance Survey National Grid map projection.
static int STATE_PLANE
          Indicates State Plane map projection.
static int SWISS
          Indicates Swiss grid map projection.
static int TIME_SPACE
          Indicates Mayhew travel time-space projection.
static int UNDEFINED
          Indicates map projection is undefined.
static int US_ALL_ALBERS
          US all states Albers projection.
static int US_CONT_ALBERS
          US conterminous states Albers projection.
static int UTM
          Indicates UTM map projection.
 
Constructor Summary
Projection()
          Creates an undefined projection.
Projection(int type)
          Creates a projection of the given type with no ellipsoid defined.
Projection(int type, Ellipsoid ellipsoid)
          Stores the given projection information.
Projection(Projection oldProjection)
          Creates a copy of the given projection.
 
Method Summary
 Ellipsoid getEllipsoid()
          Reports the type of ellipsoid stored (WGS84 etc.).
static String getName(int projType)
          Reports the name of the given projection type.
 int getType()
          Reports the type of projection stored.
 String getZone()
          Reports the full zone of the projection.
 char getZoneLetter()
          Reports the UTM zone letter.
 int getZoneNumber()
          Reports the projection zone number.
 void setEllipsoid(Ellipsoid ellipsoid)
          Sets the ellipsoid associated with the projection.
 void setZone(int zoneNumber, char zoneLetter)
          Sets the zone number and letter for a projection that uses zones (such as UTM).
 void setZoneNumber(int zoneNumber)
          Sets the zone number for a projection that uses zones (such as UTM).
 String toString()
          Returns a human-readable description of this projection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNDEFINED

public static final int UNDEFINED
Indicates map projection is undefined.

See Also:
Constant Field Values

LAT_LONG

public static final int LAT_LONG
Indicates lat/long coordinate system.

See Also:
Constant Field Values

UTM

public static final int UTM
Indicates UTM map projection.

See Also:
Constant Field Values

OSGB

public static final int OSGB
Indicates Ordnance Survey National Grid map projection.

See Also:
Constant Field Values

STATE_PLANE

public static final int STATE_PLANE
Indicates State Plane map projection.

See Also:
Constant Field Values

SWISS

public static final int SWISS
Indicates Swiss grid map projection.

See Also:
Constant Field Values

BC_ALBERS

public static final int BC_ALBERS
British Columbia Albers Standard map projection.

See Also:
Constant Field Values

FRENCH_NTF

public static final int FRENCH_NTF
French NTF map projection (Lambert conformal conic).

See Also:
Constant Field Values

US_CONT_ALBERS

public static final int US_CONT_ALBERS
US conterminous states Albers projection.

See Also:
Constant Field Values

US_ALL_ALBERS

public static final int US_ALL_ALBERS
US all states Albers projection.

See Also:
Constant Field Values

TIME_SPACE

public static final int TIME_SPACE
Indicates Mayhew travel time-space projection.

See Also:
Constant Field Values
Constructor Detail

Projection

public Projection()
Creates an undefined projection.


Projection

public Projection(int type)
Creates a projection of the given type with no ellipsoid defined.

Parameters:
type - Type of projection (LAT_LONG, UTM etc.).

Projection

public Projection(Projection oldProjection)
Creates a copy of the given projection.

Parameters:
oldProjection - Projection information to copy.

Projection

public Projection(int type,
                  Ellipsoid ellipsoid)
Stores the given projection information.

Parameters:
type - Type of projection (LAT_LONG, UTM etc.).
ellipsoid - Type of ellipsoid used in projection (WGS84 etc.).
Method Detail

getType

public int getType()
Reports the type of projection stored.

Returns:
Projection type (LAT_LONG, UTM etc.).

getEllipsoid

public Ellipsoid getEllipsoid()
Reports the type of ellipsoid stored (WGS84 etc.).

Returns:
Ellipsoid used for global map projection or null if not defined.

setEllipsoid

public void setEllipsoid(Ellipsoid ellipsoid)
Sets the ellipsoid associated with the projection.

Parameters:
ellipsoid - Ellipsoid associated with the projection (WGS84 etc.).

setZone

public void setZone(int zoneNumber,
                    char zoneLetter)
Sets the zone number and letter for a projection that uses zones (such as UTM).

Parameters:
zoneNumber - Zone number to use.
zoneLetter - Zone letter to use.

setZoneNumber

public void setZoneNumber(int zoneNumber)
Sets the zone number for a projection that uses zones (such as UTM).

Parameters:
zoneNumber - Zone number to use.

getZoneNumber

public int getZoneNumber()
Reports the projection zone number. In the case of UTM, the zone number varies from 1 to 60, where 1 is around 175W, and 60 is 175E. Other projections that use zone numbers include the FRENCH conformal conic (1,2,3,4). Returns 0 if not defined.

Returns:
UTM zone number (longitudinal zone for UTM).

getZoneLetter

public char getZoneLetter()
Reports the UTM zone letter. In the case of UTM, letters vary from N,M,O...X going north from equator and M,L,K...C going south from equator. Returns Z if outside 84N or 80S or ' ' (space) if not defined.

Returns:
zone letter (latitudinal zone for UTM, ' ' or 'e' for FRENCH_NTF).

getZone

public String getZone()
Reports the full zone of the projection.

Returns:
Projection zone (e.g 19F for southern tip of South America in UTM; 2e for French NTF Lambert zone IIe national map).

toString

public String toString()
Returns a human-readable description of this projection.

Overrides:
toString in class Object
Returns:
Description of this projection.

getName

public static String getName(int projType)
Reports the name of the given projection type.

Parameters:
projType - Type of projection to name.
Returns:
Name of given projection type. Useful for reporting to a GUI.


Copyright Jo Wood, 1996-2009, last modified, 17th April, 2009