forked from databricks/databricks-jdbc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDatabricksGeospatial.java
More file actions
53 lines (48 loc) · 1.84 KB
/
DatabricksGeospatial.java
File metadata and controls
53 lines (48 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package com.databricks.jdbc.api.impl;
import com.databricks.jdbc.exception.DatabricksValidationException;
/**
* Interface for geospatial data types in Databricks JDBC driver.
*
* <p>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).
*
* <p>Following the established patterns of DatabricksStruct, DatabricksArray, and DatabricksMap,
* this interface enables consistent handling of geospatial data across the JDBC driver.
*/
public interface DatabricksGeospatial {
/**
* Returns the Well-Known Binary (WKB) representation of the geospatial object.
*
* <p>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.
*
* @return the WKB representation as a byte array
* @throws DatabricksValidationException if WKT to WKB conversion fails
*/
byte[] getWkb() throws DatabricksValidationException;
/**
* Returns the Spatial Reference System Identifier (SRID) of the geospatial object.
*
* <p>SRID identifies the coordinate system used by the geometry. Common values include:
*
* <ul>
* <li>4326 - WGS 84 (World Geodetic System 1984)
* <li>3857 - Web Mercator
* <li>0 - No SRID specified
* </ul>
*
* @return the SRID value
*/
int getSrid();
/**
* Returns the Well-Known Text (WKT) representation of the geospatial object.
*
* <p>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.
*
* @return the WKT string representation
*/
String getWkt();
}