-
Notifications
You must be signed in to change notification settings - Fork 744
Open
Open
Copy link
Labels
Milestone
Description
In Sedona, we get an empty point back for a scalar envelope and an arbitrary polygon back for empty aggregate envelope:
from sedona.spark import *
config = SedonaContext.builder().getOrCreate()
sedona = SedonaContext.create(config)
sedona.sql("SELECT ST_Envelope(ST_GeomFromWKT('LINESTRING EMPTY'))").show()
#> +------------------------------------------------+
#> |st_envelope(st_geomfromwkt(LINESTRING EMPTY, 0))|
#> +------------------------------------------------+
#> | POINT EMPTY|
#> +------------------------------------------------+
sedona.sql("SELECT ST_Envelope_Aggr(ST_GeomFromWKT('LINESTRING EMPTY'))").show()
#> +-----------------------------------------------------+
#> |st_envelope_aggr(st_geomfromwkt(LINESTRING EMPTY, 0))|
#> +-----------------------------------------------------+
#> | POLYGON ((-1 -1, ...|
#> +-----------------------------------------------------+In PostGIS, we get an EMPTY of the same type back for a scalar ST_Envelope and a NULL back for empty input of an aggregate (there is no aggregate envelope in PostGIS that I'm aware of).
# docker run --rm postgis/postgis:latest
postgres=# SELECT ST_AsText(ST_Envelope(ST_GeomFromText('LINESTRING EMPTY')));
st_astext
------------------
LINESTRING EMPTY
(1 row)
postgres=# SELECT ST_AsText(ST_Extent(ST_GeomFromText('LINESTRING EMPTY')));
st_astext
-----------
(1 row)