com.esri.adf.web.data.geometry
Class WebSpatialReference

java.lang.Object
  extended by com.esri.adf.web.data.geometry.WebSpatialReference
All Implemented Interfaces:
Externalizable, Serializable

public final class WebSpatialReference
extends Object
implements Externalizable

WebSpatialReference is a class representing a spatial reference.

See Also:
Serialized Form

Field Summary
protected  String definitionString
           
protected static Map<String,WebSpatialReference> defSRs
           
static int GEOG_CS
           
protected  int id
           
protected static Map<Integer,WebSpatialReference> idSRs
           
static int PROJ_CS
           
protected  int type
           
 
Constructor Summary
  WebSpatialReference()
          Constructs an empty instance of WebSpatialReference.
protected WebSpatialReference(int id, String definitionString, int type)
           
 
Method Summary
 boolean equals(Object obj)
           
 String getDefinitionString()
          Returns spatial reference definition string.
 WebPolygon getHorizon(boolean inGCS)
          Returns the horizon of this spatial reference.
 int getId()
          Return spatial reference ID.
 int getType()
          Returns spatial reference type.
static WebSpatialReference getWebSpatialReference(int id)
          Returns an instance of WebSpatialReference corresponding to its ID.
static WebSpatialReference getWebSpatialReference(String definitionString)
          Returns an instance of WebSpatialReference corresponding to a given definition string.
static int getWebSpatialReferenceId(String definitionString)
          Returns the spatial reference id based on the specified definition string.
 int hashCode()
           
 void readExternal(ObjectInput in)
           
 String toString()
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

GEOG_CS

public static final int GEOG_CS
See Also:
Constant Field Values

PROJ_CS

public static final int PROJ_CS
See Also:
Constant Field Values

id

protected int id

definitionString

protected String definitionString

type

protected int type

idSRs

protected static Map<Integer,WebSpatialReference> idSRs

defSRs

protected static Map<String,WebSpatialReference> defSRs
Constructor Detail

WebSpatialReference

public WebSpatialReference()
Constructs an empty instance of WebSpatialReference.


WebSpatialReference

protected WebSpatialReference(int id,
                              String definitionString,
                              int type)
Method Detail

getId

public int getId()
Return spatial reference ID.

Returns:
spatial reference ID

getDefinitionString

public String getDefinitionString()
Returns spatial reference definition string.

Returns:
spatial reference definition string

getType

public int getType()
Returns spatial reference type.

Returns:
spatial reference type

getWebSpatialReference

public static WebSpatialReference getWebSpatialReference(int id)
Returns an instance of WebSpatialReference corresponding to its ID.

Parameters:
id - id of the spatial reference
Returns:
an instance of WebSpatialReference

getWebSpatialReference

public static WebSpatialReference getWebSpatialReference(String definitionString)
Returns an instance of WebSpatialReference corresponding to a given definition string.

Parameters:
definitionString - spatial reference's definition string
Returns:
an instance of WebSpatialReference

getWebSpatialReferenceId

public static int getWebSpatialReferenceId(String definitionString)
Returns the spatial reference id based on the specified definition string.

Parameters:
definitionString - the spatial reference definition string
Returns:
the spatial reference id, -1 if there is no id available for the specified definition string

getHorizon

public WebPolygon getHorizon(boolean inGCS)
Returns the horizon of this spatial reference.

Parameters:
inGCS - . This parameter has an affect only if the current spatial reference is in Projected Coordinate System. When true, the horizon will be returned in the Geographic Coordinate System that this spatial reference is based on.
Returns:
a horizon of WebPolygon object

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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

readExternal

public void readExternal(ObjectInput in)
                  throws IOException
Specified by:
readExternal in interface Externalizable
Throws:
IOException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException