org.pentaho.di.core.geospatial
Class SRS

java.lang.Object
  extended by org.pentaho.di.core.geospatial.SRS
All Implemented Interfaces:
Cloneable, Comparable<SRS>, XMLInterface

public class SRS
extends Object
implements Comparable<SRS>, Cloneable, XMLInterface

This class stores meta-data for a spatial reference system. It also contains factory methods to create CoordinateReferenceSystem instances from a SRS object.

Since:
17-nov-2008
Author:
phobus, sgoldinger
See Also:
SRSFactory

Field Summary
static String AUTH_EPSG
          The code for the EPSG authority
 String authority
          Mandatory: The authority
 String description
          Mandatory: The description of this SRS instance
 boolean is_custom
          Mandatory: Indicates, if this SRS is custom defined
 String srid
          Mandatory: The SRID as a String.
static SRS UNKNOWN
           
static int UNKNOWN_SRID
           
static String XML_AUTH
           
static String XML_CUST
           
static String XML_DESC
           
static String XML_SRID
           
static String XML_WKT
           
 
Constructor Summary
SRS(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
          Creates a new instance of SRS according to an existing CoordinateReferenceSystem object.
SRS(File prjFile)
           
SRS(String wkt)
          Creates a new instance of SRS according to a WKT definition This is a convenience constructor.
SRS(String authority, String srid, String description)
          Creates a new instance of SRS by defining authority, srid and and description.
SRS(String authority, String srid, String description, boolean is_custom, String wkt)
          Helper constructor for SRSFactory
SRS(String authority, String srid, String description, org.opengis.referencing.crs.CoordinateReferenceSystem crs)
          Creates a new instance of SRS by defining all necessary attributes manually.
 
Method Summary
 Object clone()
           
 int compareTo(SRS other)
           
static SRS createFromEPSG(String srid)
           
 boolean equals(Object obj)
           
 org.opengis.referencing.crs.CoordinateReferenceSystem getCRS()
          Creates a CoordinateReferenceSystem object from the existing properties in this object.
 int getSRID()
          Get the SRID for the corresponding CoordinateReferenceSystem.
 String getXML()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

authority

public final String authority
Mandatory: The authority


srid

public final String srid
Mandatory: The SRID as a String. Use this value for GUI methods


description

public final String description
Mandatory: The description of this SRS instance


is_custom

public boolean is_custom
Mandatory: Indicates, if this SRS is custom defined


XML_AUTH

public static final String XML_AUTH
See Also:
Constant Field Values

XML_SRID

public static final String XML_SRID
See Also:
Constant Field Values

XML_DESC

public static final String XML_DESC
See Also:
Constant Field Values

XML_CUST

public static final String XML_CUST
See Also:
Constant Field Values

XML_WKT

public static final String XML_WKT
See Also:
Constant Field Values

UNKNOWN

public static final SRS UNKNOWN

UNKNOWN_SRID

public static final int UNKNOWN_SRID
See Also:
Constant Field Values

AUTH_EPSG

public static final String AUTH_EPSG
The code for the EPSG authority

Constructor Detail

SRS

public SRS(String authority,
           String srid,
           String description,
           org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Creates a new instance of SRS by defining all necessary attributes manually.

Parameters:
authority - The authority e.g. EPSG.
srid - The spatial reference system identifier.
description - A description text of this spatial reference system.
crs - The CoordinateReferenceSystem

SRS

public SRS(String authority,
           String srid,
           String description)
Creates a new instance of SRS by defining authority, srid and and description.

Parameters:
authority - The authority e.g. EPSG.
srid - The spatial reference system identifier.
description - A description text of this spatial reference system.

SRS

public SRS(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
    throws KettleStepException
Creates a new instance of SRS according to an existing CoordinateReferenceSystem object.

Parameters:
crs - The CoordinateReferenceSystem object.
Throws:
KettleStepException

SRS

public SRS(String wkt)
    throws KettleStepException
Creates a new instance of SRS according to a WKT definition This is a convenience constructor.

Parameters:
wkt - The WKT string
Throws:
KettleStepException

SRS

public SRS(File prjFile)

SRS

public SRS(String authority,
           String srid,
           String description,
           boolean is_custom,
           String wkt)
    throws KettleException
Helper constructor for SRSFactory

Parameters:
authority -
srid -
description -
is_custom -
wkt -
Throws:
KettleException
Method Detail

getSRID

public int getSRID()
Get the SRID for the corresponding CoordinateReferenceSystem. Note: For GUI operations that must be performed fast, use the public property srid instead.

Parameters:
crs - CRS to map to an EPSG code.
Returns:
the SRID if it exists, SRS.UNKNOWN_SRID otherwise.

getCRS

public org.opengis.referencing.crs.CoordinateReferenceSystem getCRS()
                                                             throws KettleStepException
Creates a CoordinateReferenceSystem object from the existing properties in this object. The CRS will only be created, if needed, otherwise the existing instance will be returned.

Returns:
A new CoordinateReferenceSystem.
Throws:
KettleStepException

compareTo

public int compareTo(SRS other)
Specified by:
compareTo in interface Comparable<SRS>

clone

public Object clone()
Overrides:
clone in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getXML

public String getXML()
Specified by:
getXML in interface XMLInterface

createFromEPSG

public static SRS createFromEPSG(String srid)