Package com.databricks.jdbc.api.impl
Class AbstractDatabricksGeospatial
- java.lang.Object
-
- com.databricks.jdbc.api.impl.AbstractDatabricksGeospatial
-
- All Implemented Interfaces:
IDatabricksGeospatial
- Direct Known Subclasses:
DatabricksGeography,DatabricksGeometry
public abstract class AbstractDatabricksGeospatial extends Object implements IDatabricksGeospatial
Abstract base class for geospatial data types in Databricks JDBC driver.This class provides common functionality for both GEOMETRY and GEOGRAPHY types, including storage of WKT (Well-Known Text) format data and access to both WKT and WKB representations.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractDatabricksGeospatial(String wkt, int srid)Constructs an AbstractDatabricksGeospatial with the specified WKT and SRID.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Checks if this geospatial object is equal to another object.intgetSRID()Returns the Spatial Reference System Identifier (SRID) of the geospatial object.abstract StringgetType()Returns the data type of the geospatial object.byte[]getWKB()Returns the Well-Known Binary (WKB) representation of the geospatial object.StringgetWKT()Returns the Well-Known Text (WKT) representation of the geospatial object.inthashCode()Returns the hash code for this geospatial object.StringtoString()Returns a string representation of the geospatial object in EWKT format.
-
-
-
Constructor Detail
-
AbstractDatabricksGeospatial
protected AbstractDatabricksGeospatial(String wkt, int srid) throws DatabricksValidationException
Constructs an AbstractDatabricksGeospatial with the specified WKT and SRID.- Parameters:
wkt- the Well-Known Text representation of the geospatial objectsrid- the Spatial Reference System Identifier- Throws:
DatabricksValidationException- if the WKT is invalid
-
-
Method Detail
-
getWKB
public byte[] getWKB()
Returns the Well-Known Binary (WKB) representation of the geospatial object.- Specified by:
getWKBin interfaceIDatabricksGeospatial- Returns:
- the WKB representation as a byte array
-
getSRID
public int getSRID()
Returns the Spatial Reference System Identifier (SRID) of the geospatial object.- Specified by:
getSRIDin interfaceIDatabricksGeospatial- Returns:
- the SRID value
-
getWKT
public String getWKT()
Returns the Well-Known Text (WKT) representation of the geospatial object.- Specified by:
getWKTin interfaceIDatabricksGeospatial- Returns:
- the WKT string
-
toString
public String toString()
Returns a string representation of the geospatial object in EWKT format.
-
equals
public boolean equals(Object obj)
Checks if this geospatial object is equal to another object.
-
hashCode
public int hashCode()
Returns the hash code for this geospatial object.
-
getType
public abstract String getType()
Returns the data type of the geospatial object.- Specified by:
getTypein interfaceIDatabricksGeospatial- Returns:
- the type as a string, either "GEOMETRY" or "GEOGRAPHY"
-
-