Class GeographyType

Object
io.delta.kernel.types.DataType
io.delta.kernel.types.GeographyType

@Evolving public final class GeographyType extends DataType
The data type representing geography values. A Geography must have a fixed Spatial Reference System Identifier (SRID) that defines the coordinate system and an algorithm that determines how geometric calculations are performed.

The SRID is specified as a string and the algorithm defines the calculation method. The engine is responsible for validating and interpreting the SRID and algorithm values.

Since:
3.0.0
  • Field Details

  • Constructor Details

    • GeographyType

      public GeographyType(String srid, String algorithm)
      Create a GeographyType with the specified SRID and algorithm.
      Parameters:
      srid - the Spatial Reference System Identifier (any non-null, non-empty string)
      algorithm - the algorithm for geometric calculations (any non-null, non-empty string)
      Throws:
      IllegalArgumentException - if the SRID or algorithm is null or empty or algorithm is invalid
  • Method Details

    • ofDefault

      public static GeographyType ofDefault()
      Returns a GeographyType with the default SRID and algorithm.
    • ofSRID

      public static GeographyType ofSRID(String srid)
      Returns a GeographyType with the specified SRID and default algorithm.
      Parameters:
      srid - the Spatial Reference System Identifier (any non-null, non-empty string)
    • ofAlgorithm

      public static GeographyType ofAlgorithm(String algorithm)
      Returns a GeographyType with the default SRID and the specified algorithm.
      Parameters:
      algorithm - one of: spherical, vincenty, thomas, andoyer, karney
    • getSRID

      public String getSRID()
      Get the Spatial Reference System Identifier.
      Returns:
      the SRID string
    • getAlgorithm

      public String getAlgorithm()
      Get the algorithm for geometric calculations.
      Returns:
      the algorithm string
    • isNested

      public boolean isNested()
      Description copied from class: DataType
      Returns true iff this data is a nested data type (it logically parameterized by other types).

      For example StructType, ArrayType, MapType are nested data types.

      Specified by:
      isNested in class DataType
    • simpleString

      public String simpleString()
      Serialize this GeographyType to its string representation with minimal info.
      Returns:
      the serialized string representation
    • toString

      public String toString()
      Specified by:
      toString in class DataType
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in class DataType
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in class DataType