Interface IDatabricksGeospatial
-
- All Known Subinterfaces:
IGeography,IGeometry
- All Known Implementing Classes:
AbstractDatabricksGeospatial,DatabricksGeography,DatabricksGeometry
public interface IDatabricksGeospatialInterface for geospatial data types in Databricks JDBC driver.This interface provides common functionality for both GEOMETRY and GEOGRAPHY types, allowing access to Well-Known Text (WKT), Well-Known Binary (WKB) representation and Spatial Reference System Identifier (SRID).
Following the established patterns of DatabricksStruct, DatabricksArray, and DatabricksMap, this interface enables consistent handling of geospatial data across the JDBC driver.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetSRID()Returns the Spatial Reference System Identifier (SRID) of the geospatial object.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.
-
-
-
Method Detail
-
getWKB
byte[] getWKB() throws DatabricksValidationExceptionReturns the Well-Known Binary (WKB) representation of the geospatial object.WKB is a binary format for representing geometry data that is compact and suitable for storage and transmission. This method converts the internal representation to WKB format on demand.
- Returns:
- the WKB representation as a byte array
- Throws:
DatabricksValidationException- if WKT to WKB conversion fails
-
getSRID
int getSRID()
Returns the Spatial Reference System Identifier (SRID) of the geospatial object.SRID identifies the coordinate system used by the geometry. Common values include:
- 4326 - WGS 84 (World Geodetic System 1984)
- 3857 - Web Mercator
- 0 - No SRID specified
- Returns:
- the SRID value
-
getWKT
String getWKT()
Returns the Well-Known Text (WKT) representation of the geospatial object.WKT is a human-readable text format for representing geometry data. This provides a complement to the binary WKB format, allowing easy inspection and debugging of geospatial data.
- Returns:
- the WKT string representation
-
getType
String getType()
Returns the data type of the geospatial object.- Returns:
- the type as a string, either "GEOMETRY" or "GEOGRAPHY"
-
-