ST_IsEmpty

ST_IsEmpty takes a geometry column and returns a boolean column. The output returns True if the geometry is empty; otherwise, it returns False.

FunctionSyntax
Pythonis_empty(geometry)
SQLST_IsEmpty(geometry)
ScalaisEmpty(geometry)

For more details, go to the GeoAnalytics Engine API reference for is_empty.

This function implements the OpenGIS Simple Features Implementation Specification for SQL 1.2.1

Examples

PythonPythonSQLScala
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
from geoanalytics.sql import functions as ST

data = [
    ("POINT (-2533858.73 8107527.81)",),
    ("POINT EMPTY", )
]

df = spark.createDataFrame(data, ["wkt"])\
          .select(ST.geom_from_text("wkt", srid=54008).alias("geometry"))

df.select(ST.is_empty("geometry").alias("is_empty")).show()
Result
Use dark colors for code blocksCopy
1
2
3
4
5
6
+--------+
|is_empty|
+--------+
|   false|
|    true|
+--------+

Version table

ReleaseNotes

1.0.0

Python and SQL functions introduced

1.5.0

Scala function introduced

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.