Class GeoValue

java.lang.Object
dev.frostlake.values.GeoValue
All Implemented Interfaces:
Serializable, Comparable<GeoValue>

public final class GeoValue extends Object implements Comparable<GeoValue>, Serializable
Runtime value of the GEOGRAPHY / GEOMETRY types: the GeoJSON model ({"coordinates": …, "type": "Point"} with sorted keys, Snowflake's default output form) plus the KIND — geography (spherical, SRID 4326) or geometry (planar, SRID configurable, default 0). Stringification is the compact GeoJSON text (this engine's display policy; Snowflake pretty-prints the same JSON), and equality/ordering/hashing follow it.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    boolean
    equals(Object other)
     
    The compact GeoJSON text.
    The GeoJSON geometry type name (Point, LineString, …).
    int
     
    int
     
    boolean
    TRUE for GEOGRAPHY (spherical), FALSE for GEOMETRY (planar).
    The SQL type name for error messages: GEOGRAPHY or GEOMETRY.
    tools.jackson.databind.JsonNode
    The parsed GeoJSON tree (parsed on first access; re-parsed after deserialization).
    static GeoValue
    ofNode(tools.jackson.databind.JsonNode node, boolean geography, int srid)
    Wraps a parsed GeoJSON tree (keys already sorted), rendering its compact text once.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Method Details

    • ofNode

      public static GeoValue ofNode(tools.jackson.databind.JsonNode node, boolean geography, int srid)
      Wraps a parsed GeoJSON tree (keys already sorted), rendering its compact text once.
    • geoJson

      public String geoJson()
      The compact GeoJSON text.
    • node

      public tools.jackson.databind.JsonNode node()
      The parsed GeoJSON tree (parsed on first access; re-parsed after deserialization).
    • isGeography

      public boolean isGeography()
      TRUE for GEOGRAPHY (spherical), FALSE for GEOMETRY (planar).
    • getSrid

      public int getSrid()
    • geoType

      public String geoType()
      The GeoJSON geometry type name (Point, LineString, …).
    • kindName

      public String kindName()
      The SQL type name for error messages: GEOGRAPHY or GEOMETRY.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(GeoValue other)
      Specified by:
      compareTo in interface Comparable<GeoValue>