Class SpatialReference

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    SpatialReferenceImpl

    public abstract class SpatialReference
    extends java.lang.Object
    implements java.io.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
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static long serialVersionUID  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      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​(java.lang.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​(JsonReader parser)  
      static SpatialReference fromJson​(com.fasterxml.jackson.core.JsonParser parser)
      Returns spatial reference from the JsonParser.
      static SpatialReference fromJson​(java.lang.String string)  
      abstract int getID()
      Returns the well known ID for the horizontal coordinate system of the spatial reference.
      (package private) abstract int getLatestID()
      Returns the latest value of the well known ID for the horizontal coordinate system of the spatial reference.
      (package private) abstract int getOldID()
      Returns the oldest value of the well known ID for the horizontal coordinate system of the spatial reference.
      abstract java.lang.String getText()  
      double getTolerance()
      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 isLocal()  
      java.lang.String toString()
      Returns string representation of the class for debugging purposes.
      (package private) java.lang.Object writeReplace()  
      • 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:
        java.lang.IllegalArgumentException - if wkid is not supported or does not exist.
      • create

        public static SpatialReference create​(java.lang.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 java.lang.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:
        java.lang.Exception - if parsing has failed
      • fromJson

        public static SpatialReference fromJson​(java.lang.String string)
                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • fromJson

        public static SpatialReference fromJson​(JsonReader parser)
                                         throws java.lang.Exception
        Throws:
        java.lang.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 java.lang.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

        java.lang.Object writeReplace()
                               throws java.io.ObjectStreamException
        Throws:
        java.io.ObjectStreamException
      • toString

        public java.lang.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 java.lang.Object