Class SpatialReference

java.lang.Object
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:
  • 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.
    • 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()
    • 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