GeometryType (Spark 4.2.0 JavaDoc)
- All Implemented Interfaces:
Serializable
The data type representing GEOMETRY values which are spatial objects, as defined in the Open Geospatial Consortium (OGC) Simple Feature Access specification (https://portal.ogc.org/files/?artifact_id=25355), with a Cartesian coordinate system.
- See Also:
-
Constructor Summary
Constructors
-
Method Summary
booleanThe GeometryType with a mixed SRID can accept any other GeometryType, i.e.
apply(int srid) Constructors for GeometryType.
crs()intThe default size of a value of the GeometryType is 2048 bytes, which can store roughly 120 2D points.
booleanTwo types are considered equal iff they are both GeometryTypes and have the same SRID value.
static final intThe default coordinate reference system (CRS) value used for geometries, as specified by the Parquet, Delta, and Iceberg specifications.
inthashCode()The hash code of the GeometryType is derived from its SRID value.
booleanThe GeometryType is a mixed SRID type iff the SRID is MIXED_SRID.
static booleanisSridSupported(int srid) Returns whether the given SRID is supported.
org.json4s.JValueJSON representation of the GeometryType, which uses the CRS string, in line with the current storage specifications (e.g.
static final intintsrid()Spatial Reference Identifier (SRID) value of the geometry type.
toString()String representation of the GeometryType, which uses SRID for fixed SRID types and "ANY" for mixed SRID types, providing a clear and concise user-friendly format for this type.
typeName()Type name that is displayed to users.
Methods inherited from class org.apache.spark.sql.types.DataType
catalogString, COLLATIONS_METADATA_KEY, equalsIgnoreCaseAndNullability, equalsIgnoreNullability, equalsStructurally, equalsStructurallyByName, fromDDL, fromJson, json, parseTypeWithFallback, prettyJson, simpleString, sql
-
Constructor Details
-
GeometryType
public GeometryType()
-
-
Method Details
-
MIXED_SRID
public static final int MIXED_SRID()
-
MIXED_CRS
public static final String MIXED_CRS()
-
GEOMETRY_DEFAULT_SRID
public static final int GEOMETRY_DEFAULT_SRID()
The default coordinate reference system (CRS) value used for geometries, as specified by the Parquet, Delta, and Iceberg specifications. If crs is omitted, it should always default to this.
- Returns:
- (undocumented)
-
GEOMETRY_DEFAULT_CRS
public static final String GEOMETRY_DEFAULT_CRS()
-
isSridSupported
public static boolean isSridSupported
(int srid) Returns whether the given SRID is supported.
-
apply
Constructors for GeometryType.
- Parameters:
srid- (undocumented)- Returns:
- (undocumented)
-
apply
-
crs
-
srid
public int srid()
Spatial Reference Identifier (SRID) value of the geometry type.
- Returns:
- (undocumented)
-
defaultSize
public int defaultSize()
The default size of a value of the GeometryType is 2048 bytes, which can store roughly 120 2D points.
- Specified by:
defaultSizein classDataType- Returns:
- (undocumented)
-
isMixedSrid
public boolean isMixedSrid()
The GeometryType is a mixed SRID type iff the SRID is MIXED_SRID. Semantically, this means that different SRID values per row are allowed.
- Returns:
- (undocumented)
-
typeName
Type name that is displayed to users.
-
toString
String representation of the GeometryType, which uses SRID for fixed SRID types and "ANY" for mixed SRID types, providing a clear and concise user-friendly format for this type.
-
jsonValue
public org.json4s.JValue jsonValue()
JSON representation of the GeometryType, which uses the CRS string, in line with the current storage specifications (e.g. Parquet, Delta, Iceberg). Note that mixed SRID is disallowed, and only fixed SRID types can be stored. This is also in accordance to storage formats.
- Returns:
- (undocumented)
-
equals
public boolean equals
(Object obj) Two types are considered equal iff they are both GeometryTypes and have the same SRID value. For the GEOMETRY type, the SRID value uniquely identifies its type information.
-
hashCode
public int hashCode()
The hash code of the GeometryType is derived from its SRID value.
-
acceptsGeometryType
public boolean acceptsGeometryType
(GeometryType gt) The GeometryType with a mixed SRID can accept any other GeometryType, i.e. either a fixed SRID GeometryType or another mixed SRID GeometryType. Conversely, a GeometryType with a fixed SRID can only accept another GeometryType with the same fixed SRID value, and not a mixed SRID.
- Parameters:
gt- (undocumented)- Returns:
- (undocumented)
-