com.esri.core.geometry
Class SpatialReference

java.lang.Object
  extended by com.esri.core.geometry.SpatialReference
All Implemented Interfaces:
Serializable

public abstract class SpatialReference
extends Object
implements Serializable

A class that represents the spatial reference for the geometry. This class provide tolerance value for the topological and relational operations.

See Also:
Serialized Form

Constructor Summary
SpatialReference()
           
 
Method Summary
static SpatialReference create(int wkid)
          Creates an instance of the spatial reference based on the provided well known ID for the horizontal coordinate system.
static SpatialReference create(String wktext)
          Creates an instance of the spatial reference based on the provided well known text representation for the horizontal coordinate system.
static SpatialReference fromJson(org.codehaus.jackson.JsonParser parser)
          Returns spatial reference from the JsonParser.
abstract  int getID()
          Returns the well known ID for the horizontal coordinate system of the spatial reference.
abstract  String getText()
           
 double getTolerance()
          Returns the XY tolerance of the spatial reference.
 String toString()
          Returns string representation of the class for debugging purposes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SpatialReference

public SpatialReference()
Method Detail

create

public static SpatialReference create(int wkid)
Creates an instance of the spatial reference based on the provided well known ID for the horizontal coordinate system.

Parameters:
wkid - The well-known ID.
Returns:
SpatialReference The spatial reference.
Throws:
IllegalArgumentException - if wkid is not supported or does not exist.

create

public static SpatialReference create(String wktext)
Creates an instance of the spatial reference based on the provided well known text representation for the horizontal coordinate system.

Parameters:
wktext - The well-known text string representation of spatial reference.
Returns:
SpatialReference The spatial reference.

fromJson

public static SpatialReference fromJson(org.codehaus.jackson.JsonParser parser)
                                 throws Exception
Returns spatial reference from the JsonParser.

Parameters:
parser - The JSON parser.
Returns:
The spatial reference or null if there is no spatial reference information, or the parser does not point to an object start.
Throws:
Exception - if parsing has failed

getID

public abstract int getID()
Returns the well known ID for the horizontal coordinate system of the spatial reference.

Returns:
wkid The well known ID.

getText

public abstract String getText()

getTolerance

public double getTolerance()
Returns the XY tolerance of the spatial reference. The tolerance value defines the precision of topological operations, and "thickness" of boundaries of geometries for relational operations. When two points have xy coordinates closer than the tolerance value, they are considered equal. As well as when a point is within tolerance from the line, the point is assumed to be on the line. During topological operations the tolerance is increased by a factor of about 1.41 and any two points within that distance are snapped together.

Returns:
The XY tolerance of the spatial reference.

toString

public String toString()
Returns string representation of the class for debugging purposes. The format and content of the returned string is not part of the contract of the method and is subject to change in any future release or patch without further notice.

Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.