com.esri.wms.client
Class SpatialReference

java.lang.Object
  extended by com.esri.wms.client.SpatialReference
All Implemented Interfaces:
Serializable

public class SpatialReference
extends Object
implements Serializable

Defines a CRS or a SRS.

 SpatialReference ref = new SpatialReference();
 ref.setName("EPSG:3416");
 

See Also:
Serialized Form

Field Summary
static SpatialReference CRS84
          A CRS:84 instance.
static SpatialReference EPSG4267
          A EPSG:4267 instance.
static SpatialReference EPSG4326
          A EPSG:4326 instance.
protected static int[] EPSGLowerRange
          The EPSG code lower range.
protected static int[] EPSGUpperRange
          The EPSG code upper range.
protected static Properties serviceProperties
          The serviceProperties is persisted in the "services.properties" file.
static boolean SWAP_AXIS_ENABLED
          Sets to false to disable the axis swap.
 
Constructor Summary
SpatialReference()
          Instantiates an object of SpatialReference.
SpatialReference(String name)
          Instantiates an object of SpatialReference with the given name.
 
Method Summary
 boolean equals(Object obj)
          Compares the specified object with this instance for equality.
 SpatialReference getCopy()
          Returns a copy of the current instance.
 String getName()
          Gets the name of the SpatialReference.
 int hashCode()
          Returns the hash code of the request object.
 void setName(String name)
          Sets the name of the SpatialReference.
 boolean swapAxis(String version)
          Return true if the SpatialReference need to swap x, y axis.
 int toEPSG()
          Converts the spatialReference to EPSG code.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EPSG4326

public static final SpatialReference EPSG4326
A EPSG:4326 instance.


EPSG4267

public static final SpatialReference EPSG4267
A EPSG:4267 instance.


CRS84

public static final SpatialReference CRS84
A CRS:84 instance.


serviceProperties

protected static Properties serviceProperties
The serviceProperties is persisted in the "services.properties" file.


EPSGLowerRange

protected static int[] EPSGLowerRange
The EPSG code lower range. The code ranges are persisted in the services.properties file. If

EPSGLowerRange[i]<=code<=EPSGUpperRange[i]

swapAxis(ServerConnection.SPEC_VER_1_3_0) will be true.


SWAP_AXIS_ENABLED

public static boolean SWAP_AXIS_ENABLED
Sets to false to disable the axis swap.


EPSGUpperRange

protected static int[] EPSGUpperRange
The EPSG code upper range. The code ranges are persisted in the services.properties file. If

EPSGLowerRange[0...n]<=code<=EPSGUpperRange[0...n]

swapAxis(ServerConnection.SPEC_VER_1_3_0) will be true.

Constructor Detail

SpatialReference

public SpatialReference()
Instantiates an object of SpatialReference.


SpatialReference

public SpatialReference(String name)
Instantiates an object of SpatialReference with the given name.

Parameters:
name - e.g. "CRS:84"
Method Detail

getCopy

public SpatialReference getCopy()
Returns a copy of the current instance.


swapAxis

public boolean swapAxis(String version)
Return true if the SpatialReference need to swap x, y axis.

Parameters:
version -

toEPSG

public int toEPSG()
Converts the spatialReference to EPSG code.

Returns:
-1 if no match found in EPSG

getName

public String getName()
Gets the name of the SpatialReference.

Returns:
Returns the name, e.g. "CRS:84".

setName

public void setName(String name)
Sets the name of the SpatialReference.

Parameters:
name - The name to set, e.g. "EPSG:4326".

hashCode

public int hashCode()
Returns the hash code of the request object.

Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Compares the specified object with this instance for equality. Returns true if all fields of the two Objects are equal.

Overrides:
equals in class Object
Parameters:
obj - object to be compared for equality with this instance.
Returns:
Returns true if the specified object is equal to this instance.