jiayuasu opened a new issue, #1093:
URL: https://github.com/apache/sedona-db/issues/1093
`ST_Union_Agg` returns `NULL` when aggregating point geometries, instead of
the expected unioned `MULTIPOINT`. It works correctly for polygons, and
`ST_Collect_Agg` works correctly for points — so the issue appears specific to
`ST_Union_Agg` with point inputs.
## Reproduce
```sql
SELECT ST_AsText(ST_Union_Agg(g))
FROM (VALUES (ST_Point(0.0, 0.0)), (ST_Point(1.0, 1.0))) AS t(g);
-- actual: NULL
-- expected: MULTIPOINT((0 0),(1 1))
```
## Works as expected (for contrast)
`ST_Collect_Agg` on the same points:
```sql
SELECT ST_AsText(ST_Collect_Agg(g))
FROM (VALUES (ST_Point(0.0, 0.0)), (ST_Point(1.0, 1.0))) AS t(g);
-- MULTIPOINT((0 0),(1 1))
```
`ST_Union_Agg` on polygons (merges correctly):
```sql
SELECT ST_AsText(ST_Union_Agg(g))
FROM (VALUES
(ST_GeomFromText('POLYGON((0 0,2 0,2 2,0 2,0 0))')),
(ST_GeomFromText('POLYGON((1 1,3 1,3 3,1 3,1 1))'))
) AS t(g);
-- MULTIPOLYGON(((0 2,0 0,2 0,2 1,3 1,3 3,1 3,1 2,0 2)))
```
Only point inputs to `ST_Union_Agg` return `NULL`.
Found while writing a "Migrating from GeoPandas" dissolve example (GeoPandas
`dissolve` unions each group's geometry, which for points yields a
`MULTIPOINT`).
--
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]