ebgeo.maprequest.cs
Class MRProjection

java.lang.Object
  extended byebgeo.maprequest.cs.MRProjection
All Implemented Interfaces:
Cloneable

public class MRProjection
extends Object
implements Cloneable

A class to model a map projection. e.g. UTM.


Nested Class Summary
 class MRProjection.ProjectionFileFilter
          Helper class to find *_projection.txt files.
 
Field Summary
static String LAT_LONG
           
protected  String wkt
           
 
Constructor Summary
MRProjection()
          Creates a new instance of MRProjection
 
Method Summary
 String getHemisphere()
          Getter for property hemisphere.
 MRProjection getInstance(String name)
          Get an instance of a projection given a well known name.
 String getName()
          Get the well known name for this projection.
 String getName(String realm)
          Get the name of this projection in a particular realm.
 String getWkt()
          Get the Open GIS Well Known Text format of this projection.
 String getZone()
          Return the zone.
 String getZone(CoordinatePoint point)
          Return the zone for an arbitrray point.
 boolean hasNameForRealm(String realm)
          Check if this projection defines a name for this realm.
 boolean isKnown()
          Check if this datum is known.
 boolean isLatLong()
          Check if this projection is a standard latitude/longitude projection.
 void setHemisphere(String hemisphere)
          Setter for property hemisphere.
protected  void setKnown(boolean known)
           
 void setName(String name)
          Set the well known name for this projection.
 void setName(String name, String realm)
          Set the name for this projection for a particular realm.
 void setWkt(String wkt)
          Set the Open GIS Well Known Text format for this projection.
 void setZone(String zone)
          Set the zone for this projection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wkt

protected String wkt

LAT_LONG

public static String LAT_LONG
Constructor Detail

MRProjection

public MRProjection()
Creates a new instance of MRProjection

Method Detail

getInstance

public MRProjection getInstance(String name)
Get an instance of a projection given a well known name.

Parameters:
name - The well known name of the projection. If the name is not recognised then a warning is displayed, and an object that does not return a valid WKT is returned.
Returns:
Returns a projection object appropriate for the requested name.

getName

public String getName()
Get the well known name for this projection.

See Also:
getName(String)

getName

public String getName(String realm)
Get the name of this projection in a particular realm.

Parameters:
realm - The realm for which you want to know the name of this projection.
Returns:
Returns the name of this projection in the requested realm. If this projection does not have a special name in the requested realm then the well known name of the projection is returned instead.
See Also:
getName()

hasNameForRealm

public boolean hasNameForRealm(String realm)
Check if this projection defines a name for this realm. This can be useful to know, as getName(String) returns the well known name if the projection does not have a name for this realm.

Parameters:
realm - The realm for which you want to check if this projection knows about.
Returns:
Returns true if a name is defined for this realm, or false otherwise.

setName

public void setName(String name)
Set the well known name for this projection.


setName

public void setName(String name,
                    String realm)
Set the name for this projection for a particular realm.

Parameters:
name - The name that this projection is known by for the realm.
realm - The realm.

getWkt

public String getWkt()
Get the Open GIS Well Known Text format of this projection.


setWkt

public void setWkt(String wkt)
Set the Open GIS Well Known Text format for this projection.


isLatLong

public boolean isLatLong()
Check if this projection is a standard latitude/longitude projection.

Returns:
Returns true if this projection is a standard latitude/longitude projection.

getZone

public String getZone()
Return the zone. For projections for which this does not make sense, an empty string will be returned.


getZone

public String getZone(CoordinatePoint point)
Return the zone for an arbitrray point. This is mainly used for the UK Ordinace Survey projection zones, as some GIS applications imply the zone by the most significant digit of the coordinates. For projections like this it is possible to compute the zone identifier.

Parameters:
point - The point at which you want to know the zone for.

setZone

public void setZone(String zone)
Set the zone for this projection. Note that this only makes sense for projections that have zones.


getHemisphere

public String getHemisphere()
Getter for property hemisphere.

Returns:
Value of property hemisphere.

setHemisphere

public void setHemisphere(String hemisphere)
Setter for property hemisphere.

Parameters:
hemisphere - New value of property hemisphere.

isKnown

public boolean isKnown()
Check if this datum is known.

Returns:
Returns true if this datum is known (and can be used for calculations).

setKnown

protected void setKnown(boolean known)