Class SpatialReference

java.lang.Object
com.esri.core.geometry.SpatialReference
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
SpatialReferenceImpl

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:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final long
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    create(int wkid)
    Creates an instance of the spatial reference based on the provided well known ID for the horizontal coordinate system.
    create(String wktext)
    Creates an instance of the spatial reference based on the provided well known text representation for the horizontal coordinate system.
     
    fromJson(com.fasterxml.jackson.core.JsonParser parser)
    Returns spatial reference from the JsonParser.
    fromJson(String string)
     
    abstract int
    Returns the well known ID for the horizontal coordinate system of the spatial reference.
    (package private) abstract int
    Returns the latest value of the well known ID for the horizontal coordinate system of the spatial reference.
    (package private) abstract int
    Returns the oldest value of the well known ID for the horizontal coordinate system of the spatial reference.
    abstract String
     
    double
    Returns the XY tolerance of the spatial reference.
    (package private) abstract double
    getTolerance(int semantics)
    Get the XY tolerance of the spatial reference
    (package private) boolean
     
    Returns string representation of the class for debugging purposes.
    (package private) Object
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • SpatialReference

      public SpatialReference()
  • Method Details

    • 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.
    • isLocal

      boolean isLocal()
      Returns:
      boolean Is spatial reference local?
    • fromJson

      public static SpatialReference fromJson(com.fasterxml.jackson.core.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
    • fromJson

      public static SpatialReference fromJson(String string) throws Exception
      Throws:
      Exception
    • fromJson

      public static SpatialReference fromJson(JsonReader parser) throws Exception
      Throws:
      Exception
    • 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()
    • getOldID

      abstract int getOldID()
      Returns the oldest value of the well known ID for the horizontal coordinate system of the spatial reference. This ID is used for JSON serialization. Not public.
    • getLatestID

      abstract int getLatestID()
      Returns the latest value of the well known ID for the horizontal coordinate system of the spatial reference. This ID is used for JSON serialization. Not public.
    • 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.
    • getTolerance

      abstract double getTolerance(int semantics)
      Get the XY tolerance of the spatial reference
      Returns:
      The XY tolerance of the spatial reference as double.
    • writeReplace

      Object writeReplace() throws ObjectStreamException
      Throws:
      ObjectStreamException
    • 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