paleolimbot opened a new issue, #1979:
URL: https://github.com/apache/sedona/issues/1979
In Sedona, we get an empty point back for a scalar envelope and an arbitrary
polygon back for empty aggregate envelope:
```python
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).
```shell
# 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)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]