org.jscience.geography.coordinates
Class BaseSRF

java.lang.Object
  extended by org.jscience.geography.coordinates.BaseSRF
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
BaseSRF_2D, BaseSRF_3D

public abstract class BaseSRF
extends java.lang.Object
implements java.lang.Cloneable

The BaseSRF abstract class is the base class for all SRFs.

See Also:
BaseSRF_2D, BaseSRF_3D

Field Summary
protected  SRM_HSR_Code _hsr
           
protected  java.util.HashMap _internalSRFs
           
protected  CacheManager _myOpSeq
           
protected  SRM_SRFT_Code _mySrftCode
           
protected  SRM_ORM_Code _orm
           
 
Constructor Summary
BaseSRF()
           
 
Method Summary
static double calculateEuclideanDistance(Coord coord1, Coord coord2)
          Returns the euclidean distance between two coordinates.
 SRM_Coordinate_Valid_Region_Code changeCoordinateSRF(Coord src, Coord tgt)
          Changes a coordinate's values to this SRF.
 SRM_Coordinate_Valid_Region_Code checkCoordinate(Coord src)
          Check a coordinate in this SRF.
static BaseSRF createSRFSetMember(SRM_SRFS_Code srf_set, int set_member, SRM_ORM_Code orm, SRM_HSR_Code hsr)
          Creates an SRF from a SRF set code, a set member code specific to that set, and an ORM code.
static BaseSRF createStandardSRF(SRM_SRF_Code srf_code)
          Creates a Standard SRF from its SRF code.
 SRM_HSR_Code get_hsr()
          Returns this SRF's Hsr code.
 SRM_ORM_Code get_orm()
          Returns this SRF's Object Reference Model code.
 SRM_SRF_Code getSRFCode()
          Returns this pre-defined ("standard") SRF code.
 SRM_SRFS_Code getSRFSetCode()
          Returns this SRF's Set code.
 int getSRFSetMemberCode()
          Returns this SRF's Set member code.
 SRM_SRFT_Code getSRFTemplateCode()
          Returns this SRF's Template code.
abstract  boolean isEqual(BaseSRF srf)
           
 BaseSRF makeClone()
          Returns the shallow copy of this object instance.
protected  void setSrfCode(SRM_SRF_Code srfCode)
           
protected  void setSrfSetCode(SRM_SRFS_Code srfSetCode)
           
protected  void setSrfSetMemberCode(int srfSetMemberCode)
           
abstract  java.lang.String toString()
          Returns a string representation of this SRF.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_orm

protected SRM_ORM_Code _orm

_hsr

protected SRM_HSR_Code _hsr

_mySrftCode

protected SRM_SRFT_Code _mySrftCode

_myOpSeq

protected CacheManager _myOpSeq

_internalSRFs

protected java.util.HashMap _internalSRFs
Constructor Detail

BaseSRF

public BaseSRF()
Method Detail

createStandardSRF

public static BaseSRF createStandardSRF(SRM_SRF_Code srf_code)
                                 throws SrmException
Creates a Standard SRF from its SRF code.

Parameters:
srf_code - in: the code for a standard SRF to create
Returns:
a SRF template instance associated with the "Standard" SRF.
Throws:
SrmException
See Also:
createStandardSRF(), SRM_SRF_Code

A sample code to create a British National Grid (BNG) SRF is a follows:


createSRFSetMember

public static BaseSRF createSRFSetMember(SRM_SRFS_Code srf_set,
                                         int set_member,
                                         SRM_ORM_Code orm,
                                         SRM_HSR_Code hsr)
                                  throws SrmException
Creates an SRF from a SRF set code, a set member code specific to that set, and an ORM code.

Parameters:
srf_set - in: the code for an SRF set
set_member - in: the code for an SRF set member.
orm - in: the ORM code associated with the created SRF
hsr - in: the HSR transformation associated with the created SRF
Returns:
a SRF template instance associated with the SRF Set member.
Throws:
SrmException
See Also:
createSRFSetMember(), SRM_SRFS_Code, SRM_SSM_Code

A sample code to create a UTM SRF corresponding to Zone 12 Southern hemisphere based on WGS 1984 with Identity transformation is as follows:


getSRFCode

public SRM_SRF_Code getSRFCode()
Returns this pre-defined ("standard") SRF code.

Returns:
a pre-defined SRF code of this SRF
See Also:
createStandardSRF()

getSRFTemplateCode

public SRM_SRFT_Code getSRFTemplateCode()
Returns this SRF's Template code.

Returns:
an SRF Template code of this SRF
See Also:
createStandardSRF()

getSRFSetCode

public SRM_SRFS_Code getSRFSetCode()
Returns this SRF's Set code.

Returns:
an SRF Set code of this SRF
See Also:
createSRFSetMember()

getSRFSetMemberCode

public int getSRFSetMemberCode()
Returns this SRF's Set member code.

Returns:
an SRF Set member code of this SRF
See Also:
createSRFSetMember()

get_orm

public SRM_ORM_Code get_orm()
Returns this SRF's Object Reference Model code.

Returns:
an ORM code of this SRF

get_hsr

public SRM_HSR_Code get_hsr()
Returns this SRF's Hsr code.

Returns:
an HSR code of this SRF

changeCoordinateSRF

public SRM_Coordinate_Valid_Region_Code changeCoordinateSRF(Coord src,
                                                            Coord tgt)
                                                     throws SrmException
Changes a coordinate's values to this SRF.

Parameters:
src - in: the source coordinate in some other SRF
tgt - in out: the target coordinate in this SRF
Returns:
the Valid Region of the target coordinate
Throws:
SrmException

checkCoordinate

public SRM_Coordinate_Valid_Region_Code checkCoordinate(Coord src)
                                                 throws SrmException
Check a coordinate in this SRF.

Parameters:
src - in: the source coordinate in some other SRF
Returns:
the coordinate valid region code in the coordinate's SRF
Throws:
SrmException

calculateEuclideanDistance

public static double calculateEuclideanDistance(Coord coord1,
                                                Coord coord2)
                                         throws SrmException
Returns the euclidean distance between two coordinates.

Parameters:
coord1 - in: a coordinate in some SRF
coord2 - in: a coordinate in some SRF
Returns:
the Euclidean distance between the two coordinates (in meters).
Throws:
SrmException

toString

public abstract java.lang.String toString()
Returns a string representation of this SRF.

Overrides:
toString in class java.lang.Object

isEqual

public abstract boolean isEqual(BaseSRF srf)

makeClone

public BaseSRF makeClone()
                  throws SrmException
Returns the shallow copy of this object instance.

Throws:
SrmException

setSrfCode

protected void setSrfCode(SRM_SRF_Code srfCode)

setSrfSetCode

protected void setSrfSetCode(SRM_SRFS_Code srfSetCode)

setSrfSetMemberCode

protected void setSrfSetMemberCode(int srfSetMemberCode)