public class CrsId
extends java.lang.Object
CoordinateReferenceSystem or other object referenced in a
CoordinateReferenceSystem definition.
A commonly used alternative name for CrsId is "SRID".
A CrsId consists of the name of an authority and a numeric identifier. The authority is the
organization that is responsible for managing the definition of the identified object.
In practice, CoordinateReferenceSystems are usually identified by their EPSG code, with EPSG
the authority for the identifier. In this implementation, EPSG is the default authority.
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
authority |
private int |
code |
static java.lang.String |
DEFAULT_AUTHORITY |
static CrsId |
UNDEFINED
Identifies an undefined (or unknown)
CrsId. |
| Constructor and Description |
|---|
CrsId(java.lang.String authority,
int code)
Creates an instance having the specified authority and code.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
java.lang.String |
getAuthority()
Returns the authority for this
CrsId. |
int |
getCode()
Returns the code for this
CrsId. |
int |
hashCode() |
static CrsId |
parse(java.lang.String srsString)
Creates an instance from a
String of the form "[<authority>:]<code>". |
private static int |
toNumericIdentifier(java.lang.String codeStr) |
java.lang.String |
toString() |
java.lang.String |
toUrn() |
static CrsId |
valueOf(int code)
Returns a
CrsId with the specified code and the
EPSG as authority. |
static CrsId |
valueOf(java.lang.String authority,
int code)
Returns an instance having the specified authority and code.
|
public static final java.lang.String DEFAULT_AUTHORITY
public static final CrsId UNDEFINED
CrsId.private final java.lang.String authority
private final int code
public CrsId(java.lang.String authority,
int code)
If authority EPSG and 0 or -1 is passed for the code parameter, a value equal to CrsId.UNDEFINED is returned.
authority - the authority that assigned the codecode - the code for the CoordinateReferenceSystempublic static CrsId parse(java.lang.String srsString)
String of the form "[<authority>:]<code>".
If the "authority" prefix is missing, then the authority will be assumed to be EPSG.
srsString - the string to parse into a CrsId.java.lang.IllegalArgumentException - when the string can nog be parsed asprivate static int toNumericIdentifier(java.lang.String codeStr)
public static CrsId valueOf(java.lang.String authority, int code)
authority - the authority that assigned the codecode - the code for the CoordinateReferenceSystemCrsId for the specified authority and code.public static CrsId valueOf(int code)
CrsId with the specified code and the
EPSG as authority.code - the code for the CrsId.CrsId for the specified code,and EPSG as authority.public java.lang.String getAuthority()
CrsId.CrsIdpublic int getCode()
CrsId.CrsIdpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toUrn()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object