jwo.landserf.process.proj
Class Projection

java.lang.Object
  extended byjwo.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.2, 25th August, 2004.
Author:
Jo Wood
See Also:
Serialized Form

Field Summary
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 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.
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 UTM zone of the given (lat,lng) location.
 char getZoneLetter()
          Reports the UTM zone letter of the given (lat,lng) location.
 int getZoneNumber()
          Reports the UTM zone number of the given (lat,lng) location.
 void setZone(int zoneNumber, char zoneLetter)
          Sets the zone number and letter for a UTM projection.
 void setZoneNumber(int zoneNumber)
          Sets the zone number for a UTM projection.
 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

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.

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.
ellipsoid - Type of ellipsoid used in projection.
Method Detail

getType

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

Returns:
Projection type.

getEllipsoid

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

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

setZone

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

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

setZoneNumber

public void setZoneNumber(int zoneNumber)
Sets the zone number for a UTM projection.

Parameters:
zoneNumber - Zone number to use.

getZoneNumber

public int getZoneNumber()
Reports the UTM zone number of the given (lat,lng) location. Numbers vary from 1 to 60, where 1 is around 175W, and 60 is 175E. Returns 0 if not defined.

Returns:
UTM zone number (longitudinal zone).

getZoneLetter

public char getZoneLetter()
Reports the UTM zone letter of the given (lat,lng) location. 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:
UTM zone letter (latitudinal zone).

getZone

public String getZone()
Reports the full UTM zone of the given (lat,lng) location.

Returns:
UTM zone (e.g 19F for southern tip of South America).

toString

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

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-2005, last modified, 11th March, 2005